Subarray subpackage
This subpackage implements subarray functionality for MCCS.
- class MccsSubarray(*args: Any, **kwargs: Any)[source]
MccsSubarray is the Tango device class for the MCCS Subarray prototype.
- AbortDevice() tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
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.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- class AbortDeviceCommand(*args: Any, **kwargs: Any)[source]
A class for MccsSubarray’s AbortDevice() command.
- __init__(command_tracker: ska_tango_base.base.CommandTracker, component_manager: SubarrayComponentManager, callback: Callable[[bool], None], logger: Logger | None = None) None[source]
Initialise a new AbortCommand instance.
- Parameters:
command_tracker – the device’s command tracker
component_manager – the device’s component manager
callback – callback to be called when this command states and finishes
logger – a logger for this command object to yuse
- do(*args: Any, **kwargs: Any) tuple[ska_control_model.ResultCode, str][source]
Stateless hook for AbortDevice() command functionality.
- Parameters:
args – positional arguments to the command. This command does not take any, so this should be empty.
kwargs – keyword arguments to the command. This command does not take any, so this should be empty.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- class AssignResourcesCommand(*args: Any, **kwargs: Any)[source]
A class for SKASubarray’s AssignResources() command.
- __init__(command_tracker: ska_tango_base.base.CommandTracker, component_manager: SubarrayComponentManager, callback: Callable | None = None, logger: Logger | None = None) None[source]
Initialise a new instance.
- Parameters:
command_tracker – the device’s command tracker
component_manager – the device’s component manager
callback – an optional callback to be called when this command starts and finishes.
logger – a logger for this command to log with.
- class ConfigureCommand(*args: Any, **kwargs: Any)[source]
A class for SKASubarray’s Configure() command.
- __init__(command_tracker: ska_tango_base.base.CommandTracker, component_manager: SubarrayComponentManager, callback: Callable | None = None, logger: Logger | None = None) None[source]
Initialise a new instance.
- Parameters:
command_tracker – the device’s command tracker
component_manager – the device’s component manager
callback – an optional callback to be called when this command starts and finishes.
logger – a logger for this command to log with.
- End() tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Deconfigure resources.
- Returns:
A tuple containing a return code and a string message indicating status.
- EndScan() tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Stop scanning.
- Returns:
A tuple containing a return code and a string message indicating status.
- class InitCommand(*args: Any, **kwargs: Any)[source]
Command class for device initialisation.
- do() tuple[ska_control_model.ResultCode, str][source]
Initialise the attributes and properties of MccsSubarray.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- ObsReset() tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Reset the observation by returning to unconfigured state.
- Returns:
A tuple containing a return code and a string message indicating status.
- ReleaseAllResources() tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Release all resources from this subarray.
- Returns:
A tuple containing a return code and a string message indicating status.
- ReleaseResources(argin: str) tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Release resources from this subarray.
- Parameters:
argin – the resources to be released
- Returns:
A tuple containing a return code and a string message indicating status.
- Restart() tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Restart the subarray by returning to unresourced state.
- Returns:
A tuple containing a return code and a string message indicating status.
- Scan(argin: str) tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Start scanning.
- Parameters:
argin – Json string containing scan_id and start_time.
- Returns:
A tuple containing a return code and a string message indicating status.
- class ScanCommand(*args: Any, **kwargs: Any)[source]
A class for SKASubarray’s Scan() command.
- __init__(command_tracker: ska_tango_base.base.CommandTracker, component_manager: SubarrayComponentManager, callback: Callable | None = None, logger: Logger | None = None) None[source]
Initialise a new instance.
- Parameters:
command_tracker – the device’s command tracker
component_manager – the device’s component manager
callback – an optional callback to be called when this command starts and finishes.
logger – a logger for this command to log with.
- SendTransientBuffer(argin: list[int]) tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
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).
- 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.
- 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
- init_command_objects() None[source]
Initialise the command handlers for commands supported by this device.
- 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
- stationBeamTrls() list[str][source]
Return the TRLs of station beams assigned to this subarray.
- Returns:
TRLs of station beams assigned to this subarray
- class SubarrayComponentManager(*args: Any, **kwargs: Any)[source]
A component manager for a subarray.
- __init__(subarray_id: int, skuid_url: str, logger: Logger, obs_command_timeout: int, communication_state_callback: Callable[[ska_control_model.CommunicationStatus], None], component_state_callback: Callable[[...], None]) None[source]
Initialise a new instance.
- Parameters:
subarray_id – the subarray ID for this device
skuid_url – The address at which a SKUID service is running.
obs_command_timeout – the default timeout for obs commands in seconds.
logger – the logger to be used by this object.
communication_state_callback – callback to be called when the status of the communications channel between the component manager and its component changes
component_state_callback – callback to be called when the component state changes.
- abort(task_callback: Callable | None = None) tuple[ska_control_model.TaskStatus, str][source]
Abort the observation.
- Parameters:
task_callback – callback to be called when the status of the command changes
- Returns:
A task status and response message.
- abort_device(task_callback: Callable | None = None) tuple[ska_control_model.TaskStatus, str][source]
Abort only this device, for use in RestartSubarray().
- Parameters:
task_callback – callback to be called when the status of the command changes
- Returns:
A task status and response message.
- assign(task_callback: Callable | None = None, **kwargs: Any) tuple[ska_control_model.TaskStatus, str][source]
Submit the AssignResources slow command.
This method returns immediately after it is submitted for execution.
- Parameters:
task_callback – Update task state, defaults to None
kwargs – keyword arguments to the command. Required keys are “subarray_id” (the ID of the subarray), and subarray_beams (resource specification for each beam).
- 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: Callable | None = None, **kwargs: Any) tuple[ska_control_model.TaskStatus, str][source]
Submit the configure slow command.
This method returns immediately after it is submitted for execution.
- Parameters:
task_callback – Update task state, defaults to None
kwargs – keyword arguments to the command. The only required key is “subarray_beams”, which contains the beam configuration.
- Returns:
A task status and response message.
- deconfigure(task_callback: Callable | None = None) tuple[ska_control_model.TaskStatus, str][source]
Submit the deconfigure (End) slow command.
- Parameters:
task_callback – Update task state, defaults to None
- Returns:
A task status and response message.
- end_scan(task_callback: Callable | None = None) tuple[ska_control_model.TaskStatus, str][source]
Submit the end_scan slow command.
- Parameters:
task_callback – Update task state, defaults to None
- Returns:
A task status and response message.
- property max_executing_tasks: int
Get the max number of tasks that can be executing at once.
- Returns:
max number of simultaneously executing tasks.
- obsreset(task_callback: Callable | None = None) tuple[ska_control_model.TaskStatus, str][source]
Submit the ObsReset slow command.
- Parameters:
task_callback – Update task state, defaults to None
- Returns:
A task status and response message.
- property power_state: ska_control_model.PowerState | None
Return my power state.
- Returns:
my power state
- release(task_callback: Callable | None = None, **kwargs: Any) tuple[ska_control_model.TaskStatus, str][source]
Submit the release slow command.
- Parameters:
task_callback – Update task state, defaults to None
kwargs – keyword arguments to the command. The only required key is “resources”, which contains a list of resource names to release
- Returns:
A task status and response message.
- release_all(task_callback: Callable | None = None) tuple[ska_control_model.TaskStatus, str][source]
Submit the ReleaseAllResources slow command.
Release all resources from this subarray. :param task_callback: Update task state, defaults to None :return: a task status and response message
- restart(task_callback: Callable | None = None) tuple[ska_control_model.TaskStatus, str][source]
Submit the Restart slow command.
- Parameters:
task_callback – Update task state, defaults to None
- Returns:
A task status and response message.
- scan(task_callback: Callable | None = None, *, interface: str | None = None, scan_id: int, start_time: str | None = None, duration: float | None = 0.0) tuple[ska_control_model.TaskStatus, str][source]
Submit the Scan command.
- Parameters:
task_callback – Update task state, defaults to None
interface – the schema version this is running against.
scan_id – The ID for this scan
start_time – UTC time for begin of scan, None for immediate start
duration – Scan duration in seconds. 0.0 or omitted means foreve
- 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: list[int], task_callback: Callable | None = None) tuple[ska_control_model.TaskStatus, str][source]
Submit the send_transient_buffer slow task.
This method returns immediately after it is submitted for execution.
- Parameters:
argin – list of requested segments.
task_callback – Update task state. Defaults to None.
- Returns:
Task status and response message.
- 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(*args: Any, **kwargs: Any)[source]
A health model for subarrays.
- __init__(health_changed_callback: Callable, ignore_power_state: bool = False, thresholds: dict[str, float] | None = None) None[source]
Initialise a new instance.
- Parameters:
health_changed_callback – a callback to be called when the health of the subarray (as evaluated by this model) changes
ignore_power_state – whether the health model should ignore the power state when computing health.
thresholds – Thresholds for failed and degraded states.
- evaluate_health() tuple[ska_control_model.HealthState, str][source]
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.
- Returns:
an overall health of the subarray
- resources_changed(station_trls: set[str], subarray_beam_trls: set[str], station_beam_trls: set[str]) None[source]
Handle change in subarray resources.
This is a callback hook, called by the component manager when the resources of the subarray changes.
- Parameters:
station_trls – the TRLs of stations assigned to this subarray
subarray_beam_trls – the TRLs of subarray beams assigned to this subarray
station_beam_trls – the TRLs of station beams assigned to this subarray
- station_beam_health_changed(trl: str, health_state: HealthState | None) None[source]
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 – the TRL of the station beam whose health has changed
health_state – the new health state of the station beam, or None if the station beam’s health should not be taken into account.
- station_health_changed(trl: str, health_state: HealthState | None) None[source]
Handle change in station health.
This is a callback hook, called by the component manager when the health of a station changes.
- Parameters:
trl – the TRL of the station whose health has changed
health_state – the new health state of the station, or None if the subarray beam’s health should not be taken into account.
- subarray_beam_health_changed(trl: str, health_state: HealthState | None) None[source]
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 – the TRL of the subarray beam whose health has changed
health_state – the new health state of the subarray beam, or None if the subarray beam’s health should not be taken into account.
- Subarray component manager
SubarrayComponentManagerSubarrayComponentManager.__init__()SubarrayComponentManager.abort()SubarrayComponentManager.abort_device()SubarrayComponentManager.assign()SubarrayComponentManager.assigned_resourcesSubarrayComponentManager.assigned_resources_dictSubarrayComponentManager.configure()SubarrayComponentManager.deconfigure()SubarrayComponentManager.end_scan()SubarrayComponentManager.max_executing_tasksSubarrayComponentManager.obsreset()SubarrayComponentManager.power_stateSubarrayComponentManager.release()SubarrayComponentManager.release_all()SubarrayComponentManager.restart()SubarrayComponentManager.scan()SubarrayComponentManager.scan_idSubarrayComponentManager.send_transient_buffer()SubarrayComponentManager.start_communicating()SubarrayComponentManager.station_beam_trlsSubarrayComponentManager.station_trlsSubarrayComponentManager.stop_communicating()SubarrayComponentManager.subarray_beam_trls
- Subarray device
MccsSubarrayMccsSubarray.AbortDevice()MccsSubarray.AbortDeviceCommandMccsSubarray.AssignResourcesCommandMccsSubarray.ConfigureCommandMccsSubarray.End()MccsSubarray.EndScan()MccsSubarray.InitCommandMccsSubarray.ObsReset()MccsSubarray.ReleaseAllResources()MccsSubarray.ReleaseResources()MccsSubarray.Restart()MccsSubarray.Scan()MccsSubarray.ScanCommandMccsSubarray.SendTransientBuffer()MccsSubarray.__init__()MccsSubarray.assignedResources()MccsSubarray.create_component_manager()MccsSubarray.healthModelParams()MccsSubarray.healthReport()MccsSubarray.init_command_objects()MccsSubarray.init_device()MccsSubarray.missedEvents()MccsSubarray.scanId()MccsSubarray.stationBeamTrls()MccsSubarray.stationTrls()MccsSubarray.subarrayBeamTrls()
main()
- Subarray health model
- Subarray health rules