The Operation class¶
The Operation class is used to define, set up, and run a operation’s CWL workflow. 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 workflow that performs a part of the processing. It holds the workflow settings, populates the workflow input and parset templates, and runs the workflow. 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 CWL workflow inputs
The dictionary keys must match the workflow inputs defined in the corresponding workflow parset.
The entries are defined in the subclasses as needed
- set_parset_parameters()¶
Define parameters needed for the CWL workflow template
The dictionary keys must match the jinja template variables used in the corresponding workflow parset.
The entries are defined in the subclasses as needed
- setup()¶
Set up this operation
This involves filling the workflow 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.