41from .
import measurePsf, repair, photoCal, computeExposureSummaryStats, snapCombine
45 dimensions=(
"instrument",
"visit",
"detector")):
47 astrometry_ref_cat = connectionTypes.PrerequisiteInput(
48 doc=
"Reference catalog to use for astrometric calibration.",
49 name=
"gaia_dr3_20230707",
50 storageClass=
"SimpleCatalog",
51 dimensions=(
"skypix",),
55 photometry_ref_cat = connectionTypes.PrerequisiteInput(
56 doc=
"Reference catalog to use for photometric calibration.",
57 name=
"ps1_pv3_3pi_20170110",
58 storageClass=
"SimpleCatalog",
59 dimensions=(
"skypix",),
64 exposures = connectionTypes.Input(
65 doc=
"Exposure (or two snaps) to be calibrated, and detected and measured on.",
67 storageClass=
"Exposure",
69 dimensions=[
"instrument",
"exposure",
"detector"],
73 initial_stars_schema = connectionTypes.InitOutput(
74 doc=
"Schema of the output initial stars catalog.",
75 name=
"initial_stars_schema",
76 storageClass=
"SourceCatalog",
81 exposure = connectionTypes.Output(
82 doc=
"Photometrically calibrated exposure with fitted calibrations and summary statistics.",
84 storageClass=
"ExposureF",
85 dimensions=(
"instrument",
"visit",
"detector"),
87 stars = connectionTypes.Output(
88 doc=
"Catalog of unresolved sources detected on the calibrated exposure.",
89 name=
"initial_stars_detector",
90 storageClass=
"ArrowAstropy",
91 dimensions=[
"instrument",
"visit",
"detector"],
93 stars_footprints = connectionTypes.Output(
94 doc=
"Catalog of unresolved sources detected on the calibrated exposure; "
95 "includes source footprints.",
96 name=
"initial_stars_footprints_detector",
97 storageClass=
"SourceCatalog",
98 dimensions=[
"instrument",
"visit",
"detector"],
100 applied_photo_calib = connectionTypes.Output(
101 doc=
"Photometric calibration that was applied to exposure.",
102 name=
"initial_photoCalib_detector",
103 storageClass=
"PhotoCalib",
104 dimensions=(
"instrument",
"visit",
"detector"),
106 background = connectionTypes.Output(
107 doc=
"Background models estimated during calibration task.",
108 name=
"initial_pvi_background",
109 storageClass=
"Background",
110 dimensions=(
"instrument",
"visit",
"detector"),
114 psf_stars_footprints = connectionTypes.Output(
115 doc=
"Catalog of bright unresolved sources detected on the exposure used for PSF determination; "
116 "includes source footprints.",
117 name=
"initial_psf_stars_footprints_detector",
118 storageClass=
"SourceCatalog",
119 dimensions=[
"instrument",
"visit",
"detector"],
121 psf_stars = connectionTypes.Output(
122 doc=
"Catalog of bright unresolved sources detected on the exposure used for PSF determination.",
123 name=
"initial_psf_stars_detector",
124 storageClass=
"ArrowAstropy",
125 dimensions=[
"instrument",
"visit",
"detector"],
127 astrometry_matches = connectionTypes.Output(
128 doc=
"Source to reference catalog matches from the astrometry solver.",
129 name=
"initial_astrometry_match_detector",
130 storageClass=
"Catalog",
131 dimensions=(
"instrument",
"visit",
"detector"),
133 photometry_matches = connectionTypes.Output(
134 doc=
"Source to reference catalog matches from the photometry solver.",
135 name=
"initial_photometry_match_detector",
136 storageClass=
"Catalog",
137 dimensions=(
"instrument",
"visit",
"detector"),
142 if not config.optional_outputs:
150 optional_outputs = pexConfig.ListField(
151 doc=
"Which optional outputs to save (as their connection name)?",
155 default=[
"psf_stars",
"psf_stars_footprints",
"astrometry_matches",
"photometry_matches"],
160 id_generator = lsst.meas.base.DetectorVisitIdGeneratorConfig.make_field()
162 snap_combine = pexConfig.ConfigurableField(
164 doc=
"Task to combine two snaps to make one exposure.",
168 install_simple_psf = pexConfig.ConfigurableField(
170 doc=
"Task to install a simple PSF model into the input exposure to use "
171 "when detecting bright sources for PSF estimation.",
173 psf_repair = pexConfig.ConfigurableField(
175 doc=
"Task to repair cosmic rays on the exposure before PSF determination.",
177 psf_subtract_background = pexConfig.ConfigurableField(
178 target=lsst.meas.algorithms.SubtractBackgroundTask,
179 doc=
"Task to perform intial background subtraction, before first detection pass.",
181 psf_detection = pexConfig.ConfigurableField(
182 target=lsst.meas.algorithms.SourceDetectionTask,
183 doc=
"Task to detect sources for PSF determination."
185 psf_source_measurement = pexConfig.ConfigurableField(
186 target=lsst.meas.base.SingleFrameMeasurementTask,
187 doc=
"Task to measure sources to be used for psf estimation."
189 psf_measure_psf = pexConfig.ConfigurableField(
191 doc=
"Task to measure the psf on bright sources."
196 measure_aperture_correction = pexConfig.ConfigurableField(
198 doc=
"Task to compute the aperture correction from the bright stars."
202 star_detection = pexConfig.ConfigurableField(
203 target=lsst.meas.algorithms.SourceDetectionTask,
204 doc=
"Task to detect stars to return in the output catalog."
206 star_sky_sources = pexConfig.ConfigurableField(
207 target=lsst.meas.algorithms.SkyObjectsTask,
208 doc=
"Task to generate sky sources ('empty' regions where there are no detections).",
210 star_deblend = pexConfig.ConfigurableField(
211 target=lsst.meas.deblender.SourceDeblendTask,
212 doc=
"Split blended sources into their components."
214 star_measurement = pexConfig.ConfigurableField(
215 target=lsst.meas.base.SingleFrameMeasurementTask,
216 doc=
"Task to measure stars to return in the output catalog."
218 star_apply_aperture_correction = pexConfig.ConfigurableField(
219 target=lsst.meas.base.ApplyApCorrTask,
220 doc=
"Task to apply aperture corrections to the selected stars."
222 star_catalog_calculation = pexConfig.ConfigurableField(
223 target=lsst.meas.base.CatalogCalculationTask,
224 doc=
"Task to compute extendedness values on the star catalog, "
225 "for the star selector to remove extended sources."
227 star_set_primary_flags = pexConfig.ConfigurableField(
229 doc=
"Task to add isPrimary to the catalog."
231 star_selector = lsst.meas.algorithms.sourceSelectorRegistry.makeField(
233 doc=
"Task to select isolated stars to use for calibration."
237 astrometry = pexConfig.ConfigurableField(
238 target=lsst.meas.astrom.AstrometryTask,
239 doc=
"Task to perform astrometric calibration to fit a WCS.",
241 astrometry_ref_loader = pexConfig.ConfigField(
242 dtype=lsst.meas.algorithms.LoadReferenceObjectsConfig,
243 doc=
"Configuration of reference object loader for astrometric fit.",
245 photometry = pexConfig.ConfigurableField(
247 doc=
"Task to perform photometric calibration to fit a PhotoCalib.",
249 photometry_ref_loader = pexConfig.ConfigField(
250 dtype=lsst.meas.algorithms.LoadReferenceObjectsConfig,
251 doc=
"Configuration of reference object loader for photometric fit.",
254 compute_summary_stats = pexConfig.ConfigurableField(
256 doc=
"Task to to compute summary statistics on the calibrated exposure."
289 "ext_shapeHSM_HsmSourceMoments",
290 "base_CircularApertureFlux",
299 "base_CircularApertureFlux_12_0_instFlux"
313 "ext_shapeHSM_HsmSourceMoments",
314 'ext_shapeHSM_HsmPsfMoments',
317 "base_CircularApertureFlux",
318 "base_ClassificationSizeExtendedness",
336 self.
astrometry.wcsFitter.retarget(lsst.meas.astrom.FitAffineWcsTask)
341 self.
astrometry.sourceSelector[
"science"].doFlags =
True
342 self.
astrometry.sourceSelector[
"science"].flags.bad = [
"sky_source"]
343 self.
photometry.match.sourceSelection.doFlags =
True
344 self.
photometry.match.sourceSelection.flags.bad = [
"sky_source"]