MakeDirectWarpTask¶
- class lsst.pipe.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 - 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. 
 - 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.ConfigurableFieldfor this task.- makeSubtask(name, **keyArgs)- Create a subtask as a new instance as the - nameattribute of this task.- make_noise_exposures(calexp, rng)- Make pure noise realizations based on - calexp.- process(exposure, target_wcs, warper[, ...])- Process an exposure. - run(inputs, sky_info, **kwargs)- Create a Warp dataset from inputs. - runQuantum(butlerQC, inputRefs, outputRefs)- Do butler IO and transform to provide in memory objects for tasks - runmethod.- 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:
- miMaskedImage
- The input image on which to compute the median variance. 
 
- mi
- Returns:
- median_variancefloat
- Median variance of the input calexp. 
 
- median_variance
 
 - getFullMetadata() TaskMetadata¶
- Get metadata for all tasks. - Returns:
- metadataTaskMetadata
- 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.timeMethodis 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:
- fullNamestr
- 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:
- taskNamestr
- 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:
- taskDictdict
- 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_idinstance, or override this method with a different one to obtain a seed value consistent with the pipeline task.- Parameters:
- data_idDataCoordinate
- Data identifier dictionary. 
 
- data_id
- Returns:
- seedint
- A unique seed for this data_id to seed a random number generator. 
 
- seed
 
 - classmethod makeField(doc: str) ConfigurableField¶
- Make a - lsst.pex.config.ConfigurableFieldfor this task.- Parameters:
- docstr
- Help text for the field. 
 
- doc
- Returns:
- configurableFieldlsst.pex.config.ConfigurableField
- A - ConfigurableFieldfor 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 - nameattribute of this task.- Parameters:
- namestr
- 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 of- ConfigurableFieldor- RegistryField.
 - make_noise_exposures(calexp: ExposureF, rng) dict[int, lsst.afw.image._exposure.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. 
 
- calexp
- Returns:
 
 - process(exposure, target_wcs, warper, old_background=None, new_background=None, visit_summary=None, maxBBox=None, destBBox=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:
- exposureExposure
- The input exposure to be processed. 
- target_wcsSkyWcs
- The WCS of the target patch. 
- warperWarper
- The warper to use for warping the input exposure. 
- old_backgroundBackground| None
- The old background to be added back into the calexp. 
- new_backgroundBackground| None
- The new background to be subtracted from the calexp. 
- 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. 
 
- exposure
- Returns:
- warped_exposureExposure
- The processed and warped exposure. 
 
- warped_exposure
 
 - run(inputs, sky_info, **kwargs)¶
- Create a Warp dataset from inputs. - Parameters:
- inputsMapping
- Dictionary of input datasets. It must have a list of input calexps under the key “calexp_list”. Other supported keys are “background_revert_list” and “background_apply_list”, corresponding to the old and the new backgrounds to be reverted and applied to the calexps. They must be in the same order as the calexps. 
- 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. 
 
- inputs
- Returns:
- resultsStruct
- 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 - runmethod.- 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 - PipelineTaskConnectionsclass. The values of these attributes are the- lsst.daf.butler.DatasetRefobjects associated with the defined input/prerequisite connections.
- outputRefsOutputQuantizedConnection
- Datastructure whose attribute names are the names that identify connections defined in corresponding - PipelineTaskConnectionsclass. The values of these attributes are the- lsst.daf.butler.DatasetRefobjects associated with the defined output connections.
 
- butlerQC