Skip to content

Commit

Permalink
Merge pull request #1017 from lsst/tickets/DM-48117
Browse files Browse the repository at this point in the history
DM-48117: don't use LocalPhotoCalib and LocalWcs in CalibrateImageTask.
  • Loading branch information
TallJimbo authored Dec 18, 2024
2 parents 599934f + 44abe96 commit fdc7815
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 138 deletions.
30 changes: 30 additions & 0 deletions python/lsst/pipe/tasks/calibrateImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
190 changes: 52 additions & 138 deletions schemas/PreSource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,205 +51,133 @@ funcs:
functor: RADecCovColumn
# One calibrated Calib flux is important:
calibFlux:
functor: LocalNanojansky
functor: Column
args:
- slot_CalibFlux_instFlux
- slot_CalibFlux_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- slot_CalibFlux_flux
calibFluxErr:
functor: LocalNanojanskyErr
functor: Column
args:
- slot_CalibFlux_instFlux
- slot_CalibFlux_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- slot_CalibFlux_fluxErr
# Not in DPDD. Used for QA
ap03Flux:
functor: LocalNanojansky
functor: Column
args:
- base_CircularApertureFlux_3_0_instFlux
- base_CircularApertureFlux_3_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_3_0_flux
ap03FluxErr:
functor: LocalNanojanskyErr
functor: Column
args:
- base_CircularApertureFlux_3_0_instFlux
- base_CircularApertureFlux_3_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_3_0_fluxErr
ap03Flux_flag:
functor: Column
args: base_CircularApertureFlux_3_0_flag
# if we need to add decimal apertures call them e.g. ap04p5Flux
ap06Flux:
functor: LocalNanojansky
functor: Column
args:
- base_CircularApertureFlux_6_0_instFlux
- base_CircularApertureFlux_6_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_6_0_flux
ap06FluxErr:
functor: LocalNanojanskyErr
functor: Column
args:
- base_CircularApertureFlux_6_0_instFlux
- base_CircularApertureFlux_6_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_6_0_fluxErr
ap06Flux_flag:
functor: Column
args: base_CircularApertureFlux_6_0_flag
ap09Flux:
functor: LocalNanojansky
functor: Column
args:
- base_CircularApertureFlux_9_0_instFlux
- base_CircularApertureFlux_9_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_9_0_flux
ap09FluxErr:
functor: LocalNanojanskyErr
functor: Column
args:
- base_CircularApertureFlux_9_0_instFlux
- base_CircularApertureFlux_9_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_9_0_fluxErr
ap09Flux_flag:
functor: Column
args: base_CircularApertureFlux_9_0_flag
ap12Flux:
functor: LocalNanojansky
functor: Column
args:
- base_CircularApertureFlux_12_0_instFlux
- base_CircularApertureFlux_12_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_12_0_flux
ap12FluxErr:
functor: LocalNanojanskyErr
functor: Column
args:
- base_CircularApertureFlux_12_0_instFlux
- base_CircularApertureFlux_12_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_12_0_fluxErr
ap12Flux_flag:
functor: Column
args: base_CircularApertureFlux_12_0_flag
ap17Flux:
functor: LocalNanojansky
functor: Column
args:
- base_CircularApertureFlux_17_0_instFlux
- base_CircularApertureFlux_17_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_17_0_flux
ap17FluxErr:
functor: LocalNanojanskyErr
functor: Column
args:
- base_CircularApertureFlux_17_0_instFlux
- base_CircularApertureFlux_17_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_17_0_fluxErr
ap17Flux_flag:
functor: Column
args: base_CircularApertureFlux_17_0_flag
ap25Flux:
functor: LocalNanojansky
functor: Column
args:
- base_CircularApertureFlux_25_0_instFlux
- base_CircularApertureFlux_25_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_25_0_flux
ap25FluxErr:
functor: LocalNanojanskyErr
functor: Column
args:
- base_CircularApertureFlux_25_0_instFlux
- base_CircularApertureFlux_25_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_25_0_fluxErr
ap25Flux_flag:
functor: Column
args: base_CircularApertureFlux_25_0_flag
ap35Flux:
functor: LocalNanojansky
functor: Column
args:
- base_CircularApertureFlux_35_0_instFlux
- base_CircularApertureFlux_35_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_35_0_flux
ap35FluxErr:
functor: LocalNanojanskyErr
functor: Column
args:
- base_CircularApertureFlux_35_0_instFlux
- base_CircularApertureFlux_35_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_35_0_fluxErr
ap35Flux_flag:
functor: Column
args: base_CircularApertureFlux_35_0_flag
ap50Flux:
functor: LocalNanojansky
functor: Column
args:
- base_CircularApertureFlux_50_0_instFlux
- base_CircularApertureFlux_50_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_50_0_flux
ap50FluxErr:
functor: LocalNanojanskyErr
functor: Column
args:
- base_CircularApertureFlux_50_0_instFlux
- base_CircularApertureFlux_50_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_50_0_fluxErr
ap50Flux_flag:
functor: Column
args: base_CircularApertureFlux_50_0_flag
ap70Flux:
functor: LocalNanojansky
functor: Column
args:
- base_CircularApertureFlux_70_0_instFlux
- base_CircularApertureFlux_70_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_70_0_flux
ap70FluxErr:
functor: LocalNanojanskyErr
functor: Column
args:
- base_CircularApertureFlux_70_0_instFlux
- base_CircularApertureFlux_70_0_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_CircularApertureFlux_70_0_fluxErr
ap70Flux_flag:
functor: Column
args: base_CircularApertureFlux_70_0_flag
# TODO: When DM-25019 is complete, these should be
# changed to use the local value of the background
# model, rather than the residual of the background
sky:
functor: LocalNanojansky
functor: Column
args:
- base_LocalBackground_instFlux
- base_LocalBackground_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_LocalBackground_flux
skyErr:
functor: LocalNanojanskyErr
functor: Column
args:
- base_LocalBackground_instFlux
- base_LocalBackground_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_LocalBackground_fluxErr
psfFlux:
functor: LocalNanojansky
functor: Column
args:
- slot_PsfFlux_instFlux
- slot_PsfFlux_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- slot_PsfFlux_flux
psfFluxErr:
functor: LocalNanojanskyErr
functor: Column
args:
- slot_PsfFlux_instFlux
- slot_PsfFlux_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- slot_PsfFlux_fluxErr

