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

Unhelpful error message from camera.transform when passed PIXELS

    Details

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

      Description

      The command

      camera.transform(afwGeom.Point2D(*xy), cameraGeom.PIXELS, cameraGeom.FOCAL_PLANE)
      

      produces a very unhelpful error.  The problem is that you either need to use detector.transform or pass detector.makeCameraSys(cameraGeom.PIXELS) as the second argument.  The fix would be to intercept this C++ error in pybind11, or possibly add an overload to support this (incorrect) usage and throw a helpful exception 

      ---------------------------------------------------------------------------
      TypeError                                 Traceback (most recent call last)
      <ipython-input-15-854fb8af0938> in <module>
            5     x, y = camera.transform(afwGeom.Point2D(*xy), detector.makeCameraSys(cameraGeom.PIXELS), cameraGeom.FOCAL_PLANE)
            6 else:
      ----> 7     x, y = camera.transform(afwGeom.Point2D(*xy), cameraGeom.PIXELS, cameraGeom.FOCAL_PLANE)
            8 
            9 plt.plot(x, y, '+', color='red')
       
      TypeError: transform(): incompatible function arguments. The following argument types are supported:
          1. (self: lsst.afw.cameraGeom.camera.camera.Camera, point: lsst.geom.Point2D, fromSys: lsst.afw.cameraGeom.cameraSys.CameraSys, toSys: lsst.afw.cameraGeom.cameraSys.CameraSys) -> lsst.geom.Point2D
          2. (self: lsst.afw.cameraGeom.camera.camera.Camera, points: List[lsst.geom.Point2D], fromSys: lsst.afw.cameraGeom.cameraSys.CameraSys, toSys: lsst.afw.cameraGeom.cameraSys.CameraSys) -> List[lsst.geom.Point2D]
       
      Invoked with: <lsst.afw.cameraGeom.camera.camera.Camera object at 0x7f2bad8787d8>, Point2D(-0.5, -0.5), CameraSysPrefix(Pixels), CameraSys(FocalPlane)
      

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rhl Robert Lupton
              Watchers:
              Jim Bosch, Robert Lupton
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel