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

Metadata is not persisted when persisting an ExposureCatalog to fits

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None
    • Templates:
    • Story Points:
      1
    • Team:
      Data Release Production

      Description

      When writing an ExposureCatalog to FITS, the metadata property list is not persisted. When writing a test case for this I ran into the problem that the case of the property list values is not always round-trippable ( https://community.lsst.org/t/fits-and-lowercase-header-keys/1184/3 ) but by looking at the header of the persisted file I see that this is unrelated to the current issue. That is, the metadata is not persisted to the FITS file for an ExposureCatalog with any case.

      import lsst.afw.table as afwTable
      import lsst.daf.base as dafBase
      import lsst.geom
       
      name = 'TEST'
       
      schema = afwTable.ExposureTable.makeMinimalSchema()
      cat = afwTable.ExposureCatalog(schema)
      cat.reserve(1)
      rec = cat.addNew()
       
      plist = dafBase.PropertyList()
      plist.addDouble(name, 1.0)
       
      cat.setMetadata(plist)
       
      print(cat.getMetadata()[name])
       
      cat.writeFits('%s_expcatalog_metadata.fits' % (name))
       
      cat2 = afwTable.ExposureCatalog.readFits('%s_expcatalog_metadata.fits' % (name))
       
      print(cat2.getMetadata()[name])
      
      

      This results in a KeyError: 'TEST not found'.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                erykoff Eli Rykoff
                Reporter:
                erykoff Eli Rykoff
                Reviewers:
                Jim Bosch
                Watchers:
                Eli Rykoff, Jim Bosch, Tim Jenness
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel