From 44abe960c27d645626f6e1dfdc6ba50d4b49fc43 Mon Sep 17 00:00:00 2001 From: Jim Bosch Date: Mon, 16 Dec 2024 13:57:20 -0500 Subject: [PATCH] Prohibit LocalWcs and LocalPhotoCalib in CalibrateImageTask. --- python/lsst/pipe/tasks/calibrateImage.py | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/python/lsst/pipe/tasks/calibrateImage.py b/python/lsst/pipe/tasks/calibrateImage.py index 1fad9a131..d19fc03fc 100644 --- a/python/lsst/pipe/tasks/calibrateImage.py +++ b/python/lsst/pipe/tasks/calibrateImage.py @@ -432,6 +432,36 @@ def validate(self): CalibrateImageConfig.star_normalized_calibration_flux, self, msg, ) + # Ensure base_LocalPhotoCalib and base_LocalWcs plugins are not run, + # because they'd be running too early to pick up the fitted PhotoCalib + # and WCS. + if "base_LocalWcs" in self.psf_source_measurement.plugins.names: + raise pexConfig.FieldValidationError( + CalibrateImageConfig.psf_source_measurement, + self, + "base_LocalWcs cannot run CalibrateImageTask, as it would be run before the astrometry fit." + ) + if "base_LocalWcs" in self.star_measurement.plugins.names: + raise pexConfig.FieldValidationError( + CalibrateImageConfig.star_measurement, + self, + "base_LocalWcs cannot run CalibrateImageTask, as it would be run before the astrometry fit." + ) + if "base_LocalPhotoCalib" in self.psf_source_measurement.plugins.names: + raise pexConfig.FieldValidationError( + CalibrateImageConfig.psf_source_measurement, + self, + "base_LocalPhotoCalib cannot run CalibrateImageTask, " + "as it would be run before the photometry fit." + ) + if "base_LocalPhotoCalib" in self.star_measurement.plugins.names: + raise pexConfig.FieldValidationError( + CalibrateImageConfig.star_measurement, + self, + "base_LocalPhotoCalib cannot run CalibrateImageTask, " + "as it would be run before the photometry fit." + ) + class CalibrateImageTask(pipeBase.PipelineTask): """Compute the PSF, aperture corrections, astrometric and photometric