36from .
import measurePsf, repair, setPrimaryFlags, photoCal, computeExposureSummaryStats
40 dimensions=(
"instrument",
"visit",
"detector")):
42 astrometry_ref_cat = connectionTypes.PrerequisiteInput(
43 doc=
"Reference catalog to use for astrometric calibration.",
44 name=
"gaia_dr3_20230707",
45 storageClass=
"SimpleCatalog",
46 dimensions=(
"skypix",),
50 photometry_ref_cat = connectionTypes.PrerequisiteInput(
51 doc=
"Reference catalog to use for photometric calibration.",
52 name=
"ps1_pv3_3pi_20170110",
53 storageClass=
"SimpleCatalog",
54 dimensions=(
"skypix",),
59 exposure = connectionTypes.Input(
60 doc=
"Exposure to be calibrated, and detected and measured on.",
62 storageClass=
"Exposure",
63 dimensions=[
"instrument",
"exposure",
"detector"],
67 initial_stars_schema = connectionTypes.InitOutput(
68 doc=
"Schema of the output initial stars catalog.",
69 name=
"initial_stars_schema",
70 storageClass=
"SourceCatalog",
75 output_exposure = connectionTypes.Output(
76 doc=
"Photometrically calibrated exposure with fitted calibrations and summary statistics.",
78 storageClass=
"ExposureF",
79 dimensions=(
"instrument",
"visit",
"detector"),
82 stars = connectionTypes.Output(
83 doc=
"Catalog of unresolved sources detected on the calibrated exposure; "
84 "includes source footprints.",
85 name=
"initial_stars_footprints_detector",
86 storageClass=
"SourceCatalog",
87 dimensions=[
"instrument",
"visit",
"detector"],
89 applied_photo_calib = connectionTypes.Output(
90 doc=
"Photometric calibration that was applied to exposure.",
91 name=
"initial_photoCalib_detector",
92 storageClass=
"PhotoCalib",
93 dimensions=(
"instrument",
"visit",
"detector"),
95 background = connectionTypes.Output(
96 doc=
"Background models estimated during calibration task.",
97 name=
"initial_pvi_background",
98 storageClass=
"Background",
99 dimensions=(
"instrument",
"visit",
"detector"),
107 psf_stars = connectionTypes.Output(
108 doc=
"Catalog of bright unresolved sources detected on the exposure used for PSF determination; "
109 "includes source footprints.",
110 name=
"initial_psf_stars_footprints",
111 storageClass=
"SourceCatalog",
112 dimensions=[
"instrument",
"visit",
"detector"],
114 astrometry_matches = connectionTypes.Output(
115 doc=
"Source to reference catalog matches from the astrometry solver.",
116 name=
"initial_astrometry_match_detector",
117 storageClass=
"Catalog",
118 dimensions=(
"instrument",
"visit",
"detector"),
120 photometry_matches = connectionTypes.Output(
121 doc=
"Source to reference catalog matches from the photometry solver.",
122 name=
"initial_photometry_match_detector",
123 storageClass=
"Catalog",
124 dimensions=(
"instrument",
"visit",
"detector"),
129 if not config.optional_outputs:
130 self.outputs.remove(
"psf_stars")
131 self.outputs.remove(
"astrometry_matches")
132 self.outputs.remove(
"photometry_matches")
136 optional_outputs = pexConfig.ListField(
137 doc=
"Which optional outputs to save (as their connection name)?",
141 default=[
"psf_stars",
"astrometry_matches",
"photometry_matches"],
146 install_simple_psf = pexConfig.ConfigurableField(
148 doc=
"Task to install a simple PSF model into the input exposure to use "
149 "when detecting bright sources for PSF estimation.",
151 psf_repair = pexConfig.ConfigurableField(
153 doc=
"Task to repair cosmic rays on the exposure before PSF determination.",
155 psf_subtract_background = pexConfig.ConfigurableField(
156 target=lsst.meas.algorithms.SubtractBackgroundTask,
157 doc=
"Task to perform intial background subtraction, before first detection pass.",
159 psf_detection = pexConfig.ConfigurableField(
160 target=lsst.meas.algorithms.SourceDetectionTask,
161 doc=
"Task to detect sources for PSF determination."
163 psf_source_measurement = pexConfig.ConfigurableField(
164 target=lsst.meas.base.SingleFrameMeasurementTask,
165 doc=
"Task to measure sources to be used for psf estimation."
167 psf_measure_psf = pexConfig.ConfigurableField(
169 doc=
"Task to measure the psf on bright sources."
174 measure_aperture_correction = pexConfig.ConfigurableField(
176 doc=
"Task to compute the aperture correction from the bright stars."
180 star_detection = pexConfig.ConfigurableField(
181 target=lsst.meas.algorithms.SourceDetectionTask,
182 doc=
"Task to detect stars to return in the output catalog."
184 star_deblend = pexConfig.ConfigurableField(
185 target=lsst.meas.deblender.SourceDeblendTask,
186 doc=
"Split blended sources into their components"
188 star_measurement = pexConfig.ConfigurableField(
189 target=lsst.meas.base.SingleFrameMeasurementTask,
190 doc=
"Task to measure stars to return in the output catalog."
192 star_apply_aperture_correction = pexConfig.ConfigurableField(
193 target=lsst.meas.base.ApplyApCorrTask,
194 doc=
"Task to apply aperture corrections to the selected stars."
196 star_catalog_calculation = pexConfig.ConfigurableField(
197 target=lsst.meas.base.CatalogCalculationTask,
198 doc=
"Task to compute extendedness values on the star catalog, "
199 "for the star selector to remove extended sources."
201 star_set_primary_flags = pexConfig.ConfigurableField(
203 doc=
"Task to add isPrimary to the catalog."
205 star_selector = lsst.meas.algorithms.sourceSelectorRegistry.makeField(
207 doc=
"Task to select isolated stars to use for calibration."
211 astrometry = pexConfig.ConfigurableField(
212 target=lsst.meas.astrom.AstrometryTask,
213 doc=
"Task to perform astrometric calibration to fit a WCS.",
215 astrometry_ref_loader = pexConfig.ConfigField(
216 dtype=lsst.meas.algorithms.LoadReferenceObjectsConfig,
217 doc=
"Configuration of reference object loader for astrometric fit.",
219 photometry = pexConfig.ConfigurableField(
221 doc=
"Task to perform photometric calibration to fit a PhotoCalib.",
223 photometry_ref_loader = pexConfig.ConfigField(
224 dtype=lsst.meas.algorithms.LoadReferenceObjectsConfig,
225 doc=
"Configuration of reference object loader for photometric fit.",
228 compute_summary_stats = pexConfig.ConfigurableField(
230 doc=
"Task to to compute summary statistics on the calibrated exposure."
258 "ext_shapeHSM_HsmSourceMoments",
259 "base_CircularApertureFlux",
272 self.
psf_measure_psf.starSelector[
"objectSize"].doSignalToNoiseLimit =
True
289 "ext_shapeHSM_HsmSourceMoments",
290 'ext_shapeHSM_HsmPsfMoments',
293 "base_CircularApertureFlux",
310 self.
astrometry.wcsFitter.retarget(lsst.meas.astrom.FitAffineWcsTask)
315 self.
astrometry.doMagnitudeOutlierRejection =
True
319 self.
photometry.match.sourceSelection.retarget(sourceSelector.NullSourceSelectorTask)