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

Metadata is not persisted when persisting an ExposureCatalog to fits

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None

      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

            erykoff Eli Rykoff created issue -
            erykoff Eli Rykoff made changes -
            Field Original Value New Value
            Link This issue blocks DM-20163 [ DM-20163 ]
            tjenness Tim Jenness made changes -
            Component/s afw [ 10714 ]
            erykoff Eli Rykoff made changes -
            Assignee Jim Bosch [ jbosch ] Eli Rykoff [ erykoff ]
            erykoff Eli Rykoff made changes -
            Status To Do [ 10001 ] In Progress [ 3 ]
            erykoff Eli Rykoff made changes -
            Reviewers Jim Bosch [ jbosch ]
            Status In Progress [ 3 ] In Review [ 10004 ]
            jbosch Jim Bosch made changes -
            Status In Review [ 10004 ] Reviewed [ 10101 ]
            erykoff Eli Rykoff made changes -
            Resolution Done [ 10000 ]
            Status Reviewed [ 10101 ] Done [ 10002 ]
            swinbank John Swinbank made changes -
            Epic Link DM-21252 [ 414682 ]
            swinbank John Swinbank made changes -
            Story Points 1

              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: