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: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.
Attributes Summary
Methods Summary
Compute the median variance across the good pixels of a MaskedImage.
Empty (clear) the metadata for this Task and all sub-Tasks.
Get metadata for all tasks.
Get the task name as a hierarchical name including parent task names.
getName
()Get the name of the task.
Get a dictionary of all tasks as a shallow copy.
get_seed_from_data_id
(data_id)Get a seed value given a data_id.
makeField
(doc)Make a
lsst.pex.config.ConfigurableField
for this task.makeSubtask
(name, **keyArgs)Create a subtask as a new instance as the
name
attribute of this task.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.timer
(name[, logLevel])Context manager to log performance data for an arbitrary block of code.
Attributes Documentation
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.
- mi
- Returns:
- median_variance
float
Median variance of the input calexp.
- median_variance
- getFullMetadata() TaskMetadata ¶
Get metadata for all tasks.
- Returns:
- metadata
TaskMetadata
The keys are the full task name. Values are metadata for the top-level task and all subtasks, sub-subtasks, etc.
- metadata
Notes
The returned metadata includes timing information (if
@timer.timeMethod
is used) and any metadata set by the task. The name of each item consists of the full task name with.
replaced by:
, followed by.
and the name of the item, e.g.:topLevelTaskName:subtaskName:subsubtaskName.itemName
using
:
in the full task name disambiguates the rare situation that a task has a subtask and a metadata item with the same name.
- getFullName() str ¶
Get the task name as a hierarchical name including parent task names.
- Returns:
- fullName
str
The full name consists of the name of the parent task and each subtask separated by periods. For example:
The full name of top-level task “top” is simply “top”.
The full name of subtask “sub” of top-level task “top” is “top.sub”.
The full name of subtask “sub2” of subtask “sub” of top-level task “top” is “top.sub.sub2”.
- fullName
- getName() str ¶
Get the name of the task.
- Returns:
- taskName
str
Name of the task.
- taskName
See also
getFullName
Get the full name of the task.
- getTaskDict() dict[str, weakref.ReferenceType[lsst.pipe.base.task.Task]] ¶
Get a dictionary of all tasks as a shallow copy.
- Returns:
- taskDict
dict
Dictionary containing full task name: task object for the top-level task and all subtasks, sub-subtasks, etc.
- taskDict
- 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_id
DataCoordinate
Data identifier dictionary.
- data_id
- Returns:
- seed
int
A unique seed for this data_id to seed a random number generator.
- seed
- classmethod makeField(doc: str) ConfigurableField ¶
Make a
lsst.pex.config.ConfigurableField
for this task.- Parameters:
- doc
str
Help text for the field.
- doc
- Returns:
- configurableField
lsst.pex.config.ConfigurableField
A
ConfigurableField
for this task.
- configurableField
Examples
Provides a convenient way to specify this task is a subtask of another task.
Here is an example of use:
class OtherTaskConfig(lsst.pex.config.Config): aSubtask = ATaskClass.makeField("brief description of task")
- makeSubtask(name: str, **keyArgs: Any) None ¶
Create a subtask as a new instance as the
name
attribute of this task.- Parameters:
- name
str
Brief name of the subtask.
- **keyArgs
Extra keyword arguments used to construct the task. The following arguments are automatically provided and cannot be overridden:
config
.parentTask
.
- name
Notes
The subtask must be defined by
Task.config.name
, an instance ofConfigurableField
orRegistryField
.
- make_noise_exposures(calexp: ExposureF, rng) dict[int, lsst.afw.image._exposure.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.
- calexp
- Returns:
- 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.
- detector_inputs
- Returns:
- warped_exposure
Exposure
| None The processed and warped exposure, if all the calibrations could be applied successfully. Otherwise, None.
- warped_exposure
- 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.
- inputs
- Returns:
- results
Struct
A Struct object containing the warped exposure, noise exposure(s), and masked fraction image.
- results
- runQuantum(butlerQC, inputRefs, outputRefs)¶
Do butler IO and transform to provide in memory objects for tasks
run
method.- 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
PipelineTaskConnections
class. The values of these attributes are thelsst.daf.butler.DatasetRef
objects associated with the defined input/prerequisite connections.- outputRefs
OutputQuantizedConnection
Datastructure whose attribute names are the names that identify connections defined in corresponding
PipelineTaskConnections
class. The values of these attributes are thelsst.daf.butler.DatasetRef
objects associated with the defined output connections.
- butlerQC