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

Number of matches is smaller than request

    Details

      Description

      Some CCDs in the HSC-RC2 reprocessing show this warning:

      processCcd.calibrate.astrometry.matcher WARN: Number of matches is smaller than request
      

      This probably should be an error on the matcher, but it seems to be passed to the fitter and then report as a successful fit.

      A few data IDs of interest are visit=1872 ccd=11 visit=1868 ccd=13 visit=22648 ccd=4.

      The first CCD

      processCcd.calibrate.astromRefObjLoader INFO: Loaded 1580 reference objects
      processCcd.calibrate.astrometry.matcher INFO: Purged 661 sources, leaving 113 good sources
      processCcd.calibrate.astrometry.matcher INFO: Matched 25 sources
      processCcd.calibrate.astrometry.matcher WARN: Number of matches is smaller than request
      processCcd.calibrate.astrometry.matcher INFO: Purged 661 sources, leaving 113 good sources
      processCcd.calibrate.astrometry.matcher INFO: Matched 1 sources
      processCcd.calibrate.astrometry.matcher WARN: Number of matches is smaller than request
      processCcd.calibrate.astrometry INFO: Fit WCS iter 2 failed; using previous iteration: 
        File "src/sip/CreateWcsWithSip.cc", line 131, in lsst::meas::astrom::sip::CreateWcsWithSip<MatchT>::CreateWcsWithSip(const std::vector<T>&, const lsst::afw::geom::SkyWcs&, int, const lsst::geom::Box2I&, int) [with MatchT = lsst::afw::table::Match<lsst::afw::table::SimpleRecord, lsst::afw::table::SourceRecord>]
          Number of matches less than requested sip order {0}
      lsst::pex::exceptions::LengthError: 'Number of matches less than requested sip order'
       
      processCcd.calibrate.astrometry INFO: Matched and fit WCS in 1 iterations; found 25 matches with scatter = 0.028 +- 0.019 arcsec
      

      The second

      processCcd.calibrate.astromRefObjLoader INFO: Loaded 1840 reference objects
      processCcd.calibrate.astrometry.matcher INFO: Purged 595 sources, leaving 133 good sources
      processCcd.calibrate.astrometry.matcher INFO: Matched 27 sources
      processCcd.calibrate.astrometry.matcher WARN: Number of matches is smaller than request
      processCcd.calibrate.astrometry.matcher INFO: Purged 595 sources, leaving 133 good sources
      processCcd.calibrate.astrometry.matcher INFO: Matched 4 sources
      processCcd.calibrate.astrometry.matcher WARN: Number of matches is smaller than request
      processCcd.calibrate.astrometry INFO: Fit WCS iter 2 failed; using previous iteration: All matches rejected in iteration 1
      processCcd.calibrate.astrometry INFO: Matched and fit WCS in 1 iterations; found 27 matches with scatter = 0.092 +- 0.049 arcsec
      

      And the third

      processCcd.calibrate.astromRefObjLoader INFO: Loaded 1441 reference objects
      processCcd.calibrate.astrometry.matcher INFO: Purged 1109 sources, leaving 99 good sources
      processCcd.calibrate.astrometry.matcher INFO: Matched 47 sources
      processCcd.calibrate.astrometry.matcher INFO: Purged 1109 sources, leaving 99 good sources
      processCcd.calibrate.astrometry.matcher INFO: Matched 49 sources
      processCcd.calibrate.astrometry.matcher INFO: Purged 1109 sources, leaving 99 good sources
      processCcd.calibrate.astrometry.matcher INFO: Matched 27 sources
      processCcd.calibrate.astrometry.matcher WARN: Number of matches is smaller than request
      processCcd.calibrate.astrometry INFO: Matched and fit WCS in 3 iterations; found 27 matches with scatter = 0.029 +- 0.020 arcsec
      

      The logs are from using the w_2019_10 stack. But the LengthError has appeared since w_2019_07, and the Number of matches is smaller than request warnings have been around for longer.

        Attachments

          Issue Links

            Activity

            Hide
            cmorrison Chris Morrison added a comment -

            I was able to address the issue simply by softening one of the config parameters. Specifically, I changed the number of reference objects at which the matcher always uses pessemistic mode from 2k to 1k. This causes the three above warnings be completely successful.

            I'm running the change though the validate_drp. I've confirmed that the values for cfht and decam and uneffected but need a bit of time to run over the HSC data.

            Show
            cmorrison Chris Morrison added a comment - I was able to address the issue simply by softening one of the config parameters. Specifically, I changed the number of reference objects at which the matcher always uses pessemistic mode from 2k to 1k. This causes the three above warnings be completely successful. I'm running the change though the validate_drp. I've confirmed that the values for cfht and decam and uneffected but need a bit of time to run over the HSC data.
            Hide
            cmorrison Chris Morrison added a comment -

            Found a slight bug in a test the minimum match distance that could cause it to throw more failure messages. All of the validate_drp runs have pass and given the same numbers. I'm just waiting on a complete run through of the visits mentioned in the ticket (not just the failed ccds). I'm starting a Jenkins run with ci_hsc in the mean time: https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/29542/pipeline

            Show
            cmorrison Chris Morrison added a comment - Found a slight bug in a test the minimum match distance that could cause it to throw more failure messages. All of the validate_drp runs have pass and given the same numbers. I'm just waiting on a complete run through of the visits mentioned in the ticket (not just the failed ccds). I'm starting a Jenkins run with ci_hsc in the mean time:  https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/29542/pipeline
            Hide
            cmorrison Chris Morrison added a comment -

            Per the suggestions of Colin Slater, I reorder part of the pessimisticB algorithm (namely how the final maxMatchDistance is calculated) so that the previous failure messages are not longer observed. This reordering produces a quality WCS for once of the other two remain. Combining this with the a change in the number of references need to force consensus mode results in all of the CCDs matching properly. Below I show the results from just reordering the algorithm to show that the "failed" errors messages are now gone.

            visit=1872 ccd=11
            processCcd.calibrate.astromRefObjLoader INFO: Loaded 1580 reference objects
            processCcd.calibrate.astrometry.matcher INFO: Purged 661 sources, leaving 113 good sources
            processCcd.calibrate.astrometry.matcher INFO: Matched 43 sources
            processCcd.calibrate.astrometry.matcher INFO: Purged 661 sources, leaving 113 good sources
            processCcd.calibrate.astrometry.matcher INFO: Matched 66 sources
            processCcd.calibrate.astrometry.matcher INFO: Purged 661 sources, leaving 113 good sources
            processCcd.calibrate.astrometry.matcher INFO: Matched 57 sources
            processCcd.calibrate.astrometry INFO: Matched and fit WCS in 3 iterations; found 57 matches with scatter = 0.081 +- 0.043 arcsec
             
            visit=1868 ccd=13
            processCcd.calibrate.astromRefObjLoader INFO: Loaded 1840 reference objects
            processCcd.calibrate.astrometry.matcher INFO: Purged 595 sources, leaving 133 good sources
            processCcd.calibrate.astrometry.matcher INFO: Matched 55 sources
            processCcd.calibrate.astrometry.matcher INFO: Purged 595 sources, leaving 133 good sources
            processCcd.calibrate.astrometry.matcher INFO: Matched 57 sources
            processCcd.calibrate.astrometry.matcher INFO: Purged 595 sources, leaving 133 good sources
            processCcd.calibrate.astrometry.matcher INFO: Matched 88 sources
            processCcd.calibrate.astrometry INFO: Matched and fit WCS in 3 iterations; found 88 matches with scatter = 0.029 +- 0.017 arcsec
             
            visit=22648 ccd=4
            processCcd.calibrate.astromRefObjLoader INFO: Loaded 1441 reference objects
            processCcd.calibrate.astrometry.matcher INFO: Purged 1109 sources, leaving 99 good sources
            processCcd.calibrate.astrometry.matcher INFO: Matched 47 sources
            processCcd.calibrate.astrometry.matcher INFO: Purged 1109 sources, leaving 99 good sources
            processCcd.calibrate.astrometry.matcher INFO: Matched 49 sources
            processCcd.calibrate.astrometry.matcher INFO: Purged 1109 sources, leaving 99 good sources
            processCcd.calibrate.astrometry.matcher INFO: Matched 65 sources
            processCcd.calibrate.astrometry INFO: Matched and fit WCS in 3 iterations; found 65 matches with scatter = 0.258 +- 0.146 arcsec
            

            Show
            cmorrison Chris Morrison added a comment - Per the suggestions of Colin Slater , I reorder part of the pessimisticB algorithm (namely how the final maxMatchDistance is calculated) so that the previous failure messages are not longer observed. This reordering produces a quality WCS for once of the other two remain. Combining this with the a change in the number of references need to force consensus mode results in all of the CCDs matching properly. Below I show the results from just reordering the algorithm to show that the "failed" errors messages are now gone. visit= 1872 ccd= 11 processCcd.calibrate.astromRefObjLoader INFO: Loaded 1580 reference objects processCcd.calibrate.astrometry.matcher INFO: Purged 661 sources, leaving 113 good sources processCcd.calibrate.astrometry.matcher INFO: Matched 43 sources processCcd.calibrate.astrometry.matcher INFO: Purged 661 sources, leaving 113 good sources processCcd.calibrate.astrometry.matcher INFO: Matched 66 sources processCcd.calibrate.astrometry.matcher INFO: Purged 661 sources, leaving 113 good sources processCcd.calibrate.astrometry.matcher INFO: Matched 57 sources processCcd.calibrate.astrometry INFO: Matched and fit WCS in 3 iterations; found 57 matches with scatter = 0.081 +- 0.043 arcsec   visit= 1868 ccd= 13 processCcd.calibrate.astromRefObjLoader INFO: Loaded 1840 reference objects processCcd.calibrate.astrometry.matcher INFO: Purged 595 sources, leaving 133 good sources processCcd.calibrate.astrometry.matcher INFO: Matched 55 sources processCcd.calibrate.astrometry.matcher INFO: Purged 595 sources, leaving 133 good sources processCcd.calibrate.astrometry.matcher INFO: Matched 57 sources processCcd.calibrate.astrometry.matcher INFO: Purged 595 sources, leaving 133 good sources processCcd.calibrate.astrometry.matcher INFO: Matched 88 sources processCcd.calibrate.astrometry INFO: Matched and fit WCS in 3 iterations; found 88 matches with scatter = 0.029 +- 0.017 arcsec   visit= 22648 ccd= 4 processCcd.calibrate.astromRefObjLoader INFO: Loaded 1441 reference objects processCcd.calibrate.astrometry.matcher INFO: Purged 1109 sources, leaving 99 good sources processCcd.calibrate.astrometry.matcher INFO: Matched 47 sources processCcd.calibrate.astrometry.matcher INFO: Purged 1109 sources, leaving 99 good sources processCcd.calibrate.astrometry.matcher INFO: Matched 49 sources processCcd.calibrate.astrometry.matcher INFO: Purged 1109 sources, leaving 99 good sources processCcd.calibrate.astrometry.matcher INFO: Matched 65 sources processCcd.calibrate.astrometry INFO: Matched and fit WCS in 3 iterations; found 65 matches with scatter = 0.258 +- 0.146 arcsec
            Hide
            cmorrison Chris Morrison added a comment -

            I've tested the code against all 3 sets of validation data (HSC, CFHT, DECAM) and run on the full visits mentioned in the tickets. No hard (e.g. no matches found) or soft (the failures form this ticket or suspicions solution scatter) failures were found. The validate_drp numbers have slightly improved in the case of HSC-Y (the remainder are unchanged).

            Jenkins run with ci_hsc: https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/29555/pipeline

            Show
            cmorrison Chris Morrison added a comment - I've tested the code against all 3 sets of validation data (HSC, CFHT, DECAM) and run on the full visits mentioned in the tickets. No hard (e.g. no matches found) or soft (the failures form this ticket or suspicions solution scatter) failures were found. The validate_drp numbers have slightly improved in the case of HSC-Y (the remainder are unchanged). Jenkins run with ci_hsc:  https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/29555/pipeline
            Hide
            ctslater Colin Slater added a comment -

            Comments on the PR; I'd like to have a second look after considering those.

            Show
            ctslater Colin Slater added a comment - Comments on the PR; I'd like to have a second look after considering those.
            Hide
            cmorrison Chris Morrison added a comment -

            Colin Slaterhttps://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/29613/pipeline check the new version on the pull request. I'll squash the commits once you approve. Jenkins for this version:

            Show
            cmorrison Chris Morrison added a comment - Colin Slater https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/29613/pipeline check the new version on the pull request. I'll squash the commits once you approve. Jenkins for this version:
            Hide
            ctslater Colin Slater added a comment -

            Final verify looks much better as its own function. Few minor comments on the PR. I would still like the repeated sigma clipping code extracted into a function.

            Show
            ctslater Colin Slater added a comment - Final verify looks much better as its own function. Few minor comments on the PR. I would still like the repeated sigma clipping code extracted into a function.
            Show
            cmorrison Chris Morrison added a comment - Final Jenkins after update:  https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/29619/pipeline/

              People

              • Assignee:
                cmorrison Chris Morrison
                Reporter:
                hchiang2 Hsin-Fang Chiang
                Reviewers:
                Colin Slater
                Watchers:
                Chris Morrison, Colin Slater, Hsin-Fang Chiang
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: