Subarray subpackage
This subpackage implements subarray functionality for MCCS.
- class MccsSubarray(*args, **kwargs)
MccsSubarray is the Tango device class for the MCCS Subarray prototype.
- AbortDevice()
Abort any long-running command such as
Configure()
orScan()
.This will only cancel commands on this device, not further down the hierarchy, use Abort() for that use case.
- 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 trackercomponent_manager (
SubarrayComponentManager
) – the device’s component managercallback (
Callable
[[bool
],None
]) – callback to be called when this command states and finisheslogger (
Optional
[Logger
]) – a logger for this command object to yuse
- do(*args, **kwargs)
Stateless hook for AbortDevice() command functionality.
- Parameters:
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- class AssignResourcesCommand(command_tracker, component_manager, callback=None, logger=None)
A class for SKASubarray’s AssignResources() command.
- __init__(command_tracker, component_manager, callback=None, logger=None)
Initialise a new instance.
- Parameters:
command_tracker (
CommandTracker
) – the device’s command trackercomponent_manager (
SubarrayComponentManager
) – the device’s component managercallback (
Optional
[Callable
]) – an optional callback to be called when this command starts and finishes.logger (
Optional
[Logger
]) – a logger for this command to log with.
- class ConfigureCommand(command_tracker, component_manager, callback=None, logger=None)
A class for SKASubarray’s Configure() command.
- __init__(command_tracker, component_manager, callback=None, logger=None)
Initialise a new instance.
- Parameters:
command_tracker (
CommandTracker
) – the device’s command trackercomponent_manager (
SubarrayComponentManager
) – the device’s component managercallback (
Optional
[Callable
]) – an optional callback to be called when this command starts and finishes.logger (
Optional
[Logger
]) – a logger for this command to log with.
- End()
Deconfigure resources.
- EndScan()
Stop scanning.
- class InitCommand(*args, **kwargs)
Command class for device initialisation.
- do()
Initialise the attributes and properties of MccsSubarray.
- Return type:
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- ObsReset()
Reset the observation by returning to unconfigured state.
- ReleaseAllResources()
Release all resources from this subarray.
- ReleaseResources(argin)
Release resources from this subarray.
- Restart()
Restart the subarray by returning to unresourced state.
- Scan(argin)
Start scanning.
- class ScanCommand(command_tracker, component_manager, callback=None, logger=None)
A class for SKASubarray’s Scan() command.
- __init__(command_tracker, component_manager, callback=None, logger=None)
Initialise a new instance.
- Parameters:
command_tracker (
CommandTracker
) – the device’s command trackercomponent_manager (
SubarrayComponentManager
) – the device’s component managercallback (
Optional
[Callable
]) – an optional callback to be called when this command starts and finishes.logger (
Optional
[Logger
]) – a logger for this command to log with.
- SendTransientBuffer(argin)
Cause the subarray to send the requested segment of the transient buffer to SDP.
The requested segment is specified by:
Start time (timestamp: milliseconds since UNIX epoch)
End time (timestamp: milliseconds since UNIX epoch)
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).
- __init__(*args, **kwargs)
Initialise this device object.
- assignedResources()
Return this subarray’s assigned resources.
- Return type:
- Returns:
this subarray’s assigned resources.
- create_component_manager()
Create and return a component manager for this device.
- Return type:
- Returns:
a component manager for this device.
- healthModelParams(argin)
Set the params for health transition rules.
- init_command_objects()
Initialise the command handlers for commands supported by this device.
- Return type:
- stationBeamTrls()
Return the TRLs of station beams assigned to this subarray.
- stationTrls()
Return the TRLs of stations assigned to this subarray.
- class SubarrayComponentManager(subarray_id, skuid_url, logger, max_workers, communication_state_callback, component_state_callback)
A component manager for a subarray.
- __init__(subarray_id, skuid_url, logger, max_workers, communication_state_callback, component_state_callback)
Initialise a new instance.
- Parameters:
subarray_id (
int
) – the subarray ID for this deviceskuid_url (
str
) – The address at which a SKUID service is running.logger (
Logger
) – the logger to be used by this object.communication_state_callback (
Callable
[[CommunicationStatus
],None
]) – callback to be called when the status of the communications channel between the component manager and its component changescomponent_state_callback (
Callable
[...
,None
]) – callback to be called when the component state changes.max_workers (
int
) – Maximum number of workers in the worker pool. Defaults to None.
- abort(task_callback=None)
Abort the observation.
- abort_device(task_callback=None)
Abort only this device, for use in RestartSubarray().
- assign(task_callback=None, **kwargs)
Submit the AssignResources slow command.
This method returns immediately after it is submitted for execution.
- Parameters:
- Return type:
- Returns:
a result code and response message.
- property assigned_resources: list[str]
Return this subarray’s resources.
- Returns:
this subarray’s resources.
- property assigned_resources_dict: dict[str, Sequence[Any]]
Return a dictionary of resource types and TRLs.
- Returns:
this subarray’s resources.
- configure(task_callback=None, **kwargs)
Submit the configure slow command.
This method returns immediately after it is submitted for execution.
- deconfigure(task_callback=None)
Submit the deconfigure (End) slow command.
- end_scan(task_callback=None)
Submit the end_scan slow command.
- obsreset(task_callback=None)
Submit the ObsReset slow command.
- property power_state: ska_control_model.PowerState | None
Return my power state.
- Returns:
my power state
- release(task_callback=None, **kwargs)
Submit the release slow command.
- Parameters:
- Return type:
- Returns:
A task status and response message.
- release_all(task_callback=None)
Submit the ReleaseAllResources slow command.
Release all resources from this subarray. :type task_callback:
Optional
[Callable
] :param task_callback: Update task state, defaults to None :rtype:tuple
[TaskStatus
,str
] :return: a task status and response message
- restart(task_callback=None)
Submit the Restart slow command.
- scan(task_callback=None, *, interface=None, scan_id, start_time=None, duration=0.0)
Submit the Scan command.
- Parameters:
task_callback (
Optional
[Callable
]) – Update task state, defaults to Noneinterface (
Optional
[str
]) – the schema version this is running against.scan_id (
int
) – The ID for this scanstart_time (
Optional
[str
]) – UTC time for begin of scan, None for immediate startduration (
Optional
[float
]) – Scan duration in seconds. 0.0 or omitted means foreve
- Return type:
- Returns:
A task status and response message.
- property scan_id: int | None
Return the scan id, or None if a scan is not current.
- Returns:
the scan id, or None if a scan is not current.
- send_transient_buffer(argin, task_callback=None)
Submit the send_transient_buffer slow task.
This method returns immediately after it is submitted for execution.
- property station_beam_trls: set[str]
Return the set of TRLs of station beams assigned to this subarray.
- Returns:
the set of TRLs of station beams assigned to this subarray.
- class SubarrayHealthModel(health_changed_callback, thresholds=None)
A health model for subarrays.
- __init__(health_changed_callback, thresholds=None)
Initialise a new instance.
- evaluate_health()
Compute overall health of the subarray.
The overall health is based on the fault and communication status of the subarray overall, together with the health of its stations and subarray beams.
This implementation simply sets the health of the station to the health of its least healthy component.
- Return type:
- Returns:
an overall health of the subarray
- resources_changed(station_trls, subarray_beam_trls, station_beam_trls)
Handle change in subarray resources.
This is a callback hook, called by the component manager when the resources of the subarray changes.
- station_beam_health_changed(trl, health_state)
Handle change in station beam health.
This is a callback hook, called by the component manager when the health of a station beam changes.
- Parameters:
trl (str) – the TRL of the station beam whose health has changed
health_state (HealthState | None) – the new health state of the station beam, or None if the station beam’s health should not be taken into account.
- Return type:
None
- station_health_changed(trl, health_state)
Handle change in station health.
This is a callback hook, called by the component manager when the health of a station changes.
- Parameters:
trl (str) – the TRL of the station whose health has changed
health_state (HealthState | None) – the new health state of the station, or None if the subarray beam’s health should not be taken into account.
- Return type:
None
- subarray_beam_health_changed(trl, health_state)
Handle change in subarray beam health.
This is a callback hook, called by the component manager when the health of a subarray beam changes.
- Parameters:
trl (str) – the TRL of the subarray beam whose health has changed
health_state (HealthState | None) – the new health state of the subarray beam, or None if the subarray beam’s health should not be taken into account.
- Return type:
None
- Subarray component manager
SubarrayComponentManager
SubarrayComponentManager.__init__()
SubarrayComponentManager.abort()
SubarrayComponentManager.abort_device()
SubarrayComponentManager.assign()
SubarrayComponentManager.assigned_resources
SubarrayComponentManager.assigned_resources_dict
SubarrayComponentManager.configure()
SubarrayComponentManager.deconfigure()
SubarrayComponentManager.end_scan()
SubarrayComponentManager.obsreset()
SubarrayComponentManager.power_state
SubarrayComponentManager.release()
SubarrayComponentManager.release_all()
SubarrayComponentManager.restart()
SubarrayComponentManager.scan()
SubarrayComponentManager.scan_id
SubarrayComponentManager.send_transient_buffer()
SubarrayComponentManager.start_communicating()
SubarrayComponentManager.station_beam_trls
SubarrayComponentManager.station_trls
SubarrayComponentManager.stop_communicating()
SubarrayComponentManager.subarray_beam_trls
- Subarray device
MccsSubarray
MccsSubarray.AbortDevice()
MccsSubarray.AbortDeviceCommand
MccsSubarray.AssignResourcesCommand
MccsSubarray.ConfigureCommand
MccsSubarray.End()
MccsSubarray.EndScan()
MccsSubarray.InitCommand
MccsSubarray.ObsReset()
MccsSubarray.ReleaseAllResources()
MccsSubarray.ReleaseResources()
MccsSubarray.Restart()
MccsSubarray.Scan()
MccsSubarray.ScanCommand
MccsSubarray.SendTransientBuffer()
MccsSubarray.__init__()
MccsSubarray.assignedResources()
MccsSubarray.create_component_manager()
MccsSubarray.healthModelParams()
MccsSubarray.init_command_objects()
MccsSubarray.init_device()
MccsSubarray.scanId()
MccsSubarray.stationBeamTrls()
MccsSubarray.stationTrls()
MccsSubarray.subarrayBeamTrls()
main()
- Subarray health model
- Subarray health rules