Skip to content

Commit

Permalink
Add downsampling and test for PcaPsfDeterminer.
Browse files Browse the repository at this point in the history
  • Loading branch information
erykoff committed Apr 13, 2024
1 parent 0a783de commit e546d60
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/lsst/meas/algorithms/pcaPsfDeterminer.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ def determinePsf(self, exposure, psfCandidateList, metadata=None, flagKey=None):
psfCellSet : `lsst.afw.math.SpatialCellSet`
The PSF candidates.
"""
psfCandidateList = self.downsampleCandidates(psfCandidateList)

import lsstDebug
display = lsstDebug.Info(__name__).display
displayExposure = lsstDebug.Info(__name__).displayExposure # display the Exposure + spatialCells
Expand Down
11 changes: 11 additions & 0 deletions tests/test_psfDetermination.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,17 @@ def testDownsamplePca(self):
"""Test PCA determiner with downsampling.
"""
self.setupDeterminer()
metadata = dafBase.PropertyList()

# Decrease the maximum number of stars.
self.psfDeterminer.config.maxCandidates = 10

stars = self.starSelector.run(self.catalog, exposure=self.exposure)
psfCandidateList = self.makePsfCandidates.run(stars.sourceCat, self.exposure).psfCandidates
psf, cellSet = self.psfDeterminer.determinePsf(self.exposure, psfCandidateList, metadata)

self.assertEqual(metadata['numAvailStars'], self.psfDeterminer.config.maxCandidates)
self.assertLessEqual(metadata['numGoodStars'], self.psfDeterminer.config.maxCandidates)


class PsfCandidateTestCase(lsst.utils.tests.TestCase):
Expand Down

0 comments on commit e546d60

Please sign in to comment.