Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-33899

OCPS Script: Log to EFD

    XMLWordPrintable

Details

    • Story
    • Status: Invalid
    • Resolution: Done
    • None
    • None
    • None
    • Data Release Production
    • No

    Description

      OCPS calib script: log information to the efd (engineering facility database)

      https://github.com/lsst-ts/ts_externalscripts/blob/develop/python/lsst/ts/externalscripts/base_make_calibrations.py

      Attachments

        Activity

          The information logged by base_make_calibrations.py and its subclasses is already being logged to the EFD and can be retrieved like this (Credit: Erik Dennihy):

          https://gist.github.com/edennihy/f286a6919cf998052641be350498acac

          import numpy as np
           
          import pandas as pd
           
          from astropy.time import Time
          from lsst_efd_client import EfdClient,resample
          efd = EfdClient('usdf_efd')
          cl = efd.influx_client
          tbefore = Time('2023-05-04T00:00:00.00', format='isot', scale='utc')
          tafter = Time('2023-05-13T00:00:00.00', format='isot', scale='utc')
           
          base_log_query_str = f'''
                  SELECT salIndex, ScriptID, message, filePath
                  FROM "lsst.sal.Script.logevent_logMessage"
                  WHERE time > '{tbefore.isot}Z' and time <= '{tafter.isot}Z' and filePath='/net/obs-env/auto_base_packages/ts_externalscripts/python/lsst/ts/externalscripts/base_make_calibrations.py'
                  '''
          base_logs = await cl.query(base_log_query_str)
           
          base_logs
          
          

          plazas Andrés Alejandro Plazas Malagón added a comment - - edited The information logged by base_make_calibrations.py and its subclasses is already being logged to the EFD and can be retrieved like this (Credit: Erik Dennihy): https://gist.github.com/edennihy/f286a6919cf998052641be350498acac import numpy as np   import pandas as pd   from astropy.time import Time from lsst_efd_client import EfdClient,resample efd = EfdClient('usdf_efd') cl = efd.influx_client tbefore = Time('2023-05-04T00:00:00.00', format='isot', scale='utc') tafter = Time('2023-05-13T00:00:00.00', format='isot', scale='utc')   base_log_query_str = f''' SELECT salIndex, ScriptID, message, filePath FROM "lsst.sal.Script.logevent_logMessage" WHERE time > '{tbefore.isot}Z' and time <= '{tafter.isot}Z' and filePath='/net/obs-env/auto_base_packages/ts_externalscripts/python/lsst/ts/externalscripts/base_make_calibrations.py' ''' base_logs = await cl.query(base_log_query_str)   base_logs

          People

            plazas Andrés Alejandro Plazas Malagón
            plazas Andrés Alejandro Plazas Malagón
            Andrés Alejandro Plazas Malagón, Christopher Waters
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Jenkins

                No builds found.