Calibration Store Device

This module provides a Tango device for a Calibration Store.

class MccsCalibrationStore(*args: Any, **kwargs: Any)[source]

An implementation of the CalibrationStore Tango device.

GetSolution(argin: str) list[float][source]

Get a calibration solution from the database.

Parameters:

argin – json-dictionary of field conditions and channel data.

Returns:

a calibration solution from the database.

class GetSolutionCommand(*args: Any, **kwargs: Any)[source]

Class for handling the GetSolution() 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/MccsCalibrationStore_GetSolution.json",
    "title": "MccsCalibrationStore GetSolution schema",
    "description": "Schema for MccsCalibrationStore's GetSolution command",
    "type": "object",
    "properties": {
        "frequency_channel": {
            "description": "Freqency channel to calibrate for",
            "type": "integer",
            "minimum": 0,
            "maximum": 511
        },
        "outside_temperature": {
            "description": "Outside temperature to calibrate for",
            "type": "number"
        },
        "station_id": {
            "description": "the id of the station we want a solution for.",
            "type": "number"
        }
    },
    "required": ["frequency_channel", "outside_temperature", "station_id"]
}
__init__(component_manager: CalibrationStoreComponentManager, logger: Logger | None = None) None[source]

Initialise a new instance.

Parameters:
  • component_manager – the device’s component manager

  • logger – a logger for this command to log with.

do(*args: Any, **kwargs: Any) list[float][source]

Implement MccsCalibrationStore.GetSolution() command.

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

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

Returns:

a calibration solution from the database.

class InitCommand(*args: Any, **kwargs: Any)[source]

A class for MccsCalibrationStore’s Init command.

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

do(*args: Any, **kwargs: Any) tuple[ska_control_model.ResultCode, str][source]

Initialise the attributes and properties of the MccsCalibrationStore.

Parameters:
  • args – positional args to the component manager method

  • kwargs – keyword args to the component manager method

Returns:

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

StoreSolution(argin: str) tuple[list[ska_control_model.ResultCode], list[str]][source]

Store a solution in the database.

Parameters:

argin – json-dictionary of solution, field conditions and channel data.

Returns:

tuple of result code and message.

class StoreSolutionCommand(*args: Any, **kwargs: Any)[source]

Class for handling the StoreSolution() 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/MccsCalibrationStore_StoreSolution.json",
    "title": "MccsCalibrationStore StoreSolution schema",
    "description": "Schema for MccsCalibrationStore's StoreSolution command",
    "type": "object",
    "properties": {
        "frequency_channel": {
            "description": "Freqency channel to store a solution for",
            "type": "integer",
            "minimum": 0,
            "maximum": 511
        },
        "outside_temperature": {
            "description": "Outside temperature to store a solution for",
            "type": "number"
        },
        "station_id": {
            "description": "the id of the station to store a solution for",
            "type": "integer",
            "minimum": 1,
            "maximum": 512
        },
        "preferred": {
            "description": "Mark a solution as preferred.",
            "type": "boolean"
        },
        "solution_path": {
            "description": "The calibration solution path to store",
            "type": "string"
        }
    },
    "required": [
        "frequency_channel",
        "outside_temperature",
        "station_id",
        "solution_path"
    ]
}
__init__(component_manager: CalibrationStoreComponentManager, logger: Logger | None = None) None[source]

Initialise a new instance.

Parameters:
  • component_manager – the device’s component manager

  • logger – a logger for this command to log with.

do(*args: Any, **kwargs: Any) tuple[list[ska_control_model.ResultCode], list[str]][source]

Implement MccsCalibrationStore.StoreSolution() command.

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

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

Returns:

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

UpdateSelectionPolicy(argin: str) tuple[list[ska_control_model.ResultCode], list[str]][source]

Update the selection policy.

Parameters:

argin

A validated json dictionary containing the following mandatory keys:

  • temperature_tolerance (float)

  • frequency_tolerance (int)

Returns:

tuple of result code and message.

class UpdateSelectionPolicyCommand(*args: Any, **kwargs: Any)[source]

Class for handling the UpdateSelectionPolicy() 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/MccsCalibrationStore_UpdateSelectionPolicy.json",
    "title": "MccsCalibrationStore UpdateSelectionPolicy schema",
    "description": "Schema for MccsCalibrationStore's UpdateSelectionPolicy command",
    "type": "object",
    "properties": {
        "policy_name": {
            "description": "The name of the policy. Please see details in ReadTheDocs https://developer.skao.int/projects/ska-low-mccs/en/latest/api/calibration_store/selection_policy/index.html",
            "type": "string",
            "enum": [
                "preferred",
                "closest_in_range"
            ]
        },
        "frequency_tolerance": {
            "description": "The absolute tolerance on the frequency",
            "type": "integer",
            "units": "channelizer channel"
        },
        "temperature_tolerance": {
            "description": "The absolute tolerance on the temperature",
            "type": "number",
            "units": "Degree Celcius"
        }
    },
    "required": [
        "policy_name"
    ]
}
__init__(component_manager: CalibrationStoreComponentManager, logger: Logger | None = None) None[source]

Initialise a new instance.

Parameters:
  • component_manager – the device’s component manager

  • logger – a logger for this command to log with.

do(*args: Any, **kwargs: Any) tuple[list[ska_control_model.ResultCode], list[str]][source]

Implement MccsCalibrationStore.UpdateSelectionPolicy() command.

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

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

Returns:

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

__init__(*args: Any, **kwargs: Any) None[source]

Initialise this device object.

Parameters:
  • args – positional args to the init

  • kwargs – keyword args to the init

create_component_manager() CalibrationStoreComponentManager[source]

Create and return a component manager for this device.

Returns:

a component manager for this device.

init_command_objects() None[source]

Initialise the command handlers for this device.

selectionPolicy() str[source]

Read the selectionPolicy used by this device.

Returns:

A string with information about the policy.

main(*args: str, **kwargs: str) int[source]

Entry point for module.

Parameters:
  • args – positional arguments

  • kwargs – named arguments

Returns:

exit code