Pipeline

class nips.pipelines.Pipeline(logger_id=None)[source]

Bases: nrspylib.utils.logging_template.LoggingTemplate

———- MAIN PIPELINE CLASS ———-

This is the main pipeline class. It taked the PipelineParameters as an input and is responsible for collecting reference files and running the steps for each aperture/target given.

logger

Logger instance. (Inherited)

Type

logging.Logger or None

cts1

Instance of the count rate map class for SCA1.

Type

CountRateMap

cts2

Instance of the count rate map class for SCA2.

Type

CountRateMap

datainput

Instance of one of the dataclasses. (Output of previous step and input for next step)

Type

I2D/R2D

esetup

Instance of the exposure setup class. To set folders and file structure on exposure level.

Type

ExposureSetup

msetup

Instance of the master setup class. To set folders and file structure on master pipeline level.

Type

MasterSetup

ps

Instance of the pipeline parameters class. (I know it is a bit short for PEP8 but it makes the code loop less polluted)

Type

PipelineParameters

target

Instance of the Target class. Defines Target of this pipeline run.

Type

Target

tid

Target ID.

Type

int

tsetup

Instance of the target setup class. To set folders and file structure on target level.

Type

TargetSetup

Methods Summary

m_find_reffiles()

Method to find all the reference files.

m_get_file_name(slitid, stepname)

param slitid

m_load_cts()

Method to load the count rate maps in the pipeline

m_load_input(stepname, format)

Method to load input file

m_process_exposure()

Main method to process an exposure

m_run_autc()

Method to run the awcs step

m_run_awcs()

Method to run the awcs step

m_run_pxbg()

Method to run the awcs step

m_set(parameters_inst)

Method to set the Pipeline Instance

m_write_output(slitid, stepname)

Method to write output file for a single slitid

m_write_output_all(stepname)

Method to write out the entire data currently stored in the pipeline

Methods Documentation

m_find_reffiles()[source]

Method to find all the reference files.

This is a wrapper for f_find_ref_files() to find all reference files for all steps and apertures.

m_get_file_name(slitid, stepname)[source]
Parameters
  • slitid

  • stepname

m_load_cts()[source]

Method to load the count rate maps in the pipeline

This methods loads the count rate maps from the archive and saves them as self.cts1 and self.cts2. It also saves those maps in the master directory.

m_load_input(stepname, format)[source]

Method to load input file

Method to load input file from a fits file from the appropriate folder. This method tries to read in all the targets currently stored in the pipeline. For IFS mode it reads all 30 slices.

Parameters
  • stepname (str) – Name of the step in capital letters. (i.e. AWCS, RECT, DFLT,..). Note, this can also be an arbitary name if this was saved with the m_write_output_all(NAME)

  • format (str) – Data format in captial letters. (i.e. R2D, I2D,..)

m_process_exposure()[source]

Main method to process an exposure

This method runs the pipeline. It either runs the awcs step by calling the appropriate method, or loads the data products with the awcs present into the pipeline. It loops through all apertures/ targets and all steps and applied them. In order to save time the routine first checks if one reference file can be used for more than one target and if that is the case it does not load it again. The process is a little bit different for the IFS.

m_run_autc()[source]

Method to run the awcs step

Since the AUTC step is a bit out of the ordinary compared to the other steps, we are running it sepatately here. In this method the count rate map instances are initiated and loaded from the file. They are later saved in the exposure folder.

m_run_awcs()[source]

Method to run the awcs step

Since the AWCS step is a bit out of the ordinary compared to the other steps, we are running it sepatately here. In this method the count rate map instances are initiated and loaded from the file. They are later saved in the exposure folder.

m_run_pxbg()[source]

Method to run the awcs step

Since the PXBG step is a bit out of the ordinary compared to the other steps, we are running it sepatately here. In this method the count rate map instances are initiated and loaded from the file. They are later saved in the exposure folder.

m_set(parameters_inst)[source]

Method to set the Pipeline Instance

This method takes the previously initialted pipeline parameters instance as an input and then sets up the various instances of master_setup, exspure_setup, target_setup and the target instance.

Parameters

parameters (PipelineParameters) – Instance of the pipeline parameters class. Has to be initiated!

m_write_output(slitid, stepname)[source]

Method to write output file for a single slitid

Method to write output file as a fits file in the appropriate folder for a single slitid. For writing the entire data out into a file, please refer to m_write_output_all. If the attribute display is set to true it also saves the pdf.

Parameters
  • outputfile (str) – Path and name of the output file. (Usually the Target path/name)

  • step (Step) – Instance of the step class.

m_write_output_all(stepname)[source]

Method to write out the entire data currently stored in the pipeline

Method to write out the entire data currently stored in the pipeline. If the attribute display is set to true it also saves the pdf.

Parameters

stepname (str) – Name of the step in capital letters. (i.e. AWCS, RECT, DFLT,..). Note, this can also be an arbitary name.