Skip to content

Commit

Permalink
Save work
Browse files Browse the repository at this point in the history
  • Loading branch information
abudlong committed Dec 17, 2024
1 parent ab99de5 commit e0a22b8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions python/lsst/pipe/tasks/calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ def setDefaults(self):
self.astromRefObjLoader.anyFilterMapsToThis = "phot_g_mean"
# The photoRefCat connection is the name to use for the colorterms.
self.photoCal.photoCatName = self.connections.photoRefCat
# self.photoCal.match.sourceSelection.signalToNoise.fluxField = "slot_CalibFlux_instFlux"
# self.photoCal.match.sourceSelection.signalToNoise.errField = "slot_CalibFlux_instFluxErr"

self.normalizedCalibrationFlux.do_measure_ap_corr = False
self.measurement.algorithms["base_CompensatedTophatFlux"].apertures = [12]
Expand Down
3 changes: 3 additions & 0 deletions python/lsst/pipe/tasks/calibrateImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ def setDefaults(self):
# Keep sky sources in the output catalog, even though they aren't
# wanted for calibration.
self.star_selector["science"].doSkySources = True
# Set the flux and error fields
self.star_selector["science"].signalToNoise.fluxField = "slot_CalibFlux_instFlux"
self.star_selector["science"].signalToNoise.errField = "slot_CalibFlux_instFluxErr"

# Use the affine WCS fitter (assumes we have a good camera geometry).
self.astrometry.wcsFitter.retarget(lsst.meas.astrom.FitAffineWcsTask)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_calibrateImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def _check_run(self, calibrate, result, expect_calibrated_pixels: bool = True):
self.assertEqual(result.stars["slot_PsfFlux_mag"].unit, u.ABmag)

# Should have detected all S/N >= 10 sources plus 2 sky sources, whether 1 or 2 snaps.
self.assertEqual(len(result.stars), 7)
self.assertEqual(len(result.stars), 6)
# Did the psf flags get propagated from the psf_stars catalog?
self.assertEqual(result.stars["calib_psf_used"].sum(), 3)

Expand Down Expand Up @@ -319,7 +319,7 @@ def test_find_stars(self):

# Only 5 psf-like sources with S/N>10 should be in the output catalog,
# plus two sky sources.
self.assertEqual(len(stars), 7)
self.assertEqual(len(stars), 6)
self.assertTrue(stars.isContiguous())
# Sort in order of brightness, to easily compare with expected positions.
stars.sort(stars.getPsfFluxSlot().getMeasKey())
Expand Down Expand Up @@ -420,8 +420,8 @@ def test_match_psf_stars(self):
# sort() above leaves the catalog non-contiguous.
stars = stars.copy(deep=True)
np.testing.assert_array_equal(stars["calib_psf_candidate"],
[False, False, False, False, True, True, True])
np.testing.assert_array_equal(stars["calib_psf_used"], [False, False, False, False, True, True, True])
[False, False, False, True, True, True])
np.testing.assert_array_equal(stars["calib_psf_used"], [False, False, False, True, True, True])
# Too few sources to reserve any in these tests.
self.assertEqual(stars["calib_psf_reserved"].sum(), 0)

Expand Down

0 comments on commit e0a22b8

Please sign in to comment.