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

Compare LSST and HSC pipelines through ISR

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: pipe_tasks
    • Labels:
      None
    • Story Points:
      10
    • Sprint:
      Science Pipelines DM-W16-6, DRP W16-7
    • Team:
      Data Release Production

      Description

      Run both the HSC and LSST ISR routines on two to three visits worth of HSC engineering data. Compare the results. Where differences exist, either:

      • Create and work other tickets to resolve them;
      • Explain their origin and why we don't think they are a problem.

        Attachments

          Issue Links

            Activity

            Hide
            lauren Lauren MacArthur added a comment - - edited

            I have also noted a small difference between the HSC/LSST overscanCorrection routines in how
            bin centers are determined for interpolation. The relevant code is:
            https://github.com/HyperSuprime-Cam/ip_isr/blob/master/python/lsst/ip/isr/isr.py#L445
            and
            https://github.com/lsst/ip_isr/blob/master/python/lsst/ip/isr/isr.py#L366
            They result in slightly different bin centers:

            Example output:
            HSC:
            binCenters =  [-0.96667465 -0.90002395 -0.83337324 -0.76672254 -0.70007184 -0.63342114
             -0.56677043 -0.50011973 -0.43346903 -0.36681833 -0.30016762 -0.23351692
             -0.16686622 -0.10021552 -0.03356481  0.03308589  0.09973659  0.16638729
              0.23303799  0.2996887   0.3663394   0.4329901   0.4996408   0.56629151
              0.63294221  0.69959291  0.76624361  0.83289432  0.89954502  0.96619572]
             
            LSST:
            binCenters =  [-0.96671456 -0.89990421 -0.83333333 -0.76676245 -0.70019157 -0.63362069
             -0.56681034 -0.5        -0.43342912 -0.36685824 -0.30028736 -0.23371648
             -0.16690613 -0.10009579 -0.0335249   0.03304598  0.09961686  0.16618774
              0.23299808  0.29980843  0.36637931  0.43295019  0.49952107  0.56609195
              0.6329023   0.69971264  0.76628352  0.83285441  0.89942529  0.96623563]
            

            The LSST version is being deemed the better version, so for the purposes of this detailed comparison, I have run these data using a branch on the HSC side that uses the LSST version.

            I also noted an issue with the crosstalk correction on the HSC stack, as summarized here:

            I have uncovered that the crosstalk correction 
            for nQuarter=2 CCDs is not being applied properly on the HSC stack.
             
            My reasoning is as follows:
             
            crosstalk.py in obs_subaru assumes it is being fed an image whose LLC 
            (pixel 0,0) is associated with the LLC of Amp1.  HSC has rotated chips 
            whose pixel 0,0 is always associated with the LLC in the focal plane, so
            they are no longer tied to the same Amp for any nQuarter !=0 CCDs. 
            This is why the crosstalk correction is called with the rotated context 
            manager here: 
             
            https://github.com/HyperSuprime-Cam/obs_subaru/blob/master/python/lsst/obs/subaru/isr.py#L304
             
            However, that context manager only rotates images if nQuarter % 2 here: 
             
            https://github.com/HyperSuprime-Cam/obs_subaru/blob/master/python/lsst/obs/subaru/isr.py#L363.  
             
            Thus the nQuarter=2 CCDs are not getting rotated such that pixel 0,0 refers 
            to Amp1's LLC (it actually refers to Amp4's URC).
             
            I discovered this because LSST maintains a coordinate system tied to the
            electronics for all CCDs (i.e. pixel 0,0 always refers to LLC of Amp1), so no
            such rotations are required.  When I differenced images from each stack just
            after crosstalk correction, the nQuarter=2 CCDs showed differences.
             
            For a visual, the attached plot shows the following:
             
            Upper panels (left: HSC stack, right: LSST stack): difference of image just 
            before and after crosstalk correction (effectively the crosstalk correction itself)
             
            They look quite similar by eye, however...
             
            Lower panel: the difference between the two upper panels (i.e. the difference 
            in the effective crosstalk correction between the stacks).  
             
            For every nQuarter != 2 CCD, the lower panel is exactly 0.  If I remove the 
            nQuarter % 2 clause in the rotate context manager on the HSC stack, the 
            crosstalk between the two stacks is identical for all CCDs, regardless of 
            orientation in the focal plane.  I have thus been running these comparison 
            using a branch with this modification on the HSC stack.
            

            Show
            lauren Lauren MacArthur added a comment - - edited I have also noted a small difference between the HSC/LSST overscanCorrection routines in how bin centers are determined for interpolation. The relevant code is: https://github.com/HyperSuprime-Cam/ip_isr/blob/master/python/lsst/ip/isr/isr.py#L445 and https://github.com/lsst/ip_isr/blob/master/python/lsst/ip/isr/isr.py#L366 They result in slightly different bin centers: Example output: HSC: binCenters = [-0.96667465 -0.90002395 -0.83337324 -0.76672254 -0.70007184 -0.63342114 -0.56677043 -0.50011973 -0.43346903 -0.36681833 -0.30016762 -0.23351692 -0.16686622 -0.10021552 -0.03356481 0.03308589 0.09973659 0.16638729 0.23303799 0.2996887 0.3663394 0.4329901 0.4996408 0.56629151 0.63294221 0.69959291 0.76624361 0.83289432 0.89954502 0.96619572]   LSST: binCenters = [-0.96671456 -0.89990421 -0.83333333 -0.76676245 -0.70019157 -0.63362069 -0.56681034 -0.5 -0.43342912 -0.36685824 -0.30028736 -0.23371648 -0.16690613 -0.10009579 -0.0335249 0.03304598 0.09961686 0.16618774 0.23299808 0.29980843 0.36637931 0.43295019 0.49952107 0.56609195 0.6329023 0.69971264 0.76628352 0.83285441 0.89942529 0.96623563] The LSST version is being deemed the better version, so for the purposes of this detailed comparison, I have run these data using a branch on the HSC side that uses the LSST version. I also noted an issue with the crosstalk correction on the HSC stack, as summarized here: I have uncovered that the crosstalk correction for nQuarter=2 CCDs is not being applied properly on the HSC stack.   My reasoning is as follows:   crosstalk.py in obs_subaru assumes it is being fed an image whose LLC (pixel 0,0) is associated with the LLC of Amp1.  HSC has rotated chips whose pixel 0,0 is always associated with the LLC in the focal plane, so they are no longer tied to the same Amp for any nQuarter !=0 CCDs. This is why the crosstalk correction is called with the rotated context manager here:   https://github.com/HyperSuprime-Cam/obs_subaru/blob/master/python/lsst/obs/subaru/isr.py#L304   However, that context manager only rotates images if nQuarter % 2 here:   https://github.com/HyperSuprime-Cam/obs_subaru/blob/master/python/lsst/obs/subaru/isr.py#L363.     Thus the nQuarter=2 CCDs are not getting rotated such that pixel 0,0 refers to Amp1's LLC (it actually refers to Amp4's URC).   I discovered this because LSST maintains a coordinate system tied to the electronics for all CCDs (i.e. pixel 0,0 always refers to LLC of Amp1), so no such rotations are required. When I differenced images from each stack just after crosstalk correction, the nQuarter=2 CCDs showed differences.   For a visual, the attached plot shows the following:   Upper panels (left: HSC stack, right: LSST stack): difference of image just before and after crosstalk correction (effectively the crosstalk correction itself)   They look quite similar by eye, however...   Lower panel: the difference between the two upper panels (i.e. the difference in the effective crosstalk correction between the stacks).   For every nQuarter != 2 CCD, the lower panel is exactly 0. If I remove the nQuarter % 2 clause in the rotate context manager on the HSC stack, the crosstalk between the two stacks is identical for all CCDs, regardless of orientation in the focal plane. I have thus been running these comparison using a branch with this modification on the HSC stack.
            Hide
            lauren Lauren MacArthur added a comment -

            With the above issues resolved, the image and mask planes compare IDENTICALLY at all stages of ISR removal for visit 904030 and for CCDs 49, 9, and 102 for visit 904028. CCD 100 for visit 904028 is very nearly identical all the way through ISR. A small difference shows up just after defect interpolation. I believe this is simply an artifact of the interpolation being performed in the opposite direction of the CCD (because of the 270deg rotation, both CCD and defects list are transposed before interpolation in HSC, whereas the LSST stack maintains the CCD orientation tied to the electronics). The difference in the HSC vs LSST images for CCD 100 from the defect interpolation stage onwards are: mean = -7.1365e-12, stdev = 2.08705e-08.

            Show
            lauren Lauren MacArthur added a comment - With the above issues resolved, the image and mask planes compare IDENTICALLY at all stages of ISR removal for visit 904030 and for CCDs 49, 9, and 102 for visit 904028. CCD 100 for visit 904028 is very nearly identical all the way through ISR. A small difference shows up just after defect interpolation. I believe this is simply an artifact of the interpolation being performed in the opposite direction of the CCD (because of the 270deg rotation, both CCD and defects list are transposed before interpolation in HSC, whereas the LSST stack maintains the CCD orientation tied to the electronics). The difference in the HSC vs LSST images for CCD 100 from the defect interpolation stage onwards are: mean = -7.1365e-12, stdev = 2.08705e-08 .
            Hide
            lauren Lauren MacArthur added a comment -

            John, would you mind giving this a look?

            Show
            lauren Lauren MacArthur added a comment - John, would you mind giving this a look?
            Hide
            swinbank John Swinbank added a comment -

            Thank you for getting this done and for the useful write-up above. I have only one question: regarding the selection of bin centres, you write:

            The LSST version is being deemed the better version

            What was the basis for this, and is it recorded anywhere other than here?

            Other than that, I see no reason not to close this down now. Thanks again!

            Show
            swinbank John Swinbank added a comment - Thank you for getting this done and for the useful write-up above. I have only one question: regarding the selection of bin centres, you write: The LSST version is being deemed the better version What was the basis for this, and is it recorded anywhere other than here? Other than that, I see no reason not to close this down now. Thanks again!
            Hide
            price Paul Price added a comment -

            One reason is that the LSST code went through extra review, during which that part was fixed, so the LSST code deals with masked pixels, while the HSC code doesn't.

            Show
            price Paul Price added a comment - One reason is that the LSST code went through extra review, during which that part was fixed, so the LSST code deals with masked pixels, while the HSC code doesn't.

              People

              • Assignee:
                lauren Lauren MacArthur
                Reporter:
                jbosch Jim Bosch
                Reviewers:
                John Swinbank
                Watchers:
                Frossie Economou, Hsin-Fang Chiang, Jim Bosch, John Swinbank, Lauren MacArthur, Paul Price
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel