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

Warping an ExposureU gives all zeroes back

    Details

    • Type: Story
    • Status: To Do
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None
    • Templates:
    • Team:
      Data Release Production

      Description

      When warping an exposure (and I think an image), if the datatype is U then it comes back as all zeroes, and silently. This can be worked around by casting to F.

      A minimal working example is:

      import lsst.afw.math as afwMath
      import lsst.daf.persistence as dafPersist
      import numpy as np
       
      butler = dafPersist.Butler('/datasets/hsc/repo/')
       
      dataId = {'visit': 902872, 'ccd': 20}
      exp = butler.get('raw', dataId=dataId)
      print(exp.getMaskedImage().getImage().getArray())
      print("Max:", np.max(exp.getMaskedImage().getImage().getArray()))
      print("Min:", np.min(exp.getMaskedImage().getImage().getArray()))
       
      kernelName = "lanczos2"
      warper = afwMath.Warper(kernelName)
      rotatedExp = warper.warpExposure(exp.getWcs(), exp)
       
      print(rotatedExp.getMaskedImage().getImage().getArray())
      print("Max:", np.max(rotatedExp.getMaskedImage().getImage().getArray()))
      print("Min:", np.min(rotatedExp.getMaskedImage().getImage().getArray()))
      

      If you go all the way back to w_2018_06 I think the problem is fixed, but since then the bug seems to have been present.

      Yusra AlSayyadtook a look (and in fact it was her who discovered the bug's details) and says it's way down in the C++.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mfisherlevine Merlin Fisher-Levine
              Watchers:
              John Swinbank, Merlin Fisher-Levine, Yusra AlSayyad
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel