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

HSC camera in obs_subaru has the incorrect pixel scale

    XMLWordPrintable

Details

    • Bug
    • Status: Won't Fix
    • Resolution: Done
    • None
    • obs_subaru
    • None
    • 1
    • Data Release Production

    Description

      The pixel scale in `obs_subaru` is set to 1.0, making focal plane to sky transformations impossible without external information. For example, with code I borrowed from rhl: (Note that it requires `testdata_jointcal` to be `setup`)

       
      import lsst.daf.persistence as dafPersistence
      import lsst.afw.geom as afwGeom
      import lsst.utils
      import numpy as np
      import astshim
      import os
      import lsst.afw.cameraGeom as cameraGeom
       
      dataDir = lsst.utils.getPackageDir('testdata_jointcal')
       
      butler = dafPersistence.Butler(os.path.join(dataDir, 'hsc'))
      camera = butler.get('camera')
      detector = camera[1]
       
      boresight = afwGeom.Point2D(0.0, 0.0)
      rotation = 0*afwGeom.degrees
       
      trans = camera.getTransform(detector.makeCameraSys(cameraGeom.PIXELS),
      detector.makeCameraSys(cameraGeom.FIELD_ANGLE))
      polyMap = trans.getMapping()
      radToDeg = astshim.ZoomMap(2, 180/np.pi) # convert from radians to degrees
      polyMap = polyMap.then(radToDeg)
       
      pixelFrame = astshim.Frame(2, "Domain=PIXELS")
      iwcFrame = astshim.Frame(2, "Domain=IWC")
       
      frameDict = astshim.FrameDict(pixelFrame, polyMap, iwcFrame)
       
      crpix = afwGeom.PointD(0, 0)
      crval = afwGeom.SpherePoint(*boresight, afwGeom.degrees)
      cd = afwGeom.makeCdMatrix(1.0*afwGeom.degrees, -(rotation + 90*afwGeom.degrees), True)
      iwcToSkyWcs = afwGeom.makeSkyWcs(crpix, crval, cd)
       
      iwcToSkyMap = iwcToSkyWcs.getFrameDict().getMapping("PIXELS", "SKY")
      skyFrame = iwcToSkyWcs.getFrameDict().getFrame("SKY")
       
      frameDict.addFrame("IWC", iwcToSkyMap, skyFrame)
       
      wcs = afwGeom.SkyWcs(frameDict)
       
      print(wcs.getPixelScale().asArcseconds())
       

      This returns "1.0 arcseconds" which is clearly wrong. Using decam instead of hsc above returns "0.2634 arcseconds" which is correct.

      Attachments

        Issue Links

          Activity

            erykoff, I think I have this sorted out and have pushed a tickets/DM-20289 branch to obs_subaru.
            I tried running your script above with the current weekly w_2019_26 and the new obs_subaru branch and it now prints (for hsc):

            0.16796977111540523
            

            I am about to add more comments to the ticket, but I wanted see if you have any other specific validation tests to run (they would be welcome!)

            lauren Lauren MacArthur added a comment - erykoff , I think I have this sorted out and have pushed a tickets/ DM-20289 branch to obs_subaru . I tried running your script above with the current weekly w_2019_26 and the new obs_subaru branch and it now prints (for hsc): 0.16796977111540523 I am about to add more comments to the ticket, but I wanted see if you have any other specific validation tests to run (they would be welcome!)
            erykoff Eli Rykoff added a comment -

            Thanks! I guess the question is if the output of this script is a reasonable WCS. I didn't get that far, and am not quite sure how to test that.

            erykoff Eli Rykoff added a comment - Thanks! I guess the question is if the output of this script is a reasonable WCS. I didn't get that far, and am not quite sure how to test that.

            Yes, I think we are doing a thorough testing of the WCSs that come out (more figures to be posted on DM-20289), so hopefully all is good and self-consistent now...

            lauren Lauren MacArthur added a comment - Yes, I think we are doing a thorough testing of the WCSs that come out (more figures to be posted on DM-20289 ), so hopefully all is good and self-consistent now...
            erykoff Eli Rykoff added a comment -

            Good news! As of DM-20548, I have confirmed that this issue is fixed. Thanks, lauren!

            erykoff Eli Rykoff added a comment - Good news! As of DM-20548 , I have confirmed that this issue is fixed. Thanks, lauren !

            People

              Unassigned Unassigned
              erykoff Eli Rykoff
              Eli Rykoff, John Parejko, Lauren MacArthur, Robert Lupton
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Jenkins

                  No builds found.