|
lsst.ip.diffim gfb11b3eabb+762ba863b1
|
Classes | |
| class | GetTemplateConnections |
| class | GetTemplateTask |
| class | GetDcrTemplateConnections |
Functions | |
| setDefaults (self) | |
| checkPatchList (self, patchList) | |
| getDcrModel (self, patchList, coaddRefs, visitInfo) | |
| _selectDataRef (coaddRef, tract, patch) | |
Variables | |
| int | _PSF_STAMP_SIGMAS = 5 |
| output_image_type | |
| type | allowed |
| bool | optional = False, |
| str | default = "legacy", |
| raiseOnUndefinedMaskMap | |
| detectorPolygon = geom.Box2D(bbox) | |
| int | overlappingArea = 0 |
| dataIds = collections.defaultdict(list) | |
| patchList = dict() | |
| dataId = coaddRef.dataId | |
| subfilter = dataId["subfilter"] | |
| patchWcs = skymap[dataId["tract"]].getWcs() | |
| patchBBox = skymap[dataId["tract"]][dataId["patch"]].getOuterBBox() | |
| patchCorners = patchWcs.pixelToSky(geom.Box2D(patchBBox).getCorners()) | |
| patchPolygon = afwGeom.Polygon(wcs.skyToPixel(patchCorners)) | |
| coaddExposures = self.getDcrModel(patchList, dcrCoaddExposureHandles, visitInfo) | |
|
protected |
Definition at line 1222 of file getTemplate.py.
| checkPatchList | ( | self, | |
| patchList ) |
Check that all of the DcrModel subfilters are present for each
patch.
Parameters
----------
patchList : `dict`
Dict of the patches containing valid data for each tract.
Raises
------
RuntimeError
If the number of exposures found for a patch does not match the
number of subfilters.
Definition at line 1161 of file getTemplate.py.
| getDcrModel | ( | self, | |
| patchList, | |||
| coaddRefs, | |||
| visitInfo ) |
Build DCR-matched coadds from a list of exposure references.
Parameters
----------
patchList : `dict`
Dict of the patches containing valid data for each tract.
coaddRefs : `list` [`lsst.daf.butler.DeferredDatasetHandle`]
Data references to `~lsst.afw.image.Exposure` representing
DcrModels that overlap the detector.
visitInfo : `lsst.afw.image.VisitInfo`
Metadata for the science image.
Returns
-------
coaddExposures : `list` [`lsst.afw.image.Exposure`]
Coadd exposures that overlap the detector.
Definition at line 1185 of file getTemplate.py.
| setDefaults | ( | self | ) |
Definition at line 222 of file getTemplate.py.
|
protected |
Definition at line 59 of file getTemplate.py.
| type lsst.ip.diffim.getTemplate.allowed |
Definition at line 205 of file getTemplate.py.
| lsst.ip.diffim.getTemplate.coaddExposures = self.getDcrModel(patchList, dcrCoaddExposureHandles, visitInfo) |
Definition at line 1158 of file getTemplate.py.
| lsst.ip.diffim.getTemplate.dataId = coaddRef.dataId |
Definition at line 1130 of file getTemplate.py.
| lsst.ip.diffim.getTemplate.dataIds = collections.defaultdict(list) |
Definition at line 1127 of file getTemplate.py.
| str lsst.ip.diffim.getTemplate.default = "legacy", |
Definition at line 211 of file getTemplate.py.
| lsst.ip.diffim.getTemplate.detectorPolygon = geom.Box2D(bbox) |
numSubfilters = pexConfig.Field(
doc="Number of subfilters in the DcrCoadd.",
dtype=int,
default=3,
)
effectiveWavelength = pexConfig.Field(
doc="Effective wavelength of the filter in nm.",
optional=False,
dtype=float,
)
bandwidth = pexConfig.Field(
doc="Bandwidth of the physical filter.",
optional=False,
dtype=float,
)
def validate(self):
if self.effectiveWavelength is None or self.bandwidth is None:
raise ValueError(
"The effective wavelength and bandwidth of the physical filter "
"must be set in the getTemplate config for DCR coadds. "
"Required until transmission curves are used in DM-13668."
)
class GetDcrTemplateTask(GetTemplateTask):
ConfigClass = GetDcrTemplateConfig
_DefaultName = "getDcrTemplate"
def runQuantum(self, butlerQC, inputRefs, outputRefs):
inputs = butlerQC.get(inputRefs)
detector = inputs.pop("detector")
bbox = detector.getBBox()
wcs = inputs.pop("wcs")
dcrCoaddExposureHandles = inputs.pop("dcrCoadds")
skymap = inputs.pop("skyMap")
visitInfo = inputs.pop("visitInfo")
# This task never converts its output, so the observation metadata
# that the conversion needs is dropped here.
inputs.pop("obs_info", None)
# This should not happen with a properly configured execution context.
assert not inputs, "runQuantum got more inputs than expected"
results = self.getExposures(
dcrCoaddExposureHandles, bbox, skymap, wcs, visitInfo
)
physical_filter = butlerQC.quantum.dataId["physical_filter"]
outputs = self.run(
coaddExposureHandles=results.coaddExposures,
bbox=bbox,
wcs=wcs,
dataIds=results.dataIds,
physical_filter=physical_filter,
)
butlerQC.put(outputs, outputRefs)
def getExposures(self, dcrCoaddExposureHandles, bbox, skymap, wcs, visitInfo):
Definition at line 1125 of file getTemplate.py.
| bool lsst.ip.diffim.getTemplate.optional = False, |
Definition at line 210 of file getTemplate.py.
| lsst.ip.diffim.getTemplate.output_image_type |
Definition at line 84 of file getTemplate.py.
| int lsst.ip.diffim.getTemplate.overlappingArea = 0 |
Definition at line 1126 of file getTemplate.py.
Definition at line 1133 of file getTemplate.py.
| lsst.ip.diffim.getTemplate.patchCorners = patchWcs.pixelToSky(geom.Box2D(patchBBox).getCorners()) |
Definition at line 1134 of file getTemplate.py.
| lsst.ip.diffim.getTemplate.patchList = dict() |
Definition at line 1128 of file getTemplate.py.
| lsst.ip.diffim.getTemplate.patchPolygon = afwGeom.Polygon(wcs.skyToPixel(patchCorners)) |
Definition at line 1135 of file getTemplate.py.
| lsst.ip.diffim.getTemplate.patchWcs = skymap[dataId["tract"]].getWcs() |
Definition at line 1132 of file getTemplate.py.
| lsst.ip.diffim.getTemplate.raiseOnUndefinedMaskMap |
Definition at line 213 of file getTemplate.py.
| lsst.ip.diffim.getTemplate.subfilter = dataId["subfilter"] |
Definition at line 1131 of file getTemplate.py.