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

calibRoot needs to be specified for the input mapper

    Details

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

      Description

      While trying to adapt the dax-generating script to another butler repo other than the data repo of ci_hsc, I encountered a lookup error while attempting to get the path of a bias file, like this:

      workflow DEBUG: Finding bias with {'ccd': 0, 'visit': 628}
      Traceback (most recent call last):
        File "generateDax.py", line 155, in <module>
          dax = generateProcessCcdDax("HscDax", visits, ccdList)
        File "generateDax.py", line 124, in generateProcessCcdDax
          create=True, replaceRootPath=calibRepo)
        File "generateDax.py", line 60, in getDataFile
          fileEntry = lfn = filePath = mapFunc(dataId).getLocations()[0]
        File "/software/lsstsw/stack/Linux64/obs_base/12.1-21-gbdb6c2a+4/python/lsst/obs/base/cameraMapper.py", line 379, in mapClosure
          return mapping.map(mapper, dataId, write)
        File "/software/lsstsw/stack/Linux64/obs_base/12.1-21-gbdb6c2a+4/python/lsst/obs/base/mapping.py", line 124, in map
          actualId = self.need(iter(self.keyDict.keys()), dataId)
        File "/software/lsstsw/stack/Linux64/obs_base/12.1-21-gbdb6c2a+4/python/lsst/obs/base/mapping.py", line 260, in need
          (newProps, newId, len(lookups)))
      RuntimeError: No unique lookup for ['calibDate'] from {'ccd': 0, 'visit': 628}: 0 matches
      

      Adding calibRoot to the input mapper solves the error and Butler/Mapper can then find the calibration data.

      This bug didn't show up in the two examples currently in master, probably because there is only one set of calibration data in ci_hsc (only one 'calibDate' in the registry).

        Attachments

          Activity

          Hide
          hchiang2 Hsin-Fang Chiang added a comment -

          Do you mind taking a look? Should be quick.

          You once asked the role of "calibRepo" in the dax-generating script. I should have realized this bug back then.

          This patch makes no difference for the current "ciHsc" and "miniHscDrp" workflows, but I think it's still better to fix it to make it more correct. I compared the generated dax files before and after this patch, and they are the same.

          Show
          hchiang2 Hsin-Fang Chiang added a comment - Do you mind taking a look? Should be quick. You once asked the role of "calibRepo" in the dax-generating script. I should have realized this bug back then. This patch makes no difference for the current "ciHsc" and "miniHscDrp" workflows, but I think it's still better to fix it to make it more correct. I compared the generated dax files before and after this patch, and they are the same.
          Hide
          mkowalik Mikolaj Kowalik added a comment -

          Changes reviewed and approved.

          Show
          mkowalik Mikolaj Kowalik added a comment - Changes reviewed and approved.
          Hide
          hchiang2 Hsin-Fang Chiang added a comment -

          Thank you for the review.

          Merged.

          Show
          hchiang2 Hsin-Fang Chiang added a comment - Thank you for the review. Merged.

            People

            • Assignee:
              hchiang2 Hsin-Fang Chiang
              Reporter:
              hchiang2 Hsin-Fang Chiang
              Reviewers:
              Mikolaj Kowalik
              Watchers:
              Hsin-Fang Chiang, Mikolaj Kowalik
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: