Uploaded image for project: 'Instrument control development'
  1. Instrument control development
  2. INSTRM-1463

Insert FITS headers into opdb

    XMLWordPrintable

    Details

    • Story Points:
      1

      Description

      INSTRM-1367 requested header card searches in obslog. That was implemented by adding opdb tables, along with an inserter function.

      When we request PFSx file archiving, add the headers. Just PHDU for now.

      Sample code was:

      import opdb.obslog
      import astropy.io.fits as pyfits
      from opdb.models import pfs_visit
      
      db = SessionClass()
      
      pfs_visit_id = 66453
      filestem = 'PFSA06645311'
      
      hdul = pyfits.HDUList([
        pyfits.PrimaryHDU(header=pyfits.Header([
          ('PI', 3.14, "ratio of a circle's circumference to its diameter"),
        ])),
      ])
      
      db.add_all(opdb.obslog.fits_headers_from_hdulist(hdul, pfs_visit_id, filestem):
      db.commit()
      

        Attachments

          Activity

            People

            • Assignee:
              cloomis cloomis
              Reporter:
              cloomis cloomis
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: