MakeDirectWarpTask#
- class lsst.drp.tasks.make_direct_warp.MakeDirectWarpTask(**kwargs)#
Bases:
PipelineTaskWarp single-detector images onto a common projection.
This task iterates over multiple images (corresponding to different detectors) from a single visit that overlap the target patch. Pixels that receive no input from any detector are set to NaN in the output image, and NO_DATA bit is set in the mask plane.
This differs from the standard
MakeWarpTask in the following ways:No selection on ccds at the time of warping. This is done later during the coaddition stage.
Interpolate over a set of masked pixels before warping.
Generate an image where each pixel denotes how much of the pixel is masked.
Generate multiple noise warps with the same interpolation applied.
No option to produce a PSF-matched warp.
Methods Summary
Compute the median variance across the good pixels of a MaskedImage.
get_seed_from_data_id(data_id)Get a seed value given a data_id.
make_noise_exposures(calexp, rng)Make pure noise realizations based on
calexp.process(detector_inputs, target_wcs, warper)Process an exposure.
run(inputs, sky_info, visit_summary)Create a Warp dataset from inputs.
runQuantum(butlerQC, inputRefs, outputRefs)Do butler IO and transform to provide in memory objects for tasks
runmethod.Methods Documentation
- static compute_median_variance(mi: MaskedImage) float#
Compute the median variance across the good pixels of a MaskedImage.
Parameters#
- mi
MaskedImage The input image on which to compute the median variance.
Returns#
- median_variance
float Median variance of the input calexp.
- mi
- get_seed_from_data_id(data_id) int#
Get a seed value given a data_id.
This method generates a unique, reproducible pseudo-random number for a data id. This is not affected by ordering of the input, or what set of visits, ccds etc. are given.
This is implemented as a public method, so that simulations that don’t necessary deal with the middleware can mock up a
data_idinstance, or override this method with a different one to obtain a seed value consistent with the pipeline task.Parameters#
- data_id
DataCoordinate Data identifier dictionary.
Returns#
- seed
int A unique seed for this data_id to seed a random number generator.
- data_id
- make_noise_exposures(calexp: ExposureF, rng) dict[int, ExposureF]#
Make pure noise realizations based on
calexp.Parameters#
- calexp
ExposureF The input exposure on which to base the noise realizations.
- rng
np.random.RandomState Random number generator to use for the noise realizations.
Returns#
- noise_calexps
dict[int,ExposureF] A mapping of integers ranging from 0 up to config.numberOfNoiseRealizations to the corresponding noise realization exposures.
- calexp
- process(detector_inputs: WarpDetectorInputs, target_wcs, warper, visit_summary=None, maxBBox=None, destBBox=None) ExposureF | None#
Process an exposure.
There are three processing steps that are applied to the input:
Interpolate over bad pixels before warping.
Apply all calibrations from visit_summary to the exposure.
Warp the exposure to the target coordinate system.
Parameters#
- detector_inputs
WarpDetectorInputs The input exposure to be processed, along with any other per-detector modifications.
- target_wcs
SkyWcs The WCS of the target patch.
- warper
Warper The warper to use for warping the input exposure.
- visit_summary
ExposureCatalog| None Table of visit summary information. If not None, the visit_summary information will be used to update the calibration of the input exposures. Otherwise, the input exposures will be used as-is.
- maxBBox
Box2I| None Maximum bounding box of the warped exposure. If None, this is determined automatically.
- destBBox
Box2I| None Exact bounding box of the warped exposure. If None, this is determined automatically.
Returns#
- warped_exposure
Exposure| None The processed and warped exposure, if all the calibrations could be applied successfully. Otherwise, None.
- run(inputs: Mapping[int, WarpDetectorInputs], sky_info, visit_summary) Struct#
Create a Warp dataset from inputs.
Parameters#
- inputs
Mapping[int,WarpDetectorInputs] Dictionary of input datasets, with the detector id being the key.
- sky_info
Struct A Struct object containing wcs, bounding box, and other information about the patches within the tract.
- visit_summary
ExposureCatalog| None Table of visit summary information. If provided, the visit summary information will be used to update the calibration of the input exposures. If None, the input exposures will be used as-is.
Returns#
- results
Struct A Struct object containing the warped exposure, noise exposure(s), and masked fraction image.
- inputs
- runQuantum(butlerQC, inputRefs, outputRefs)#
Do butler IO and transform to provide in memory objects for tasks
runmethod.Parameters#
- butlerQC
QuantumContext A butler which is specialized to operate in the context of a
lsst.daf.butler.Quantum.- inputRefs
InputQuantizedConnection Datastructure whose attribute names are the names that identify connections defined in corresponding
PipelineTaskConnectionsclass. The values of these attributes are thelsst.daf.butler.DatasetRefobjects associated with the defined input/prerequisite connections.- outputRefs
OutputQuantizedConnection Datastructure whose attribute names are the names that identify connections defined in corresponding
PipelineTaskConnectionsclass. The values of these attributes are thelsst.daf.butler.DatasetRefobjects associated with the defined output connections.
- butlerQC