35 """Configuration parameters for CoaddBaseTask
37 Configuration parameters shared between MakeCoaddTempExp and AssembleCoadd
40 coaddName = pexConfig.Field(
41 doc=
"Coadd name: typically one of deep or goodSeeing.",
45 select = pexConfig.ConfigurableField(
46 doc=
"Image selection subtask.",
47 target=PsfWcsSelectImagesTask,
49 badMaskPlanes = pexConfig.ListField(
51 doc=
"Mask planes that, if set, the associated pixel should not be included in the coaddTempExp.",
54 inputRecorder = pexConfig.ConfigurableField(
55 doc=
"Subtask that helps fill CoaddInputs catalogs added to the final Exposure",
56 target=CoaddInputRecorderTask
58 doPsfMatch = pexConfig.Field(
60 doc=
"Match to modelPsf? Sets makePsfMatched=True, makeDirect=False",
61 deprecated=
"This field is no longer used. Will be removed after v26.",
64 modelPsf = measAlg.GaussianPsfFactory.makeField(doc=
"Model Psf factory")
65 doApplyExternalPhotoCalib = pexConfig.Field(
68 doc=(
"Whether to apply external photometric calibration via an "
69 "`lsst.afw.image.PhotoCalib` object. Uses the "
70 "`externalPhotoCalibName` field to determine which calibration "
73 deprecated=
"Deprecated in favor of the 'visitSummary' connection. Will be removed after v26.",
75 useGlobalExternalPhotoCalib = pexConfig.Field(
78 doc=(
"When using doApplyExternalPhotoCalib, use 'global' calibrations "
79 "that are not run per-tract. When False, use per-tract photometric "
80 "calibration files."),
82 deprecated=
"Deprecated in favor of the 'visitSummary' connection. Will be removed after v26.",
84 doApplyExternalSkyWcs = pexConfig.Field(
87 doc=(
"Whether to apply external astrometric calibration via an "
88 "`lsst.afw.geom.SkyWcs` object. Uses `externalSkyWcsName` "
89 "field to determine which calibration to load."),
91 deprecated=
"Deprecated in favor of the 'visitSummary' connection. Will be removed after v26.",
93 useGlobalExternalSkyWcs = pexConfig.Field(
96 doc=(
"When using doApplyExternalSkyWcs, use 'global' calibrations "
97 "that are not run per-tract. When False, use per-tract wcs "
100 deprecated=
"Deprecated in favor of the 'visitSummary' connection. Will be removed after v26.",
102 includeCalibVar = pexConfig.Field(
104 doc=
"Add photometric calibration variance to warp variance plane.",
107 matchingKernelSize = pexConfig.Field(
109 doc=
"Size in pixels of matching kernel. Must be odd.",
111 check=
lambda x: x % 2 == 1
149 """Constructs SkyInfo used by coaddition tasks for multiple
154 skyMap : `lsst.skyMap.SkyMap`
158 patchId : `str` or `int` or `tuple` of `int`
159 Either Gen2-style comma delimited string (e.g. '4,5'),
160 tuple of integers (e.g (4, 5), Gen3-style integer.
164 makeSkyInfo : `lsst.pipe.base.Struct`
165 pipe_base Struct with attributes:
168 Sky map (`lsst.skyMap.SkyMap`).
170 Information for chosen tract of sky map (`lsst.skyMap.TractInfo`).
172 Information about chosen patch of tract (`lsst.skyMap.PatchInfo`).
174 WCS of tract (`lsst.afw.image.SkyWcs`).
176 Outer bbox of patch, as an geom Box2I (`lsst.afw.geom.Box2I`).
178 tractInfo = skyMap[tractId]
180 if isinstance(patchId, str)
and ',' in patchId:
182 patchIndex = tuple(int(i)
for i
in patchId.split(
","))
186 patchInfo = tractInfo.getPatchInfo(patchIndex)
188 return pipeBase.Struct(
192 wcs=tractInfo.getWcs(),
193 bbox=patchInfo.getOuterBBox(),
197def scaleVariance(maskedImage, maskPlanes, log=None):
198 """Scale the variance in a maskedImage
200 This is deprecated. Use the ScaleVarianceTask instead.
204 maskedImage : `lsst.afw.image.MaskedImage`
205 MaskedImage to operate on; variance will be scaled.
207 List of mask planes for pixels to reject.
209 Log for reporting the renormalization factor; or None.
214 Renormalization factor.
218 The variance plane in a convolved or warped image (or a coadd derived
219 from warped images) does not accurately reflect the noise properties of
220 the image because variance has been lost to covariance. This function
221 attempts to correct for this by scaling the variance plane to match
222 the observed variance in the image. This is not perfect (because we're
223 not tracking the covariance) but it's simple and is often good enough.
225 config = ScaleVarianceTask.ConfigClass()
226 config.maskPlanes = maskPlanes
227 task = ScaleVarianceTask(config=config, name=
"scaleVariance", log=log)
228 return task.run(maskedImage)