# These PS columns do not make sense anymore as named
# psX
Expand Down Expand Up @@ -304,34 +232,20 @@ funcs:
# DPDD does not include gaussianFluxes, however they are used for
# the single frame extendedness column which is used for QA.
gaussianFlux:
functor: LocalNanojansky
functor: Column
args:
- base_GaussianFlux_instFlux
- base_GaussianFlux_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_GaussianFlux_flux
gaussianFluxErr:
functor: LocalNanojanskyErr
functor: Column
args:
- base_GaussianFlux_instFlux
- base_GaussianFlux_instFluxErr
- base_LocalPhotoCalib
- base_LocalPhotoCalibErr
- base_GaussianFlux_fluxErr
extendedness:
functor: Column
args: base_ClassificationExtendedness_value
sizeExtendedness:
functor: Column
args: base_ClassificationSizeExtendedness_value
flags:
- base_LocalPhotoCalib
- base_LocalPhotoCalib_flag
- base_LocalPhotoCalibErr
- base_LocalWcs_flag
- base_LocalWcs_CDMatrix_2_1
- base_LocalWcs_CDMatrix_1_1
- base_LocalWcs_CDMatrix_1_2
- base_LocalWcs_CDMatrix_2_2
- base_Blendedness_abs
- base_Blendedness_flag
- base_Blendedness_flag_noCentroid
Expand Down

0 comments on commit fdc7815

Please sign in to comment.