Subarray Device

@startuml
class StationsResourceManager
StationsResourceManager : +__init__()
StationsResourceManager : +items()
StationsResourceManager : +add_to_managed()
StationsResourceManager : +release_all()
StationsResourceManager : +station_trls()
StationsResourceManager : +station_ids()
class StationBeamsResourceManager
StationBeamsResourceManager : +__init__()
StationBeamsResourceManager : +__len__()
StationBeamsResourceManager : +assign()
StationBeamsResourceManager : +configure()
StationBeamsResourceManager : +scan()
StationBeamsResourceManager : +release()
StationBeamsResourceManager : +release_all()
StationBeamsResourceManager : +station_beam_trls()
StationBeamsResourceManager : +station_trls()
class TransientBufferManager
TransientBufferManager : +__init__()
TransientBufferManager : +send()
class MccsSubarray
MccsSubarray : +__init__()
MccsSubarray : +do()
MccsSubarray : -_initialise_connections()
MccsSubarray : -_initialise_health_monitoring()
MccsSubarray : -_initialise_resource_management()
MccsSubarray : +init_command_objects()
MccsSubarray : +always_executed_hook()
MccsSubarray : +delete_device()
MccsSubarray : +health_changed()
MccsSubarray : +commandResult()
MccsSubarray : +scanId()
MccsSubarray : +stationTRLs()
MccsSubarray : +succeeded()
MccsSubarray : +check_allowed()
MccsSubarray : +Abort()
MccsSubarray : +ObsReset()
MccsSubarray : +SendTransientBuffer()
StationsResourceManager : -_devices
StationBeamsResourceManager : -_stations
MccsSubarray : -_thread
MccsSubarray : -_lock
MccsSubarray : -_interrupt
MccsSubarray : -_health_state
MccsSubarray : -_scan_id
MccsSubarray : -_command_result

ResourceManager <|-- StationsResourceManager
ResourceManager <|-- StationBeamsResourceManager
SKASubarray <|-- MccsSubarray
MccsSubarray -- TransientBufferManager
@enduml

This module implements MCCS functionality for monitoring and control of subarrays.

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

MccsSubarray is the Tango device class for the MCCS Subarray prototype.

AbortDevice() ska_tango_base.type_hints.TaskFunctionType[source]

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.

Returns:

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

AssignResources(**kwargs: Any) ska_tango_base.type_hints.TaskFunctionType[source]

Assign resources to this subarray with all relevant parameters.

Parameters:

kwargs – mandatory arguments: - subarray_id: Description of observed sky frequency bands - subarray_beams: The beams to be assigned

Returns:

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

Configure(**kwargs: Any) ska_tango_base.type_hints.TaskFunctionType[source]

Configure this subarray with all relevant parameters.

Parameters:

kwargs – arguments including: Mandatory subarray_beams including: - logical_bands: Description of observed sky frequency bands - update_rate: Update rate for pointing, default never - weighting_key_ref: Antenna weights, default uniform, - field: Pointing direction - calibration_id: Unique calibration id. Optional: - transaction_id: Unique transaction id.

Returns:

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

End() ska_tango_base.type_hints.TaskFunctionType[source]

Deconfigure resources for this subarray.

Returns:

A tuple containing a return code and a string message indicating status.

EndScan() ska_tango_base.type_hints.TaskFunctionType[source]

Stop the current scan associated with this subarray.

Returns:

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

ObsReset() ska_tango_base.type_hints.TaskFunctionType[source]

Reset this subarray to IDLE.

Returns:

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

ReleaseAllResources() ska_tango_base.type_hints.TaskFunctionType[source]

Release all allocated resources from this subarray.

Returns:

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

Restart() ska_tango_base.type_hints.TaskFunctionType[source]

Restart this subarray to EMPTY.

Returns:

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

Scan(scan_id: int, start_time: str | None = None, duration: float = 0.0, **kwargs: Any) ska_tango_base.type_hints.TaskFunctionType[source]

Start the scan associated with this subarray.

Parameters:
  • scan_id – The ID for this scan

  • start_time – the start time of the scan

  • duration – Scan duration in seconds. 0.0 or omitted means forever

  • kwargs – Any other kwargs

Returns:

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

SendTransientBuffer(argin: list[int]) ska_tango_base.type_hints.TaskFunctionType[source]

Cause the subarray to send the requested segment of the transient buffer to SDP.

The requested segment is specified by:

  1. Start time (timestamp: milliseconds since UNIX epoch)

  2. End time (timestamp: milliseconds since UNIX epoch)

  3. Dispersion measure

