.. _het-python-interface: Hetlib Python Interface *********************** .. py:module:: hetlib The module, **hetlib**, defines useful functions and the basic configuration information. The **hetlib** package imports the low level packages :ref:`tcssubsystem-label` and provides wrappers for functionality so it is not necceasary to explicitly import the th low level package. You only need to have the line :: import hetlib in your file to get the full functionality of these packages. Contants defined in hetlib: .. py:data:: named_route The default URL for the :ref:`Control_System_def-label` **tcsnamed**, defined as 'tcp://192.168.66.99:30000' A number of site specific constants are defined: .. py:data:: Latitude_deg The latitude of the Het is 30.681436 degrees .. py:data:: Latitude_rad Defined as ``radians(Latitude_deg)`` .. py:data:: LongitudeWest_deg The longitude of the het is 104.014742 degrees west .. py:data:: LongitudeWest_rad Defined as ``radians(LongitudeWest_deg)`` .. py:data:: LongitudeEast_deg Defined as ``360.0 - LongitudeWest_deg`` .. py:data:: LongitudeEast_rad Defined as ``radians(LongitudeEast_deg)`` .. py:data:: Altitude_deg The elevation alitude of the Het primary mirror is 55.055223 degrees .. py:data:: Altitude_rad Defined as ``radians(Altitude_deg)`` .. py:data:: Height_meters The height of the Het telescope center of the primary is 2003.0 meters .. py:data:: Fs_meters The Focal length of the Het primary mirror is 13.37884180 meters .. py:data:: Fs_millimeters Defined as ``Fs_meters * 1000.0`` .. py:data:: het_P Defined as ``cos(Altitude_rad) * cos(Latitude_rad)`` radians .. py:data:: het_Q Defined as ``sin(Altitude_rad) * sin(Latitude_rad)`` radians .. py:data:: BetaLimit_deg The angular limit for trajectories is 8.5 degrees .. py:data:: BetaLimit_rad Defined as ``radians(BetaLimit_deg)`` Hetlib Python Modules ===================== .. _tcsutils-label: tcsutils.py ----------- .. py:currentmodule:: tcsutils ``tcsutils`` contains the workhorse functions for your python scripts. The principal one for client programs is ``start_clients()``. The ``tcsutils`` module provides the following constant. .. py:data:: named_route The default URI for the :ref:`tcs_named-label`, defined as 'tcp://192.168.66.99:30000' The following functions are defined: .. py:method:: start_clients(tcs, tracker, legacy, pas, pfip, apc, lrs2, vdas, named, verbose) Start one or a number of clients links. The default values for the system names in ``start_client()` are False. Set them to be true to create a handle (as described in :ref:`tcssubsystem-label`. The function returns a dictionary of handles to Control Systems. :: client_dict = start_clients(tcs=True, virus=True) tcsClient = client_dict['tcs'] virusClient = client_dict['virus'] hetutils.py ----------- .. py:module:: hetutils .. automodule:: hetutils :members: A number of constants are defined in hetutils and are duplicated in hetlib. Their use from hetutils is deprecated and they will be removed from hetutils at a future date. Latitude_deg = 30.681436 Latitude_rad = radians(Latitude_deg) LongitudeWest_deg = 104.014742 LongitudeWest_rad = radians(LongitudeWest_deg) LongitudeEast_deg = 360.0 - LongitudeWest_deg LongitudeEast_rad = radians(LongitudeEast_deg) Altitude_deg = 55.055223 Altitude_rad = radians(Altitude_deg) Height_meters = 2003.0 Fs_meters = 13.37884180 Fs_millimeters = Fs_meters * 1000.0 het_P = cos(Altitude_rad) * cos(Latitude_rad) # radians het_Q = sin(Altitude_rad) * sin(Latitude_rad) # radians # limit on the total angular travel of the tracker BetaLimit_deg = 8.5 BetaLimit_rad = radians(BetaLimit_deg) .. _hetTime-label: hetTime.py ---------- .. automodule:: hetTime :members: The commands available are shown in the following matrix +----------+---------------+-----------------+-----------------+----------------+ | From/To | DT | ISO | Index | Unix | +==========+===============+=================+=================+================+ | DT | | DT_To_ISO() | DT_To_Index() | DT_To_Unix() | +----------+---------------+-----------------+-----------------+----------------+ | ISO | ISO_To_DT() | | ISO_To_Index() | ISO_To_Unix() | +----------+---------------+-----------------+-----------------+----------------+ | Index | Index_To_DT() | Index_To_ISO() | | Index_To_Unix()| +----------+---------------+-----------------+-----------------+----------------+ | Unix | Unix_To_DT() | Unix_To_ISO() | Unix_To_Index() | | +----------+---------------+-----------------+-----------------+----------------+ .. _points-label: Points.py --------- .. automodule:: Points :members: There are a number of pre-defined lists of points given in the dictionary ``knownLists``. The dictionary contains keys of the form ``'List_97'`` and the value of such a key is a list of the form [1,2,3,4,5,..95,96,97]. Note that the number given in the list is one more than the entry value in Points. 'List_97' is the array of all points, .. image:: ./Images/points97.png 'List_21' is the sparse 21 point array, .. image:: ./Images/points21.png 'List_Q1' is the array of all points in the upper right quadrant, .. image:: ./Images/pointsQ1.png 'List_Q2' is the array of all points in the lower right quadrant, .. image:: ./Images/pointsQ2.png 'List_Q3' is the array of all points in the lower left quadrant, .. image:: ./Images/pointsQ3.png 'List_Q4' is the array of all points in the upper left quadrant, .. image:: ./Images/pointsQ4.png