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

Convert distortion script into more general plotting code

    XMLWordPrintable

    Details

    • Type: Story
    • Status: In Review
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: jointcal
    • Labels:
      None
    • Team:
      Data Release Production

      Description

      The code to compute a distortion model in DM-18845 seems to do the job. It would be nice to turn it into something that could be run on any jointcal output, since jointcal does not yet produce an "official" distortion model (the atmosphere is still mixed in). I could see this being useful to look at jointcal's output, and would propose to put it into jointcal/bin, along with the existing plot_photoCalib script there.

      The existing code has a butler and other things hard-coded: we can replace that with ArgumentParser options that load the appropriate data, and maybe some to make adjustments to the plots (maybe turning on/off the default CameraGeom overplot?).

      Would it be possible to have the code output an updated distortion model or Camera geometry from the mean of its inputs? That seems like another reasonable cmdline argument.

        Attachments

          Issue Links

            Activity

            Hide
            Parejkoj John Parejko added a comment -

            I don't know how busy you are, but having this more general script would be a help to us in our improvements to initial astrometry as part of DM-19943. We're probably going to have to update various camera geometries to include better distortion components.

            Show
            Parejkoj John Parejko added a comment - I don't know how busy you are, but having this more general script would be a help to us in our improvements to initial astrometry as part of DM-19943 . We're probably going to have to update various camera geometries to include better distortion components.
            Hide
            jmeyers314 Joshua Meyers added a comment -

            I can work on this today.

            However, I'm not sure I understand what you mean by "turning on/off the default CameraGeom overplot" or "output an updated distortion model or Camera geometry..."  Can you clarify or maybe just point me to relevant sections of (I assume) afw?

            Show
            jmeyers314 Joshua Meyers added a comment - I can work on this today. However, I'm not sure I understand what you mean by "turning on/off the default CameraGeom overplot" or "output an updated distortion model or Camera geometry..."  Can you clarify or maybe just point me to relevant sections of (I assume) afw?
            Hide
            Parejkoj John Parejko added a comment -

            For the first one, I was thinking of the dashed line in one of your plots that showed the distortion model that came from CameraGeom (at least, I assume that's where you got it from). This would let us see how far off the existing Camera model is.

            For the second, it would be nice to be able to produce a set of distortion terms to feed back into Camera, so that we can easily update the camera distortion models from this (until Joincal produces that model directly). I think the code you put on DM-18845 was not fitting a polynomial to your computed distortion, so this would be an additional, possibly optional feature of the more generic script.

            Show
            Parejkoj John Parejko added a comment - For the first one, I was thinking of the dashed line in one of your plots that showed the distortion model that came from CameraGeom (at least, I assume that's where you got it from). This would let us see how far off the existing Camera model is. For the second, it would be nice to be able to produce a set of distortion terms to feed back into Camera, so that we can easily update the camera distortion models from this (until Joincal produces that model directly). I think the code you put on DM-18845 was not fitting a polynomial to your computed distortion, so this would be an additional, possibly optional feature of the more generic script.
            Hide
            jmeyers314 Joshua Meyers added a comment -

            distortion model that came from CameraGeom (at least, I assume that's where you got it from). 

            I see.  No, I got that model from my own code that raytraces through the HSC optics.  If there's a generic thing for all cameras though, I'd love to hear about it.  (I do see https://github.com/lsst/obs_subaru/blob/master/python/lsst/obs/hsc/transformRegistry.py#L10 now, but I don't immediately see anything similar in other obs_* packages).

            I can certainly print out polynomial fits to the estimated pixel scales.

            Show
            jmeyers314 Joshua Meyers added a comment - distortion model that came from CameraGeom (at least, I assume that's where you got it from).  I see.  No, I got that model from my own code that raytraces through the HSC optics.  If there's a generic thing for all cameras though, I'd love to hear about it.  (I do see https://github.com/lsst/obs_subaru/blob/master/python/lsst/obs/hsc/transformRegistry.py#L10  now, but I don't immediately see anything similar in other obs_* packages). I can certainly print out polynomial fits to the estimated pixel scales.
            Hide
            Parejkoj John Parejko added a comment -

            You should be able to get it from the FOCAL_PLANE -> FIELD_ANGLE Transform of a given Camera (which you can also get from the Detector object). But that's just a black-box transform, I don't think you can really interrogate it about what its values are. I don't know that we have any consistent way that these are encoded, currently.

            Show
            Parejkoj John Parejko added a comment - You should be able to get it from the FOCAL_PLANE -> FIELD_ANGLE Transform of a given Camera (which you can also get from the Detector object). But that's just a black-box transform, I don't think you can really interrogate it about what its values are. I don't know that we have any consistent way that these are encoded, currently.
            Hide
            jmeyers314 Joshua Meyers added a comment -

            Cleaned up script and made it a bit more general.  A couple comments:

            • I initially tried to find all visits associated with a given tract, similar to the code in bin.src/plot_photoCalib.py.  That seemed to run awfully slowly though, so I fell back to requiring specific visits as input args.
            • For now I didn't add the camera object FOCAL_PLANE -> FIELD_ANGLE transform to the plot since this seems to currently be broken for HSC.
            Show
            jmeyers314 Joshua Meyers added a comment - Cleaned up script and made it a bit more general.  A couple comments: I initially tried to find all visits associated with a given tract, similar to the code in bin.src/plot_photoCalib.py.  That seemed to run awfully slowly though, so I fell back to requiring specific visits as input args. For now I didn't add the camera object FOCAL_PLANE -> FIELD_ANGLE transform to the plot since this seems to currently be broken for HSC.

              People

              Assignee:
              jmeyers314 Joshua Meyers
              Reporter:
              Parejkoj John Parejko
              Reviewers:
              John Parejko
              Watchers:
              John Parejko, Joshua Meyers, Yusra AlSayyad
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: