Pipeline

class jwst.stpipe.Pipeline(*args, **kwargs)[source]

Bases: jwst.stpipe.Step

A Pipeline is a way of combining a number of steps together.

See Step.__init__ for the parameters.

Attributes Summary

reference_file_types

Collect the list of all reftypes for child Steps that are not skipped.

spec

step_defs

Methods Summary

get_config_from_reference(dataset[, …])

Retrieve step parameters from reference database

get_pars()

Retrieve the configuration parameters of a pipeline

get_ref_override(reference_file_type)

Return any override for reference_file_type for any of the steps in Pipeline self.

load_spec_file([preserve_comments])

merge_config(config, config_file)

merge_pipeline_config(refcfg, ref_file)

Merge the config parameters from a pipeline config reference file into the config obtained from each step

set_input_filename(path)

Attributes Documentation

reference_file_types

Collect the list of all reftypes for child Steps that are not skipped. Overridden reftypes are included but handled normally later by the Pipeline version of the get_ref_override() method defined below.

spec = '\n '
step_defs = {}

Methods Documentation

classmethod get_config_from_reference(dataset, observatory=None, disable=None)[source]

Retrieve step parameters from reference database

Parameters
  • cls (jwst.stpipe.Step) – Either a class or instance of a class derived from Step.

  • dataset (jwst.datamodels.ModelBase) – A model of the input file. Metadata on this input file will be used by the CRDS “bestref” algorithm to obtain a reference file.

  • observatory (str) – telescope name used with CRDS, e.g. ‘jwst’.

  • disable (bool or None) – Do not retrieve parameters from CRDS. If None, check global settings.

Returns

step_parameters – The parameters as retrieved from CRDS. If there is an issue, log as such and return an empty config obj.

Return type

configobj

get_pars()

Retrieve the configuration parameters of a pipeline

The pipeline, and all referenced substeps, parameters are retrieved.

Parameters
  • step (Pipeline-derived class or instance) –

  • full_spec (bool) – Return all parameters, including parent-specified parameters. If False, return only parameters specific to the class/instance.

Returns

pars – Keys are the parameters and values are the values.

Return type

dict

get_ref_override(reference_file_type)[source]

Return any override for reference_file_type for any of the steps in Pipeline self. OVERRIDES Step.

Returns

Return type

override_filepath or None.

classmethod load_spec_file(preserve_comments=False)[source]
classmethod merge_config(config, config_file)[source]
classmethod merge_pipeline_config(refcfg, ref_file)[source]

Merge the config parameters from a pipeline config reference file into the config obtained from each step

Parameters
  • cls (jwst.stpipe.pipeline.Pipeline class) – The pipeline class

  • refcfg (ConfigObj object) – The ConfigObj created from crds cfg files from each of the steps in the pipeline

  • ref_file (string) – The name of the pipeline crds step config file

Returns

  • ConfigObj of the merged parameters, with those from the pipeline cfg having

  • precedence over those from the individual steps

set_input_filename(path)[source]