Subarray Beam Device

@startuml
class SubarrayBeamHealthEvaluator
SubarrayBeamHealthEvaluator : +evaluate_health()
class SubarrayBeamDriver
SubarrayBeamDriver : +__init__()
SubarrayBeamDriver : +connection_status()
SubarrayBeamDriver : +is_locked()
class SubarrayBeamHardwareFactory
SubarrayBeamHardwareFactory : +__init__()
SubarrayBeamHardwareFactory : +hardware()
class SubarrayBeamHardwareManager
SubarrayBeamHardwareManager : +__init__()
SubarrayBeamHardwareManager : +is_locked()
class MccsSubarrayBeam
MccsSubarrayBeam : +__init__()
MccsSubarrayBeam : +do()
MccsSubarrayBeam : -_initialise_connections()
MccsSubarrayBeam : -_initialise_hardware_management()
MccsSubarrayBeam : -_initialise_health_monitoring()
MccsSubarrayBeam : +interrupt()
MccsSubarrayBeam : +init_command_objects()
MccsSubarrayBeam : +always_executed_hook()
MccsSubarrayBeam : +delete_device()
MccsSubarrayBeam : +health_changed()
MccsSubarrayBeam : +subarrayId()
MccsSubarrayBeam : +subarrayBeamId()
MccsSubarrayBeam : +stationIds()
MccsSubarrayBeam : +logicalBeamId()
MccsSubarrayBeam : +updateRate()
MccsSubarrayBeam : +isBeamLocked()
MccsSubarrayBeam : +channels()
MccsSubarrayBeam : +desiredPointing()
MccsSubarrayBeam : +Configure()
MccsSubarrayBeam : +Scan()
SubarrayBeamDriver : -_is_locked
SubarrayBeamHardwareFactory : -_hardware
MccsSubarrayBeam : -_thread
MccsSubarrayBeam : -_lock
MccsSubarrayBeam : -_interrupt
MccsSubarrayBeam : -_health_state
MccsSubarrayBeam : -_station_ids
MccsSubarrayBeam : -_logical_beam_id
MccsSubarrayBeam : -_desired_pointing

HardwareHealthEvaluator <|-- SubarrayBeamHealthEvaluator
HardwareDriver <|-- SubarrayBeamDriver
HardwareFactory <|-- SubarrayBeamHardwareFactory
HardwareManager <|-- SubarrayBeamHardwareManager
SKAObsDevice <|-- MccsSubarrayBeam
SubarrayBeamHardwareFactory -- SubarrayBeamDriver
SubarrayBeamHardwareManager -- SubarrayBeamHardwareFactory
SubarrayBeamHardwareManager -- SubarrayBeamHealthEvaluator
MccsSubarrayBeam -- SubarrayBeamHardwareManager
@enduml

This module implements the MCCS subarray beam device.

class MccsSubarrayBeam(*args, **kwargs)

An implementation of a subarray beam Tango device for MCCS.

Abort()

Abort any long-running command such as Configure() or Scan().

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

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

class AbortCommand(command_tracker, component_manager, callback, logger=None)

A class for MccsSubarrayBeam’s Abort() command.

__init__(command_tracker, component_manager, callback, logger=None)

Initialise a new AbortCommand instance.

Parameters:
  • command_tracker (CommandTracker) – the device’s command tracker

  • component_manager (SubarrayBeamComponentManager) – the device’s component manager

  • callback (Callable[[bool], None]) – callback to be called when this command states and finishes

  • logger (Optional[Logger]) – a logger for this command object to yuse

do(*args, **kwargs)

Stateless hook for Abort() command functionality.

Parameters:
  • args (Any) – positional arguments to the command. This command does not take any, so this should be empty.

  • kwargs (Any) – keyword arguments to the command. This command does not take any, so this should be empty.

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.

AbortDevice()

Abort any long-running command such as Configure() or Scan().

This will only cancel commands on this device, not further down the hierarchy, use Abort() for that use case.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

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

class AbortDeviceCommand(command_tracker, component_manager, callback, logger=None)

A class for MccsSubarray’s AbortDevice() command.

__init__(command_tracker, component_manager, callback, logger=None)

Initialise a new AbortCommand instance.

