Skip to content

Commit

Permalink
Merge pull request #422 from lsst/tickets/DM-5304
Browse files Browse the repository at this point in the history
DM-5304: Use psfex as the default PSF determiner
  • Loading branch information
parejkoj committed Nov 3, 2020
2 parents 078e64d + 7797f63 commit 9cdc311
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
3 changes: 2 additions & 1 deletion python/lsst/pipe/tasks/measurePsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import lsst.meas.algorithms.utils as maUtils
import lsst.pex.config as pexConfig
import lsst.pipe.base as pipeBase
import lsst.meas.extensions.psfex.psfexPsfDeterminer # noqa: F401


class MeasurePsfConfig(pexConfig.Config):
Expand All @@ -38,7 +39,7 @@ class MeasurePsfConfig(pexConfig.Config):
)
psfDeterminer = measAlg.psfDeterminerRegistry.makeField(
"PSF Determination algorithm",
default="pca"
default="psfex"
)
reserve = pexConfig.ConfigurableField(
target=measAlg.ReserveSourcesTask,
Expand Down
27 changes: 17 additions & 10 deletions tests/test_processCcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,27 @@ def testProcessCcd(self):
print("psf Ixx = %r, Iyy = %r, Ixy = %r" % (psfIxx, psfIyy, psfIxy))

self.assertEqual(len(icSrc), 28)
self.assertEqual(len(src), 185 + 100) # 185 real sources plus 100 sky sources

self.assertEqual(len(src), 184 + 100) # 184 real sources plus 100 sky sources

# NOTE: These values are purely empirical, and need to be
# updated to reflect major algorithmic changes.
# If this test fails after an algorithmic change due to
# small numeric changes here, check on slack at
# #dm-science-pipelines as to whether the changes are
# reasonable, and then replace the failing values by
# running the test to determine the updated values.
expectedPlaces = 7 # Tolerance for numerical comparisons
for name, var, val in [
("bgMean", bgMean, 191.48635852060525),
("bgStdDev", bgStdDev, 0.2399466881603354),
("numGoodPix", numGoodPix, 1966820),
("imMean", imMean, 1.1237668985230562),
("imStdDev", imStdDev, 85.81296241298496),
("bgMean", bgMean, 191.48623786891795),
("bgStdDev", bgStdDev, 0.23994185672586282),
("numGoodPix", numGoodPix, 1966606),
("imMean", imMean, 1.1242456954648634),
("imStdDev", imStdDev, 85.8129750182329),
("varMean", varMean, 131.24003624152013),
("varStdDev", varStdDev, 55.98012493452948),
("psfIxx", psfIxx, 2.769679536557131),
("psfIyy", psfIyy, 2.2013649766299324),
("psfIxy", psfIxy, 0.14797939531970852)
("psfIxx", psfIxx, 2.843329671276296),
("psfIyy", psfIyy, 2.2249941554078156),
("psfIxy", psfIxy, 0.16073332780683286)
]:
self.assertAlmostEqual(var, val, places=expectedPlaces, msg=name)

Expand Down
1 change: 1 addition & 0 deletions ups/pipe_tasks.table
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ setupRequired(utils)
setupRequired(obs_base)
setupRequired(meas_algorithms)
setupRequired(meas_extensions_scarlet)
setupRequired(meas_extensions_psfex)
setupRequired(kht)
setupOptional(meas_astrom)
setupOptional(meas_deblender)
Expand Down

0 comments on commit 9cdc311

Please sign in to comment.