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

Enable PSF padding by default in computeApertureFlux

    XMLWordPrintable

Details

    • 4
    • Data Release Production
    • No

    Description

      At present, computeApertureFlux will return NaN if the PSF model is not large enough to encompass the requested radius value. For example, the tract 9813 patch 4 (r-band) PSF has a shape of (23, 25), which causes the computed PSF aperture flux to return NaN when using the standard calibFluxRadius value of 12.0 pixels.

      This ticket aims to update ImagePsf.cc to make it default to first pad the PSF model with zeroes prior to aperture flux computation.

      Attachments

        Issue Links

          Activity

            lskelvin Lee Kelvin added a comment -

            This ticket contains two commits. The first commit adds a new checkApertureFlux test into test_imagePsf.cc, whilst the second commit adds the necessary C++ code to support PSF padding prior to computation of aperture flux with radii which extend beyond the bounding box of the PSF.

            To test this ticket (in lieu of a writable /repo/main at the USDF), I first checked out commit #1 and ran scons to run all tests in meas_algorithms. This test fails, as expected:

            =========================== short test summary info ============================
            FAILED tests/test_executables.py::UtilsBinaryTester::test_exe__sdf_data_rubin_u_lskelvin_repos_meas_algorithms_tests_tes
            t_imagePsf
            ====== 1 failed, 303 passed, 7 skipped, 115 warnings in 61.22s (0:01:01) =======
            Global pytest run: failed with 1
            Failed test output:
            tests/test_imagePsf
             
            Running 2 test cases...
            tests/test_imagePsf.cc(108): error: in "PsfApertureFlux": difference{nan} between flux{nan} and check{0.9999999847700202
            8} exceeds 0.01%
             
            *** 1 failure is detected in the test module "ImagePsf"
            Global pytest output is in /sdf/data/rubin/u/lskelvin/repos/meas_algorithms/tests/.tests/pytest-meas_algorithms.xml.fail
            ed
            The following tests failed:
            /sdf/data/rubin/u/lskelvin/repos/meas_algorithms/tests/.tests/test_imagePsf.failed
            /sdf/data/rubin/u/lskelvin/repos/meas_algorithms/tests/.tests/pytest-meas_algorithms.xml.failed
            2 tests failed
            scons: *** [checkTestStatus] Error 1
            scons: building terminated because of errors.
            

            I then checked out commit #2 (this ticket) and re-ran scons. This time, scons passes successfully:

            ============================= slowest 5 durations ==============================
            33.29s setup    tests/test_referenceObjectLoader.py::ReferenceObjectLoaderTestCase::test_requireProperMotion
            33.13s setup    tests/test_referenceObjectLoader.py::ReferenceObjectLoaderTestCase::test_filterMap
            32.95s setup    tests/test_referenceObjectLoader.py::ReferenceObjectLoaderTestCase::test_loadSkyCircle
            20.22s call     tests/test_psfSelectTest.py::PsfSelectionTestCase::testDistortedImage
            10.58s call     tests/test_psfSelectTest.py::PsfSelectionTestCase::testPsfCandidate
            ================ 304 passed, 7 skipped, 115 warnings in 57.31s =================
            Global pytest run completed successfully
            scons: done building targets.
            

            Jenkins run for this ticket: https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/37242/pipeline

            lskelvin Lee Kelvin added a comment - This ticket contains two commits. The first commit adds a new checkApertureFlux test into test_imagePsf.cc, whilst the second commit adds the necessary C++ code to support PSF padding prior to computation of aperture flux with radii which extend beyond the bounding box of the PSF. To test this ticket (in lieu of a writable /repo/main at the USDF), I first checked out commit #1 and ran scons to run all tests in meas_algorithms. This test fails, as expected: =========================== short test summary info ============================ FAILED tests/test_executables.py::UtilsBinaryTester::test_exe__sdf_data_rubin_u_lskelvin_repos_meas_algorithms_tests_tes t_imagePsf ====== 1 failed, 303 passed, 7 skipped, 115 warnings in 61.22s (0:01:01) ======= Global pytest run: failed with 1 Failed test output: tests/test_imagePsf   Running 2 test cases... tests/test_imagePsf.cc(108): error: in "PsfApertureFlux": difference{nan} between flux{nan} and check{0.9999999847700202 8} exceeds 0.01%   *** 1 failure is detected in the test module "ImagePsf" Global pytest output is in /sdf/data/rubin/u/lskelvin/repos/meas_algorithms/tests/.tests/pytest-meas_algorithms.xml.fail ed The following tests failed: /sdf/data/rubin/u/lskelvin/repos/meas_algorithms/tests/.tests/test_imagePsf.failed /sdf/data/rubin/u/lskelvin/repos/meas_algorithms/tests/.tests/pytest-meas_algorithms.xml.failed 2 tests failed scons: *** [checkTestStatus] Error 1 scons: building terminated because of errors. I then checked out commit #2 (this ticket) and re-ran scons. This time, scons passes successfully: ============================= slowest 5 durations ============================== 33.29s setup tests/test_referenceObjectLoader.py::ReferenceObjectLoaderTestCase::test_requireProperMotion 33.13s setup tests/test_referenceObjectLoader.py::ReferenceObjectLoaderTestCase::test_filterMap 32.95s setup tests/test_referenceObjectLoader.py::ReferenceObjectLoaderTestCase::test_loadSkyCircle 20.22s call tests/test_psfSelectTest.py::PsfSelectionTestCase::testDistortedImage 10.58s call tests/test_psfSelectTest.py::PsfSelectionTestCase::testPsfCandidate ================ 304 passed, 7 skipped, 115 warnings in 57.31s ================= Global pytest run completed successfully scons: done building targets. Jenkins run for this ticket: https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/37242/pipeline

            Looks good

            fred3m Fred Moolekamp added a comment - Looks good
            lskelvin Lee Kelvin added a comment -

            Thanks Fred, much appreciated. Branch merged and deleted!

            lskelvin Lee Kelvin added a comment - Thanks Fred, much appreciated. Branch merged and deleted!

            People

              lskelvin Lee Kelvin
              lskelvin Lee Kelvin
              Fred Moolekamp
              Eli Rykoff, Fred Moolekamp, Lee Kelvin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Jenkins

                  No builds found.