40from .
import measurePsf, repair, setPrimaryFlags, photoCal, \
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 output_exposure = connectionTypes.Output(
82 doc=
"Photometrically calibrated exposure with fitted calibrations and summary statistics.",
84 storageClass=
"ExposureF",
85 dimensions=(
"instrument",
"visit",
"detector"),
88 stars = connectionTypes.Output(
89 doc=
"Catalog of unresolved sources detected on the calibrated exposure; "
90 "includes source footprints.",
91 name=
"initial_stars_footprints_detector",
92 storageClass=
"SourceCatalog",
93 dimensions=[
"instrument",
"visit",
"detector"],
95 applied_photo_calib = connectionTypes.Output(
96 doc=
"Photometric calibration that was applied to exposure.",
97 name=
"initial_photoCalib_detector",
98 storageClass=
"PhotoCalib",
99 dimensions=(
"instrument",
"visit",
"detector"),
101 background = connectionTypes.Output(
102 doc=
"Background models estimated during calibration task.",
103 name=
"initial_pvi_background",
104 storageClass=
"Background",
105 dimensions=(
"instrument",
"visit",
"detector"),
113 psf_stars = connectionTypes.Output(
114 doc=
"Catalog of bright unresolved sources detected on the exposure used for PSF determination; "
115 "includes source footprints.",
116 name=
"initial_psf_stars_footprints",
117 storageClass=
"SourceCatalog",
118 dimensions=[
"instrument",
"visit",
"detector"],
120 astrometry_matches = connectionTypes.Output(
121 doc=
"Source to reference catalog matches from the astrometry solver.",
122 name=
"initial_astrometry_match_detector",
123 storageClass=
"Catalog",
124 dimensions=(
"instrument",
"visit",
"detector"),
126 photometry_matches = connectionTypes.Output(
127 doc=
"Source to reference catalog matches from the photometry solver.",
128 name=
"initial_photometry_match_detector",
129 storageClass=
"Catalog",
130 dimensions=(
"instrument",
"visit",
"detector"),
135 if not config.optional_outputs:
136 self.outputs.remove(
"psf_stars")
137 self.outputs.remove(
"astrometry_matches")
138 self.outputs.remove(
"photometry_matches")
142 optional_outputs = pexConfig.ListField(
143 doc=
"Which optional outputs to save (as their connection name)?",
147 default=[
"psf_stars",
"astrometry_matches",
"photometry_matches"],
151 snap_combine = pexConfig.ConfigurableField(
153 doc=
"Task to combine two snaps to make one exposure.",
157 install_simple_psf = pexConfig.ConfigurableField(
159 doc=
"Task to install a simple PSF model into the input exposure to use "
160 "when detecting bright sources for PSF estimation.",
162 psf_repair = pexConfig.ConfigurableField(
164 doc=
"Task to repair cosmic rays on the exposure before PSF determination.",
166 psf_subtract_background = pexConfig.ConfigurableField(
167 target=lsst.meas.algorithms.SubtractBackgroundTask,
168 doc=
"Task to perform intial background subtraction, before first detection pass.",
170 psf_detection = pexConfig.ConfigurableField(
171 target=lsst.meas.algorithms.SourceDetectionTask,
172 doc=
"Task to detect sources for PSF determination."
174 psf_source_measurement = pexConfig.ConfigurableField(
175 target=lsst.meas.base.SingleFrameMeasurementTask,
176 doc=
"Task to measure sources to be used for psf estimation."
178 psf_measure_psf = pexConfig.ConfigurableField(
180 doc=
"Task to measure the psf on bright sources."
185 measure_aperture_correction = pexConfig.ConfigurableField(
187 doc=
"Task to compute the aperture correction from the bright stars."
191 star_detection = pexConfig.ConfigurableField(
192 target=lsst.meas.algorithms.SourceDetectionTask,
193 doc=
"Task to detect stars to return in the output catalog."
195 star_mask_streaks = pexConfig.ConfigurableField(
197 doc=
"Task for masking streaks. Adds a STREAK mask plane to an exposure.",
199 star_deblend = pexConfig.ConfigurableField(
200 target=lsst.meas.deblender.SourceDeblendTask,
201 doc=
"Split blended sources into their components"
203 star_measurement = pexConfig.ConfigurableField(
204 target=lsst.meas.base.SingleFrameMeasurementTask,
205 doc=
"Task to measure stars to return in the output catalog."
207 star_apply_aperture_correction = pexConfig.ConfigurableField(
208 target=lsst.meas.base.ApplyApCorrTask,
209 doc=
"Task to apply aperture corrections to the selected stars."
211 star_catalog_calculation = pexConfig.ConfigurableField(
212 target=lsst.meas.base.CatalogCalculationTask,
213 doc=
"Task to compute extendedness values on the star catalog, "
214 "for the star selector to remove extended sources."
216 star_set_primary_flags = pexConfig.ConfigurableField(
218 doc=
"Task to add isPrimary to the catalog."
220 star_selector = lsst.meas.algorithms.sourceSelectorRegistry.makeField(
222 doc=
"Task to select isolated stars to use for calibration."
226 astrometry = pexConfig.ConfigurableField(
227 target=lsst.meas.astrom.AstrometryTask,
228 doc=
"Task to perform astrometric calibration to fit a WCS.",
230 astrometry_ref_loader = pexConfig.ConfigField(
231 dtype=lsst.meas.algorithms.LoadReferenceObjectsConfig,
232 doc=
"Configuration of reference object loader for astrometric fit.",
234 photometry = pexConfig.ConfigurableField(
236 doc=
"Task to perform photometric calibration to fit a PhotoCalib.",
238 photometry_ref_loader = pexConfig.ConfigField(
239 dtype=lsst.meas.algorithms.LoadReferenceObjectsConfig,
240 doc=
"Configuration of reference object loader for photometric fit.",
243 compute_summary_stats = pexConfig.ConfigurableField(
245 doc=
"Task to to compute summary statistics on the calibrated exposure."
272 "ext_shapeHSM_HsmSourceMoments",
273 "base_CircularApertureFlux",
299 "ext_shapeHSM_HsmSourceMoments",
300 'ext_shapeHSM_HsmPsfMoments',
303 "base_CircularApertureFlux",
311 self.
star_measurement.plugins[
'base_PixelFlags'].masksFpAnywhere = [
'STREAK']
322 self.
astrometry.wcsFitter.retarget(lsst.meas.astrom.FitAffineWcsTask)
328 self.
photometry.match.sourceSelection.retarget(sourceSelector.NullSourceSelectorTask)