Together, these parameters narrow the selection of transient buffer data to the period of time and frequencies that are of interest.

Additional metadata, such as the ID of a triggering Scheduling Block, may need to be supplied to allow SDP to assign data ownership correctly (TBD75).

Todo:

This method is a stub that does nothing but return a dummy string.

Parameters:

argin – Specification of the segment of the transient buffer to send

Returns:

ASCII String that indicates status, for information purposes 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

assignedResources() str[source]

Return this subarray’s assigned resources.

Returns:

this subarray’s assigned resources.

completed_Abort() None[source]

Abort command completed callback.

completed_AbortDevice() None[source]

Abort device command completed callback.

completed_AssignResources() None[source]

Assign Resources command completed callback.

completed_Configure() None[source]

Configure command completed callback.

completed_ObsReset() None[source]

Obs Reset command completed callback.

completed_ReleaseAllResources() None[source]

Release All Resources command completed callback.

completed_Restart() None[source]

Restart command completed callback.

create_component_manager() SubarrayComponentManager[source]

Create and return a component manager for this device.

Returns:

a component manager for this device.

healthModelParams(argin: str) None[source]

Set the params for health transition rules.

Parameters:

argin – JSON-string of dictionary of health states

healthReport() str[source]

Get the health report.

Returns:

the health report.

init_device() None[source]

Initialise the device.

isConfigured() bool[source]

Return whether this subarray is configured.

Returns:

whether this subarray is configured.

is_ReleaseAllResources_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether the ReleaseAllResources() command may be called.

Overriding base class behaviour (and ADR-8) due to behavioural changes in ska-tango-base 1.4.2.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Returns:

whether the command may be called in the current device state

missedEvents() int[source]

Get the amount of missed change events.

Some commands rely on change events from sub-devices, sometime we miss these events, this attribute keeps track of how many we know we have missed.

Returns:

the amount of missed change events

qualityAssuranceMetrics() str[source]

Expose quality assurance metrics.

The returned structure is: >>> { >>> “subarray_beams”: { >>> “<subarray_beam_id>”: { >>> “apertures”: { >>> “<aperture_id>”: { >>> “is_beam_locked”: bool, >>> “<metric_name>”: value >>> }, >>> … >>> }, >>> “is_beam_locked”: bool >>> }, >>> … >>> }, >>> “beam_locked_percent”: float >>> }

Example: >>> { >>> “subarray_beams”: { >>> “1” : { >>> “apertures”: { >>> “AP001.01”: { >>> “is_beam_locked”: True, >>> } >>> “AP002.01”: { >>> “is_beam_locked”: False, >>> } >>> }, >>> “is_beam_locked”: False, >>> }, >>> “2” : { >>> “apertures”: { >>> “AP003.01”: { >>> “is_beam_locked”: False, >>> } >>> }, >>> “is_beam_locked”: False, >>> } >>> }, >>> “beam_locked_percent”: 0.0 >>> }

Returns:

A json serialised dictionary

resetCspIngestOnScan(reset: bool) None[source]

Set the resetCspIngestOnScan attribute.

Parameters:

reset – Whether to reset CSP Ingest on stations when Scan is called.

scanId(scan_id) None[source]

Set the scanId attribute.

Parameters:

scan_id – the new scanId

schedule_abort_task(task_callback: ska_tango_base.type_hints.TaskCallbackType) tuple[ska_control_model.TaskStatus, str][source]

Schedule an Abort task to begin executing immediately.

Subclasses should override this to change the behaviour of the Abort() command.

Parameters:

task_callback – Notified of progress of the abort command.

Returns:

A tuple containing TaskStatus.IN_PROGRESS and a message

started_Abort() None[source]

Abort command started callback.

started_AbortDevice() None[source]

Abort device command started callback.

started_AssignResources() None[source]

Assign Resources command started callback.

started_Configure() None[source]

Configure command started callback.

started_ObsReset() None[source]

Obs Reset command started callback.

started_ReleaseAllResources() None[source]

Release All Resources command started callback.

started_Restart() None[source]

Restart command started callback.

stationBeamTrls() list[str][source]

Return the TRLs of station beams assigned to this subarray.

Returns:

TRLs of station beams assigned to this subarray

stationTrls() list[str][source]

Return the TRLs of stations assigned to this subarray.

Returns:

TRLs of stations assigned to this subarray

subarrayBeamTrls() list[str][source]

Return the TRLs of subarray beams assigned to this subarray.

Returns:

TRLs of subarray beams assigned to this subarray

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

Entry point for module.

Parameters:
  • args – positional arguments

  • kwargs – named arguments

Returns:

exit code