MakeDirectWarpTask#

class lsst.drp.tasks.make_direct_warp.MakeDirectWarpTask(**kwargs)#

Bases: PipelineTask

Warp 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 MakeWarp Task in the following ways:

  1. No selection on ccds at the time of warping. This is done later during the coaddition stage.

  2. Interpolate over a set of masked pixels before warping.

  3. Generate an image where each pixel denotes how much of the pixel is masked.

  4. Generate multiple noise warps with the same interpolation applied.

  5. No option to produce a PSF-matched warp.

Methods Summary

compute_median_variance(mi)

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 run method.

Methods Documentation

static compute_median_variance(mi: MaskedImage) float#

Compute the median variance across the good pixels of a MaskedImage.

Parameters#

miMaskedImage

The input image on which to compute the median variance.

Returns#

median_variancefloat

Median variance of the input calexp.

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_id instance, or override this method with a different one to obtain a seed value consistent with the pipeline task.

Parameters#

data_idDataCoordinate

Data identifier dictionary.

Returns#

seedint

A unique seed for this data_id to seed a random number generator.

make_noise_exposures(calexp: ExposureF, rng) dict[int, ExposureF]#

Make pure noise realizations based on calexp.

Parameters#

calexpExposureF

The input exposure on which to base the noise realizations.

rngnp.random.RandomState

Random number generator to use for the noise realizations.

Returns#

noise_calexpsdict [int, ExposureF]

A mapping of integers ranging from 0 up to config.numberOfNoiseRealizations to the corresponding noise realization exposures.

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:

  1. Interpolate over bad pixels before warping.

  2. Apply all calibrations from visit_summary to the exposure.

  3. Warp the exposure to the target coordinate system.

Parameters#

detector_inputsWarpDetectorInputs

The input exposure to be processed, along with any other per-detector modifications.

target_wcsSkyWcs

The WCS of the target patch.

warperWarper

The warper to use for warping the input exposure.

visit_summaryExposureCatalog | 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.

maxBBoxBox2I | None

Maximum bounding box of the warped exposure. If None, this is determined automatically.

destBBoxBox2I | None

Exact bounding box of the warped exposure. If None, this is determined automatically.

Returns#

warped_exposureExposure | 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#

inputsMapping [ int, WarpDetectorInputs ]

Dictionary of input datasets, with the detector id being the key.

sky_infoStruct

A Struct object containing wcs, bounding box, and other information about the patches within the tract.

visit_summaryExposureCatalog | 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#

resultsStruct

A Struct object containing the warped exposure, noise exposure(s), and masked fraction image.

runQuantum(butlerQC, inputRefs, outputRefs)#

Do butler IO and transform to provide in memory objects for tasks run method.

Parameters#

butlerQCQuantumContext

A butler which is specialized to operate in the context of a lsst.daf.butler.Quantum.

inputRefsInputQuantizedConnection

Datastructure whose attribute names are the names that identify connections defined in corresponding PipelineTaskConnections class. The values of these attributes are the lsst.daf.butler.DatasetRef objects associated with the defined input/prerequisite connections.

outputRefsOutputQuantizedConnection

Datastructure whose attribute names are the names that identify connections defined in corresponding PipelineTaskConnections class. The values of these attributes are the lsst.daf.butler.DatasetRef objects associated with the defined output connections.