Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

ICS and QLF interface

Angelo Fausti Neto edited this page Oct 19, 2017 · 33 revisions

ICS QLF interface

ICS will provide a python module called ICSInterface to query the exposureDB.

We have two methods, 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)

and 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:

  • Multi-Ext. FITS for all Spectrograph CCDs
* Header incl. most of exposure DB info (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)