diff --git a/python/lsst/meas/algorithms/pcaPsfDeterminer.py b/python/lsst/meas/algorithms/pcaPsfDeterminer.py index f90c33319..6c957b5aa 100644 --- a/python/lsst/meas/algorithms/pcaPsfDeterminer.py +++ b/python/lsst/meas/algorithms/pcaPsfDeterminer.py @@ -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 diff --git a/tests/test_psfDetermination.py b/tests/test_psfDetermination.py index b02c7aa4b..4c5cb3383 100755 --- a/tests/test_psfDetermination.py +++ b/tests/test_psfDetermination.py @@ -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):