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, index=None, name=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

indexint, optional

Index of the operation

namestr, optional

Name 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.

The CalibrateDD class

class rapthor.operations.calibrate.CalibrateDD(field, index)

Operation to perform direction-dependent (DD) calibration of 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_model_image_parameters()

Returns parameters needed for image-based predict

Returns:
frequency_bandwidth[float, float]

Central frequency and bandwidth as [frequency, bandwidth] of model image in Hz

center_coords[str, str]

Center of the image as [HHMMSS.S, DDMMSS.S] strings

size[int, int]

Size of image as [RA, Dec] in pixels

cellsizefloat

Size of image cell (pixel) in degrees/pixel

get_superterp_stations()

Returns list of superterp station names

Returns:
stationslist

Station names

set_input_parameters()

Define the CWL workflow inputs

set_parset_parameters()

Define parameters needed for the CWL workflow template

The CalibrateDI class

class rapthor.operations.calibrate.CalibrateDI(field, index)

Operation to perform direction-independent (DI) calibration of the field

finalize()

Finalize this operation

set_input_parameters()

Define the CWL workflow inputs

set_parset_parameters()

Define parameters needed for the CWL workflow template

The PredictDD class

class rapthor.operations.predict.PredictDD(field, index)

Operation to predict model data for further direction-dependent (DD) processing

finalize()

Finalize this operation

set_input_parameters()

Define the CWL workflow inputs

set_parset_parameters()

Define parameters needed for the CWL workflow template

The PredictNC class

class rapthor.operations.predict.PredictNC(field, index)

Operation to predict model data for non-calibrator sources

finalize()

Finalize this operation

set_input_parameters()

Define the CWL workflow inputs

set_parset_parameters()

Define parameters needed for the CWL workflow template

The PredictDI class

class rapthor.operations.predict.PredictDI(field, index)

Operation to predict model data for direction-independent calibration

finalize()

Finalize this operation

set_input_parameters()

Define the CWL workflow inputs

set_parset_parameters()

Define parameters needed for the CWL workflow template

The Image class

class rapthor.operations.image.Image(field, index, name='image')

Operation to image a field sector

finalize()

Finalize this operation

set_input_parameters()

Define the CWL workflow inputs

set_parset_parameters()

Define parameters needed for the CWL workflow template

The ImageInitial class

class rapthor.operations.image.ImageInitial(field)

Operation to image the field to generate an initial sky model

finalize()

Finalize this operation

set_input_parameters()

Define the CWL workflow inputs

set_parset_parameters()

Define parameters needed for the CWL workflow template

The Mosaic class

class rapthor.operations.mosaic.Mosaic(field, index)

Operation to mosaic sector images

finalize()

Finalize this operation

set_input_parameters()

Define the CWL workflow inputs

set_parset_parameters()

Define parameters needed for the CWL workflow template