From b01659ea65a363d569a6db206f881c8f8da8ac3e Mon Sep 17 00:00:00 2001 From: John Parejko Date: Tue, 10 Oct 2023 20:22:35 -0700 Subject: [PATCH] Add final repair/measure to CalibrateImage We need to run repair with keepCRs=False (the default) and re-measure in order to not have CRs included in the final output. --- python/lsst/pipe/tasks/calibrateImage.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/lsst/pipe/tasks/calibrateImage.py b/python/lsst/pipe/tasks/calibrateImage.py index 8a2f0f55dd..98ff576217 100644 --- a/python/lsst/pipe/tasks/calibrateImage.py +++ b/python/lsst/pipe/tasks/calibrateImage.py @@ -494,6 +494,11 @@ def _compute_psf(self, exposure, guess_psf=True): self.psf_source_measurement.run(detections.sources, exposure) psf_result = self.psf_measure_psf.run(exposure=exposure, sources=detections.sources) + # Final repair with final PSF, removing cosmic rays this time. + self.psf_repair.run(exposure=exposure) + # Final measurement with the CRs removed. + self.psf_source_measurement.run(detections.sources, exposure) + # PSF is set on exposure; only return candidates for optional saving. return detections.sources, background, psf_result.cellSet