38from .
import measurePsf, repair, setPrimaryFlags, photoCal, computeExposureSummaryStats, maskStreaks
42 dimensions=(
"instrument",
"visit",
"detector")):
44 astrometry_ref_cat = connectionTypes.PrerequisiteInput(
45 doc=
"Reference catalog to use for astrometric calibration.",
46 name=
"gaia_dr3_20230707",
47 storageClass=
"SimpleCatalog",
48 dimensions=(
"skypix",),
52 photometry_ref_cat = connectionTypes.PrerequisiteInput(
53 doc=
"Reference catalog to use for photometric calibration.",
54 name=
"ps1_pv3_3pi_20170110",
55 storageClass=
"SimpleCatalog",
56 dimensions=(
"skypix",),
61 exposure = connectionTypes.Input(
62 doc=
"Exposure to be calibrated, and detected and measured on.",
64 storageClass=
"Exposure",
65 dimensions=[
"instrument",
"exposure",
"detector"],
69 initial_stars_schema = connectionTypes.InitOutput(
70 doc=
"Schema of the output initial stars catalog.",
71 name=
"initial_stars_schema",
72 storageClass=
"SourceCatalog",
77 output_exposure = connectionTypes.Output(
78 doc=
"Photometrically calibrated exposure with fitted calibrations and summary statistics.",
80 storageClass=
"ExposureF",
81 dimensions=(
"instrument",
"visit",
"detector"),
84 stars = connectionTypes.Output(
85 doc=
"Catalog of unresolved sources detected on the calibrated exposure; "
86 "includes source footprints.",
87 name=
"initial_stars_footprints_detector",
88 storageClass=
"SourceCatalog",
89 dimensions=[
"instrument",
"visit",
"detector"],
91 applied_photo_calib = connectionTypes.Output(
92 doc=
"Photometric calibration that was applied to exposure.",
93 name=
"initial_photoCalib_detector",
94 storageClass=
"PhotoCalib",
95 dimensions=(
"instrument",
"visit",
"detector"),
97 background = connectionTypes.Output(
98 doc=
"Background models estimated during calibration task.",
99 name=
"initial_pvi_background",
100 storageClass=
"Background",
101 dimensions=(
"instrument",
"visit",
"detector"),
109 psf_stars = connectionTypes.Output(
110 doc=
"Catalog of bright unresolved sources detected on the exposure used for PSF determination; "
111 "includes source footprints.",
112 name=
"initial_psf_stars_footprints",
113 storageClass=
"SourceCatalog",
114 dimensions=[
"instrument",
"visit",
"detector"],
116 astrometry_matches = connectionTypes.Output(
117 doc=
"Source to reference catalog matches from the astrometry solver.",
118 name=
"initial_astrometry_match_detector",
119 storageClass=
"Catalog",
120 dimensions=(
"instrument",
"visit",
"detector"),
122 photometry_matches = connectionTypes.Output(
123 doc=
"Source to reference catalog matches from the photometry solver.",
124 name=
"initial_photometry_match_detector",
125 storageClass=
"Catalog",
126 dimensions=(
"instrument",
"visit",
"detector"),
131 if not config.optional_outputs:
132 self.outputs.remove(
"psf_stars")
133 self.outputs.remove(
"astrometry_matches")
134 self.outputs.remove(
"photometry_matches")
138 optional_outputs = pexConfig.ListField(
139 doc=
"Which optional outputs to save (as their connection name)?",
143 default=[
"psf_stars",
"astrometry_matches",
"photometry_matches"],
148 install_simple_psf = pexConfig.ConfigurableField(
150 doc=
"Task to install a simple PSF model into the input exposure to use "
151 "when detecting bright sources for PSF estimation.",
153 psf_repair = pexConfig.ConfigurableField(
155 doc=
"Task to repair cosmic rays on the exposure before PSF determination.",
157 psf_subtract_background = pexConfig.ConfigurableField(
158 target=lsst.meas.algorithms.SubtractBackgroundTask,
159 doc=
"Task to perform intial background subtraction, before first detection pass.",
161 psf_detection = pexConfig.ConfigurableField(
162 target=lsst.meas.algorithms.SourceDetectionTask,
163 doc=
"Task to detect sources for PSF determination."
165 psf_source_measurement = pexConfig.ConfigurableField(
166 target=lsst.meas.base.SingleFrameMeasurementTask,
167 doc=
"Task to measure sources to be used for psf estimation."
169 psf_measure_psf = pexConfig.ConfigurableField(
171 doc=
"Task to measure the psf on bright sources."
176 measure_aperture_correction = pexConfig.ConfigurableField(
178 doc=
"Task to compute the aperture correction from the bright stars."
182 star_detection = pexConfig.ConfigurableField(
183 target=lsst.meas.algorithms.SourceDetectionTask,
184 doc=
"Task to detect stars to return in the output catalog."
186 star_mask_streaks = pexConfig.ConfigurableField(
188 doc=
"Task for masking streaks. Adds a STREAK mask plane to an exposure.",
190 star_deblend = pexConfig.ConfigurableField(
191 target=lsst.meas.deblender.SourceDeblendTask,
192 doc=
"Split blended sources into their components"
194 star_measurement = pexConfig.ConfigurableField(
195 target=lsst.meas.base.SingleFrameMeasurementTask,
196 doc=
"Task to measure stars to return in the output catalog."
198 star_apply_aperture_correction = pexConfig.ConfigurableField(
199 target=lsst.meas.base.ApplyApCorrTask,
200 doc=
"Task to apply aperture corrections to the selected stars."
202 star_catalog_calculation = pexConfig.ConfigurableField(
203 target=lsst.meas.base.CatalogCalculationTask,
204 doc=
"Task to compute extendedness values on the star catalog, "
205 "for the star selector to remove extended sources."
207 star_set_primary_flags = pexConfig.ConfigurableField(
209 doc=
"Task to add isPrimary to the catalog."
211 star_selector = lsst.meas.algorithms.sourceSelectorRegistry.makeField(
213 doc=
"Task to select isolated stars to use for calibration."
217 astrometry = pexConfig.ConfigurableField(
218 target=lsst.meas.astrom.AstrometryTask,
219 doc=
"Task to perform astrometric calibration to fit a WCS.",
221 astrometry_ref_loader = pexConfig.ConfigField(
222 dtype=lsst.meas.algorithms.LoadReferenceObjectsConfig,
223 doc=
"Configuration of reference object loader for astrometric fit.",
225 photometry = pexConfig.ConfigurableField(
227 doc=
"Task to perform photometric calibration to fit a PhotoCalib.",
229 photometry_ref_loader = pexConfig.ConfigField(
230 dtype=lsst.meas.algorithms.LoadReferenceObjectsConfig,
231 doc=
"Configuration of reference object loader for photometric fit.",
234 compute_summary_stats = pexConfig.ConfigurableField(
236 doc=
"Task to to compute summary statistics on the calibrated exposure."
263 "ext_shapeHSM_HsmSourceMoments",
264 "base_CircularApertureFlux",
290 "ext_shapeHSM_HsmSourceMoments",
291 'ext_shapeHSM_HsmPsfMoments',
294 "base_CircularApertureFlux",
302 self.
star_measurement.plugins[
'base_PixelFlags'].masksFpAnywhere = [
'STREAK']
313 self.
astrometry.wcsFitter.retarget(lsst.meas.astrom.FitAffineWcsTask)
319 self.
photometry.match.sourceSelection.retarget(sourceSelector.NullSourceSelectorTask)