Station calibrator subpackage

This subpackage implements station calibrator functionality for MCCS.

class MccsStationCalibrator(*args, **kwargs)

An implementation of a station calibrator Tango device for MCCS.

GetCalibration(argin)

Get a calibration from the calibration store.

Parameters:

argin (str) – json-dictionary of field conditions.

Return type:

list[float]

Returns:

a calibration from the calibration store.

class GetCalibrationCommand(component_manager, logger=None)

Class for handling the GetCalibration() command.

This command takes as input a JSON string that conforms to the following schema:

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://skao.int/MccsStationCalibrator_GetCalibration.json",
    "title": "MccsStationCalibrator GetCalibration schema",
    "description": "Schema for MccsStationCalibrator's GetCalibration command",
    "type": "object",
    "properties": {
        "frequency_channel": {
            "description": "Freqency channel to calibrate for",
            "type": "integer",
            "minimum": 0,
            "maximum": 511
        }
    },
    "required": ["frequency_channel"]
}
__init__(component_manager, logger=None)

Initialise a new instance.

Parameters:
do(*args, **kwargs)

Implement MccsStationCalibrator.GetCalibration() command.

Parameters:
  • args (Any) – Positional arguments. This should be empty and is provided for type hinting purposes only.

  • kwargs (Any) – keyword arguments unpacked from the JSON argument to the command.

Return type:

list[float]

Returns:

a calibration from the calibration store.

class InitCommand(*args, **kwargs)

A class for MccsStationCalibrator’s Init command.

The do() method below is called upon MccsStationCalibrator’s initialisation.

do(*args, **kwargs)

Initialise the attributes and properties of the MccsStationCalibrator.

Parameters:
  • args (Any) – positional args to the component manager method

  • kwargs (Any) – keyword args to the component manager method

Return type:

tuple[ResultCode, str]

Returns:

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

__init__(*args, **kwargs)

Initialise this device object.

Parameters:
  • args (Any) – positional args to the init

  • kwargs (Any) – keyword args to the init

create_component_manager()

Create and return a component manager for this device.

Return type:

StationCalibratorComponentManager

Returns:

a component manager for this device.

init_command_objects()

Initialise the command handlers for this device.

Return type:

None

class StationCalibratorComponentManager(logger, station_name, calibration_store_name, communication_state_callback, component_state_callback)

A component manager for a station calibrator.

__init__(logger, station_name, calibration_store_name, communication_state_callback, component_state_callback)

Initialise a new instance.

Parameters:
  • logger (Logger) – the logger to be used by this object.

  • station_name (str) – the name of this calibrator’s station

  • calibration_store_name (str) – the name of this calibrator’s calibration store

  • communication_state_callback (Callable[[CommunicationStatus], None]) – callback to be called when the status of the communications channel between the component manager and its component changes.

  • component_state_callback (Callable[..., None]) – callback to be called when the component state changes.

get_calibration(channel)

Get a calibration from the calibration store.

Parameters:

channel (int) – the frequency channel to calibrate for

Raises:

ValueError – if the outside temperature has not been read yet

Return type:

list[float]

Returns:

A list of calibration values

start_communicating()

Establish communication with the StationCalibrator components.

Return type:

None

stop_communicating()

Break off communication with the StationCalibrator components.

Return type:

None

class StationCalibratorHealthModel(*args, **kwargs)

A health model for a station calibrator.

At present this uses the base health model; this is a placeholder for a future, better implementation.