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

Investigate effect of reducing background fit Chebyshev polynomial order in DC2

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Story Points:
      12
    • Epic Link:
    • Team:
      Data Release Production
    • Urgent?:
      No

      Description

      The DC2 survey paper (Abolfathi et al. 2021) turns on the sky correction task by default (with configs originally copied from obs_subaru). However, obs_lsst does not turn on sky correction (i.e., doApplySkyCorr=False). There are two key problems with skyCorr: first, testing has struggled to reproduce the DC2 survey paper results (see DM-29715 ); and second, skyCorrectionTask is extremely memory intensive.

      This ticket aims to investigate whether an alternative solution to applying sky correction task might be to instead reduce the order of the Chebyshev polynomial used to fit the background in visit-level data. As DC2 backgrounds are simple to begin with, this is a valid approach. From the DC2 survey paper (Section 6.1.2, page 22):

      Other current approximations, to which we found that our results are insensitive, include ... holding the sky brightness constant across each sensor (intra-CCD sky variations were found to be less than the Poisson noise of the sky background).

      In this ticket, we experiment in reducing DC2 data using Chebyshev polynomials of order 0, 1 and 2 to fit the background, and compare these outputs to the defaults currently being used (i.e., a Chebyshev polynomial of order 6). Visit lists for visits overlapping test_med_1 tract 3828, patch 24 (i.e., approximately central) are generated. The collection 2.2i/runs/test-med-1/w_2021_24/DM-30674 is used to find visits overlapping this tract/patch. In addition, three visits from tract 3263, patch 21 are also processed, to allow for a direct comparison to the dataset shown in the DC2 survey paper. The collection 2.2i/defaults/DP0 is used as the input collection for rerun data processing.

      The full list of visits processed as part of this ticket are:

      3828/24: g [159471, 159491, 183772]
      3828/24: r [162699, 193147, 193189]
      3828/24: i [174534, 192355, 204706]
      3828/24: z [7997, 7998, 8003]
      3828/24: y [5884, 12466, 37657]
      3263/21: r [40318, 40351, 185822]
      

      The base $OBS_LSST_DIR/pipelines/imsim/DRP.yaml pipeline is used to process data. Starting with 2.2i/defaults/DP0 as the input collection, the above visits are processed through single frame processing and multi visit.

      singleFrame:

      multiVisit:

      The config option approxOrderX sets the approximation order in X (and Y) for background Chebyshev fitting. At the time of writing, this config option appears in the singleFrame/multiVisit tasks listed below. Here I'm setting approxOrderX=1, reducing the order of the Chebyshev polynomial from it's default value of 6. Other orders tested in addition to 1 as part of this ticket are 0 and 2. Config options which are commented out are those where useApprox=False (approxOrderX is valid only with useApprox=True, but all config options are listed here, for reference).

      singleFrame:

      * characterizeImage
       
      config.background.approxOrderX=1
      config.detection.background.approxOrderX=1
      # config.detection.tempLocalBackground.approxOrderX=1
      # config.detection.tempWideBackground.approxOrderX=1
      # config.repair.cosmicray.background.approxOrderX=1
       
      * calibrate
       
      config.detection.background.approxOrderX=1
      # config.detection.tempLocalBackground.approxOrderX=1
      # config.detection.tempWideBackground.approxOrderX=1
      

      multiVisit:

      * makeWarp
       
      config.warpAndPsfMatch.psfMatch.kernel['AL'].afwBackgroundConfig.approxOrderX=1
       
      * assembleCoadd
       
      config.detect.background.approxOrderX=1
      # config.detect.tempLocalBackground.approxOrderX=1
      # config.detect.tempWideBackground.approxOrderX=1
      config.detectTemplate.background.approxOrderX=1
      # config.detectTemplate.tempLocalBackground.approxOrderX=1
      # config.detectTemplate.tempWideBackground.approxOrderX=1
      # config.scaleWarpVariance.background.approxOrderX=1
       
      * detection
       
      # config.scaleVariance.background.approxOrderX=1
      # config.detection.background.approxOrderX=1
      # config.detection.tempLocalBackground.approxOrderX=1
      # config.detection.tempWideBackground.approxOrderX=1
      

      Additionally, to facilitate efforts led by Morgan Schmitz looking into bright star diagnostics, the following config options were adopted on this ticket too:

      * measure
       
      config.measurement.plugins['base_CircularApertureFlux'].radii=[3, 4.5, 6.0, 8, 9, 12, 13, 17, 18, 23, 25, 28, 33, 35, 38, 43, 48, 50, 53, 58, 63, 68, 70, 73, 78, 83, 88, 93, 98, 103, 108, 113, 118, 123, 128, 133, 138, 143, 148, 153, 158, 163, 168, 173, 178, 183, 188, 193, 198, 203, 208, 213, 218, 223, 228, 233, 238, 243, 248]
      config.measurement.doReplaceWithNoise=False
      

      Note that the above measurement config options should not impact the primary conclusions of this ticket.

      Results for these tests are explored in the comments below. Postage stamp outputs at the visit level and coadd level are shown, and plots generated showing the differences in output photometry relative to the current defaults.

      In summary, the final conclusion of this ticket is that the Chebyshev polynomial order should be reduced from its current default of 6 to the lower value of 1. Not only does this resolve the well-known sky oversubtraction issue around bright sources (the 'divot' problem), but is also physically motivated due to the simple nature of DC2 backgrounds established during DC2 image construction. A further reduction to order 0 produces undesirable effects at the coadd-level, namely, a visible imprint of the visit level detectors remain visible. It appears that not allowing the background fit to fit at least a sky gradient leads to these CCD edge effects remaining visible. Conversely, an increased background fitting order of 2 leads to residual remnant sky oversubtraction (divots) surrounding bright sources still existing in the imaging. Therefore, a reduced order of 1 appears to be the happy-medium with which to balance out all negative effects.

        Attachments

        1. objectTable_chebyshev0.png
          objectTable_chebyshev0.png
          188 kB
        2. objectTable_chebyshev1.png
          objectTable_chebyshev1.png
          196 kB
        3. objectTable_chebyshev2.png
          objectTable_chebyshev2.png
          193 kB
        4. objectTable.png
          objectTable.png
          76 kB
        5. pipeline_multiVisit.png
          pipeline_multiVisit.png
          362 kB
        6. pipeline_singleFrame.png
          pipeline_singleFrame.png
          234 kB
        7. sourceTable_visit_chebyshev0.png
          sourceTable_visit_chebyshev0.png
          523 kB
        8. sourceTable_visit_chebyshev1.png
          sourceTable_visit_chebyshev1.png
          515 kB
        9. sourceTable_visit_chebyshev2.png
          sourceTable_visit_chebyshev2.png
          516 kB
        10. sourceTable_visit.png
          sourceTable_visit.png
          72 kB
        11. t3263p21r.png
          t3263p21r.png
          771 kB
        12. t3828p24g.png
          t3828p24g.png
          786 kB
        13. t3828p24i.png
          t3828p24i.png
          797 kB
        14. t3828p24r.png
          t3828p24r.png
          799 kB
        15. t3828p24y.png
          t3828p24y.png
          805 kB
        16. t3828p24z.png
          t3828p24z.png
          803 kB
        17. v12466d22.png
          v12466d22.png
          1.08 MB
        18. v159471d4.png
          v159471d4.png
          1.07 MB
        19. v159491d7.png
          v159491d7.png
          1.08 MB
        20. v162699d21.png
          v162699d21.png
          1.07 MB
        21. v174534d2.png
          v174534d2.png
          1.09 MB
        22. v183772d14.png
          v183772d14.png
          1.07 MB
        23. v185822d29.png
          v185822d29.png
          1.08 MB
        24. v192355d16.png
          v192355d16.png
          1.09 MB
        25. v193147d30.png
          v193147d30.png
          1.07 MB
        26. v193189d9.png
          v193189d9.png
          1.08 MB
        27. v204706d25.png
          v204706d25.png
          1.07 MB
        28. v37657d20.png
          v37657d20.png
          1.09 MB
        29. v40318d26.png
          v40318d26.png
          1.07 MB
        30. v40351d13.png
          v40351d13.png
          1.08 MB
        31. v5884d28.png
          v5884d28.png
          1.08 MB
        32. v7997d6.png
          v7997d6.png
          1.10 MB
        33. v7998d12.png
          v7998d12.png
          1.08 MB
        34. v8003d10.png
          v8003d10.png
          1.08 MB

          Issue Links

            Activity

            Hide
            lskelvin Lee Kelvin added a comment - - edited

            Finally, I attach here source and object table histograms for all detected objects and all Chebyshev orders tested on this ticket.

            No significant deviation is noted between each Chebyshev run as a function of magnitude, down to extremely faint magnitudes, indicating a good level of agreement at both the visit-level and the coadd-level.

            Show
            lskelvin Lee Kelvin added a comment - - edited Finally, I attach here source and object table histograms for all detected objects and all Chebyshev orders tested on this ticket. No significant deviation is noted between each Chebyshev run as a function of magnitude, down to extremely faint magnitudes, indicating a good level of agreement at both the visit-level and the coadd-level.
            Hide
            lskelvin Lee Kelvin added a comment - - edited

            Following the above testing, it seems that order=1 is the happy medium between improving the sky-oversubtraction (divot) effect surrounding bright sources without having to resort to skyCorrectionTask, however, high enough such that detector edges are not visible in the resultant coadds.

            All data outputs for the above tests can be found in the following collections in /repo/dc2:

            Note: the final collection listed above is a subsequent re-run, using the ticket branch set up in the PR. Testing shows that the outputs are identical to the original order1 run.

            A PR has been set up for this ticket to modify the config options in obs_lsst.

            Show
            lskelvin Lee Kelvin added a comment - - edited Following the above testing, it seems that order=1 is the happy medium between improving the sky-oversubtraction (divot) effect surrounding bright sources without having to resort to skyCorrectionTask , however, high enough such that detector edges are not visible in the resultant coadds. All data outputs for the above tests can be found in the following collections in /repo/dc2 : u/lskelvin/ DM-30820 /default u/lskelvin/ DM-30820 /order0 u/lskelvin/ DM-30820 /order1 u/lskelvin/ DM-30820 /order2 u/lskelvin/ DM-30820 /configCheckOrder1 Note: the final collection listed above is a subsequent re-run, using the ticket branch set up in the PR. Testing shows that the outputs are identical to the original order1 run. A PR has been set up for this ticket to modify the config options in obs_lsst .
            Show
            lskelvin Lee Kelvin added a comment - Jenkins run for this ticket: https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/34660/pipeline
            Hide
            boutigny Dominique Boutigny added a comment -

            Hi Lee Kelvin nice investigation work ! I think that the result is pretty convincing and I recommend to go ahead with this modification.

            Show
            boutigny Dominique Boutigny added a comment - Hi Lee Kelvin  nice investigation work ! I think that the result is pretty convincing and I recommend to go ahead with this modification.
            Hide
            lskelvin Lee Kelvin added a comment -

            Great, thanks Dominique! Branch merged to master and removed. Thanks again!

            Show
            lskelvin Lee Kelvin added a comment - Great, thanks Dominique! Branch merged to master and removed. Thanks again!

              People

              Assignee:
              lskelvin Lee Kelvin
              Reporter:
              lskelvin Lee Kelvin
              Reviewers:
              Dominique Boutigny
              Watchers:
              Dominique Boutigny, James Chiang, Lee Kelvin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.