Skip to content

Commit 69452cb

Browse files
Jakob T McCannjtmccann
Jakob T McCann
authored andcommittedDec 20, 2023
Exclude injected sources during astrometric fitting
1 parent d151e6f commit 69452cb

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed
 

‎python/lsst/pipe/tasks/calibrate.py

+3
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ def setDefaults(self):
310310
self.astromRefObjLoader.anyFilterMapsToThis = "phot_g_mean"
311311
# The photoRefCat connection is the name to use for the colorterms.
312312
self.photoCal.photoCatName = self.connections.photoRefCat
313+
# Set injected pixel flags.
314+
self.calibrate.measurement.plugins["base_PixelFlags"].masksFpAnywhere.append("INJECTED")
315+
self.calibrate.measurement.plugins["base_PixelFlags"].masksFpCenter.append("INJECTED_CORE")
313316

314317
# Keep track of which footprints contain streaks
315318
self.measurement.plugins['base_PixelFlags'].masksFpAnywhere = ['STREAK']

‎python/lsst/pipe/tasks/calibrateImage.py

+6
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ def setDefaults(self):
274274
"base_GaussianFlux",
275275
"base_PsfFlux",
276276
]
277+
# Set injected pixel flags.
278+
self.psf_source_measurement.plugins["base_PixelFlags"].masksFpAnywhere.append("INJECTED")
279+
self.psf_source_measurement.plugins["base_PixelFlags"].masksFpCenter.append("INJECTED_CORE")
277280
self.psf_source_measurement.slots.shape = "ext_shapeHSM_HsmSourceMoments"
278281
# Only measure apertures we need for PSF measurement.
279282
# TODO DM-40064: psfex has a hard-coded value of 9 in a psfex-config
@@ -302,6 +305,9 @@ def setDefaults(self):
302305
"base_PsfFlux",
303306
"base_CircularApertureFlux",
304307
]
308+
# Set injected pixel flags.
309+
self.star_measurement.plugins["base_PixelFlags"].masksFpAnywhere.append("INJECTED")
310+
self.star_measurement.plugins["base_PixelFlags"].masksFpCenter.append("INJECTED_CORE")
305311
self.star_measurement.slots.psfShape = "ext_shapeHSM_HsmPsfMoments"
306312
self.star_measurement.slots.shape = "ext_shapeHSM_HsmSourceMoments"
307313
# Only measure the apertures we need for star selection.

‎python/lsst/pipe/tasks/multiBand.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,12 @@ def setDefaults(self):
447447
'base_Variance',
448448
'base_LocalPhotoCalib',
449449
'base_LocalWcs']
450-
self.measurement.plugins['base_PixelFlags'].masksFpAnywhere = ['CLIPPED', 'SENSOR_EDGE',
451-
'INEXACT_PSF', 'STREAK']
452-
self.measurement.plugins['base_PixelFlags'].masksFpCenter = ['CLIPPED', 'SENSOR_EDGE',
453-
'INEXACT_PSF', 'STREAK']
450+
self.measurement.plugins['base_PixelFlags'].masksFpAnywhere = [
451+
'CLIPPED', 'SENSOR_EDGE', 'INEXACT_PSF', 'STREAK', 'INJECTED'
452+
]
453+
self.measurement.plugins['base_PixelFlags'].masksFpCenter = [
454+
'CLIPPED', 'SENSOR_EDGE', 'INEXACT_PSF', 'STREAK', 'INJECTED_CORE'
455+
]
454456

455457

456458
class MeasureMergedCoaddSourcesTask(PipelineTask):

0 commit comments

Comments
 (0)