-
Notifications
You must be signed in to change notification settings - Fork 4
ICS and QLF interface
ICS will provide a python module called ICSInterface
to query the exposureDB
.
We have three methods, the first one to return summary information for the latest exposure or for a range of exposures:
ICSInterface.get_exposure_summary(data_range=None, expid_range=None, require_data_written=True)
"""
Input Arguments:
date_range - tuple with low and high datetime object. Timestamp is when data_written was updated. if "last" instead of tuple, only return newest
expid_range - tuple with low and high. If one is None, only use one expid. if "last" instead of tuple, only return newest
require_data_written - default True. If True, only return exposures where all data is on disk
Output:
list of dictionaries with exposure summary. Might be empty.
Raise exception if no range given, or if two ranges given
"""
this method returns a dictionary with the following keys (corresponding to the database column names, not necessarily identical to the FITS header keys):
- expid
- skyra (telra)
- skydec (teldec)
- exptime
- program (dark, grey, bright)
- tile_id (tile)
- exptype (or flavor?)
- date (dateobs) (UTC)
- night (YYYYMMDD) new field in the database, use that to have the same definition of night.
- seeing
- airmass
- transparency
- skylevel
- s2n
- data_written (flag defining that the data is ready to be used)
- data_location (ICS file system path, it is not decided yet if it will be readable by other subsystems)
there's another method to get the files associated to an exposure, the destination can be provided by us (if ICS does the copy) or we the data_location
field to execute rsync
on our side.
ICSInterface.get_exposure_files(expid, dest=None, file_class = ['spectro', 'fibermap'], overwrite=True)
"""
Input Arguments:
expid (required)
dest (optional, directory to copy data to, if given)
file_class (list of file classes to copy)
overwrite (default True; if True, and destination, copy files on top of existing)
Output:
file_path (either ours on NSF or dest after copy)
Exception if data_written boolean in exposure database is False
All other errors also raise exception
"""
List of files and classes returned:
- MEF FITS for all spectrograph CCDs (30) (spectro)
- MEF for all Guider images (guider)
- MEF for all SKY camera images (sky)
- MEF for all FVC images (fvc)
- MEF for all Focus images (focus)
- NFS input + Fiber map fits file (fibermap)
- ETC summary (etc)
NOTE: calibration files needed to run QL pipeline are not provided from ICS, we must generate them and put in some directory configured at qlf.cfg
.
and a third method can be used to register alarms so that they are displayed at the ICS Observer Console:
ICSInterface.alarm(self, message, level='EVENT', **kwargs)
"""
Send an alarm to DOS
The message will be recorded in the alarm database and the observer will be notified if an instance is running
The kwargs dictionary is passed on to the DOS alarm call and includes optional parameters such as id, logbook, email etc
"""