Parameters:
  • command_tracker (CommandTracker) – the device’s command tracker

  • component_manager (SubarrayBeamComponentManager) – the device’s component manager

  • callback (Callable[[bool], None]) – callback to be called when this command states and finishes

  • logger (Optional[Logger]) – a logger for this command object to yuse

do(*args, **kwargs)

Stateless hook for AbortDevice() command functionality.

Parameters:
  • args (Any) – positional arguments to the command. This command does not take any, so this should be empty.

  • kwargs (Any) – keyword arguments to the command. This command does not take any, so this should be empty.

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.

AssignResources(argin)

Assign resources to the subarray_beam with all relevant parameters.

Parameters:

argin (str) – Assign Resources parameters encoded in a json string

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

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

Configure(argin)

Configure the subarray_beam with all relevant parameters.

Parameters:

argin (str) – Configuration parameters encoded in a json string

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

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

End()

End the scan block (deconfigure).

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

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

EndScan()

End the scan.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

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

class InitCommand(*args, **kwargs)

A class for MccsSubarrayBeam’s Init command.

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

do()

Initialise the attributes and properties of the MccsSubarrayBeam.

State is managed under the hood; the basic sequence is:

  1. Device state is set to INIT

  2. The do() method is run

  3. Device state is set to the OFF

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.

ObsReset()

Reset the current observation process.

To modify behaviour for this command, modify the do() method of the command class.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a result code and the unique ID of the command

ReleaseAllResources()

Release all resources.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

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

Restart()

Restart the subarray. That is, deconfigure and release all resources.

To modify behaviour for this command, modify the do() method of the command class.

Return type:

tuple[list[ResultCode], list[Optional[str]]]

Returns:

A tuple containing a result code and the unique ID of the command

Scan(argin)

Start a scan on the subarray_beam.

Parameters:

argin (str) – Scan parameters encoded in a json string

Return type:

tuple[list[ResultCode], list[Optional[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

antennaWeights()

Return the antenna weights configured for this beam.

Return type:

list[float]

Returns:

antenna weightd

channels()

Return the ids of the channels configured for this beam.

Return type:

list[list[int]]

Returns:

channel ids

create_component_manager()

Create and return a component manager for this device.

Return type:

SubarrayBeamComponentManager

Returns:

a component manager for this device.

desiredPointing(values)

Set the desired pointing of this beam.

  • activation time (s) – value range 0-10^37

  • azimuth position (deg) – value range 0-360

  • azimuth speed (deg/s) – value range 0-10^37

  • elevation position (deg) – value range 0-90

  • elevation rate (deg/s) – value range 0-10^37

Parameters:

values (list[float]) – the desired pointing of this beam, expressed as a sky coordinate set

Return type:

None

firstSubarrayChannel()

Return the first logical channel allocated to the beam.

Return type:

int

Returns:

the first logical channel allocated to the beam.

healthModelParams(argin)

Set the params for health transition rules.

Parameters:

argin (str) – JSON-string of dictionary of health states

Return type:

None

init_command_objects()

Initialise the command handlers for commands supported by this device.

Return type:

None

init_device()

Initialise the device.

Return type:

None

isBeamLocked(value)

Set a flag indicating whether the beam is locked or not.

Parameters:

value (bool) – whether the beam is locked or not

Return type:

None

logicalBeamId(logical_beam_id)

Set the logical beam id.

Parameters:

logical_beam_id (int) – the logical beam id

Return type:

None

numberOfChannels()

Return the first logical channel allocated to the beam.

Return type:

int

Returns:

the first logical channel allocated to the beam.

phaseCentre()

Return the phase centre.

Return type:

list[float]

Returns:

the phase centre

stationBeamIds(station_beam_ids)

Set the station beam ids.

Parameters:

station_beam_ids (list[str]) – ids of the station beams for this subarray beam

Return type:

None

stationIds(station_ids)

Set the station ids.

Parameters:

station_ids (list[int]) – ids of the stations for this beam

Return type:

None

subarrayBeamId()

Return the subarray beam id.

Return type:

int

Returns:

the subarray beam id

subarrayId()

Return the subarray id.

Return type:

int

Returns:

the subarray id

updateRate()

Return the update rate (in hertz) for this subarray beam.

Return type:

float

Returns:

the update rate for this subarray beam

main(*args, **kwargs)

Entry point for module.

Parameters:
  • args (str) – positional arguments

  • kwargs (str) – named arguments

Return type:

int

Returns:

exit code