make_injection_pipeline#
- lsst.source.injection.make_injection_pipeline(dataset_type_name: str, reference_pipeline: Pipeline | str, injection_pipeline: Pipeline | str | None = None, update_subsets: bool = True, excluded_tasks: set[str] | str = {'fgcmBuildFromIsolatedStars', 'fgcmFitCycle', 'fgcmOutputProducts', 'gbdesAstrometricFit', 'jointcal'}, prefix: str = 'injected_', instrument: str | None = None, config: str | list[str] | None = None, additional_pipelines: list[Pipeline] | list[str] | None = None, additional_subset: list[str] | str | None = None, log_level: int = 20) Pipeline#
Make an expanded source injection pipeline.
This function takes a reference pipeline definition file and prefixes all immediately post-injection dataset type names with the injected prefix. If an optional injection pipeline definition YAML file is also provided, the injection task will be merged into the pipeline.
Unless subset updates are explicitly disabled, all subsets from the reference pipeline containing the task which generates the injection dataset type will also be updated to include the injection task.
When the injection pipeline is constructed, a check on all existing pipeline contracts is performed. If any contracts are violated, they’re removed from the pipeline. A warning is logged for each contract that is removed.
Parameters#
- dataset_type_name
str Name of the dataset type being injected into.
- reference_pipelinePipeline |
str Location of a reference pipeline definition YAML file.
- injection_pipelinePipeline |
str, optional Location of an injection pipeline definition YAML file stub. If not provided, an attempt to infer the injection pipeline will be made based on the injected dataset type name.
- update_subsets
bool, optional If True, update pipeline subsets to include the injection task.
- excluded_tasks
set[str] |str Set of task labels to exclude, or a comma-separated string of labels.
- prefix
str, optional Prefix to prepend to each affected post-injection dataset type name.
- instrument
str, optional Add instrument overrides. Must be a fully qualified class name.
- config
str|list[str], optional Config override for a task, in the format ‘label:key=value’.
- additional_pipelines:
list`[Pipeline] | `list`[`str], optional Additional pipelines to merge into the output pipeline, or their YAML file locations. Tasks from these additional pipelines will be added to the output injection pipeline.
- additional_subset:
list`[`str] |str, optional A list of subset definitions in the form “subset_name[:subset_description]”. These subsets will be created if they don’t already exist. All tasks from additional_pipelines will be added to these subsets.
- log_level
int, optional The log level to use for logging.
Returns#
- pipeline
lsst.pipe.base.Pipeline An expanded source injection pipeline.
- dataset_type_name