HighResolutionHipsQuantumGraphBuilder¶
- class lsst.pipe.tasks.hips.HighResolutionHipsQuantumGraphBuilder(pipeline_graph, butler, *, input_collections=None, output_run=None, constraint_order, constraint_ranges, where='')¶
Bases:
QuantumGraphBuilderA custom a
lsst.pipe.base.QuantumGraphBuilderfor runningHighResolutionHipsTaskonly.This is a workaround for incomplete butler query support for HEALPix dimensions.
- Parameters:
- pipeline_graph
lsst.pipe.base.PipelineGraph Pipeline graph with exactly one task, which must be a configuration of
HighResolutionHipsTask.- butler
lsst.daf.butler.Butler Client for the butler data repository. May be read-only.
- input_collections
strorIterable[str], optional Collection or collections to search for input datasets, in order. If not provided,
butler.collectionswill be searched.- output_run
str, optional Name of the output collection. If not provided,
butler.runwill be used.- constraint_order
int HEALPix order used to constrain which quanta are generated, via
constraint_indices. This should be a coarser grid (smaller order) than the order used for the task’s quantum and output data IDs, and ideally something between the spatial scale of a patch or the data repository’s “common skypix” system (usuallyhtm7).- constraint_ranges
lsst.sphgeom.RangeSet RangeSet that describes constraint pixels (HEALPix NEST, with order
constraint_order) to constrain generated quanta.- where
str, optional A boolean
strexpression of the form accepted bylsst.daf.butler.Butlerto constrain input datasets. This may contain a constraint on tracts, patches, or bands, but not HEALPix indices. Constraints on tracts and patches should usually be unnecessary, however - existing coadds that overlap the given HEALpix indices will be selected without such a constraint, and providing one may reject some that should normally be included.
- pipeline_graph
Attributes Summary
Definitions of all data dimensions.
Methods Summary
build([metadata, attach_datastore_records])Build the quantum graph, returning an old
QuantumGraphinstance.finish([output, metadata, ...])Return quantum graph components that can be used to save or construct a
PredictedQuantumGraphinstance.process_subgraph(subgraph)Build the rough structure for an independent subset of the
QuantumGraphand query for relevant existing datasets.Attributes Documentation
- universe¶
Definitions of all data dimensions.
Methods Documentation
- build(metadata: Mapping[str, Any] | None = None, attach_datastore_records: bool = True) QuantumGraph¶
Build the quantum graph, returning an old
QuantumGraphinstance.- Parameters:
- metadata
Mapping, optional Flexible metadata to add to the quantum graph.
- attach_datastore_records
bool, optional Whether to include datastore records in the graph. Required for
lsst.daf.butler.QuantumBackedButlerexecution.
- metadata
- Returns:
- quantum_graph
QuantumGraph DAG describing processing to be performed.
- quantum_graph
Notes
External code is expected to construct a
QuantumGraphBuilderand then call this method exactly once. See class documentation for details on what it does.
- finish(output: str | None = None, metadata: Mapping[str, Any] | None = None, attach_datastore_records: bool = True) PredictedQuantumGraphComponents¶
Return quantum graph components that can be used to save or construct a
PredictedQuantumGraphinstance.- Parameters:
- output
strorNone, optional Output
CHAINEDcollection that combines the input and output collections.- metadata
Mapping, optional Mapping of JSON-friendly metadata. Collection information, the current user, and the current timestamp are automatically included.
- attach_datastore_records
bool, optional Whether to include datastore records for overall inputs for
QuantumBackedButler.
- output
- Returns:
- components
quantum_graph.PredictedQuantumGraphComponents Components that can be used to construct a graph object and/or save it to disk.
- components
- process_subgraph(subgraph)¶
Build the rough structure for an independent subset of the
QuantumGraphand query for relevant existing datasets.- Parameters:
- subgraph
pipeline_graph.PipelineGraph Subset of the pipeline graph that should be processed by this call. This is always resolved and topologically sorted. It should not be modified.
- subgraph
- Returns:
- skeleton
quantum_graph_skeleton.QuantumGraphSkeleton Class representing an initial quantum graph. See
quantum_graph_skeleton.QuantumGraphSkeletondocs for details. After this is returned, the object may be modified in-place in unspecified ways.
- skeleton
Notes
The
quantum_graph_skeleton.QuantumGraphSkeletonshould associatelsst.daf.butler.DatasetRefobjects with nodes for existing datasets. In particular:quantum_graph_skeleton.QuantumGraphSkeleton.set_dataset_refmust be used to associate existing datasets with all overall-input dataset nodes in the skeleton by queryinginput_collections. This includes all standard input nodes and any prerequisite nodes added by the method (prerequisite nodes may also be left out entirely, as the base class can add them later, albeit possibly less efficiently).quantum_graph_skeleton.QuantumGraphSkeleton.set_output_for_skipmust be used to associate existing datasets with output dataset nodes by queryingskip_existing_in.quantum_graph_skeleton.QuantumGraphSkeleton.add_output_in_the_waymust be used to associated existing outputs with output dataset nodes by queryingoutput_runifoutput_run_existsisTrue. Note that the presence of such datasets is not automatically an error, even ifclobberisFalse, as these may be quanta that will be skipped.
lsst.daf.butler.DatasetRefobjects for existing datasets with empty data IDs in all of the above categories may be found in theempty_dimensions_datasetsattribute, as these are queried for prior to this call by the base class, but associating them with graph nodes is still this method’s responsibility.Dataset types should never be components and should always use the “common” storage class definition in
pipeline_graph.DatasetTypeNode(which is the data repository definition when the dataset type is registered).