The Operation class¶
The Operation class is used to define, set up, and run a operation’s pipeline. A subclass of the Operation class is defined for each operation. See Subclasses of the Operation class for details of each Operation subclass.
- class rapthor.lib.operation.Operation(field, name=None, index=None)¶
Generic operation class
An operation is simply a CWL pipeline that performs a part of the processing. It holds the pipeline settings, populates the pipeline input and parset templates, and runs the pipeline. The field object is passed between operations, each of which updates it with variables needed by other, subsequent, operations.
- Parameters:
- fieldField object
Field for this operation
- namestr, optional
Name of the operation
- indexint, optional
Index of the operation
- finalize()¶
Finalize this operation.
Create a “done” file to indicate that this operations is done. Specializations should be defined in the subclasses as needed.
- is_done()¶
Check if this operation is done, by checking if a “done” file exists.
- run()¶
Runs the operation
- set_input_parameters()¶
Define parameters needed for the pipeline inputs
The dictionary keys must match the workflow inputs defined in the corresponding pipeline parset.
The entries are defined in the subclasses as needed
- set_parset_parameters()¶
Define parameters needed for the pipeline parset template
The dictionary keys must match the jinja template variables used in the corresponding pipeline parset.
The entries are defined in the subclasses as needed
- setup()¶
Set up this operation
This involves filling the pipeline parset template and writing the inputs file
Subclasses of the Operation class¶
A subclass of the Operation class is defined for each of Rapthor’s operations (see Operations): calibrate, predict, image, and mosaic. These subclasses are described in detail below.
The Calibrate class¶
- class rapthor.operations.calibrate.Calibrate(field, index)¶
Operation to calibrate the field
- finalize()¶
Finalize this operation
- get_baselines_core()¶
Returns DPPP string of baseline selection for core calibration
- Returns:
- baselinesstr
Baseline selection string
- get_core_stations(include_nearest_remote=True)¶
Returns list of station names for core calibration
- Parameters:
- include_nearest_remotebool, optional
If True, include the remote stations nearest to the core
- Returns:
- stationslist
Station names
- get_superterp_stations()¶
Returns list of superterp station names
- Returns:
- stationslist
Station names
- set_input_parameters()¶
Define the pipeline inputs
- set_parset_parameters()¶
Define parameters needed for the pipeline parset template