Subarray beam subpackage
This subpackage implements subarray beam functionality for MCCS.
- class MccsSubarrayBeam(*args, **kwargs)
An implementation of a subarray beam Tango device for MCCS.
- Abort()
Abort any long-running command such as
Configure()
orScan()
.
- 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 trackercomponent_manager (
SubarrayBeamComponentManager
) – 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 Abort() 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.
- 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 (
SubarrayBeamComponentManager
) – 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.
- AssignResources(argin)
Assign resources to the subarray_beam with all relevant parameters.
- Configure(argin)
Configure the subarray_beam with all relevant parameters.
- End()
End the scan block (deconfigure).
- EndScan()
End the scan.
- class InitCommand(*args, **kwargs)
A class for
MccsSubarrayBeam
’s Init command.The
do()
method below is called uponMccsSubarrayBeam
’s initialisation.- do()
Initialise the attributes and properties of the MccsSubarrayBeam.
State is managed under the hood; the basic sequence is:
Device state is set to INIT
The do() method is run
Device state is set to the OFF
- 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 current observation process.
To modify behaviour for this command, modify the do() method of the command class.
- ReleaseAllResources()
Release all resources.
- 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.
- Scan(argin)
Start a scan on the subarray_beam.
- __init__(*args, **kwargs)
Initialise this device object.
- antennaWeights()
Return the antenna weights configured for this beam.
- channels()
Return the ids of the channels configured for this beam.
- create_component_manager()
Create and return a component manager for this device.
- Return type:
- 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
- firstSubarrayChannel()
Return the first logical channel allocated to the beam.
- Return type:
- Returns:
the first logical channel allocated to the beam.
- healthModelParams(argin)
Set the params for health transition rules.
- init_command_objects()
Initialise the command handlers for commands supported by this device.
- Return type:
- isBeamLocked(value)
Set a flag indicating whether the beam is locked or not.
- logicalBeamId(logical_beam_id)
Set the logical beam id.
- numberOfChannels()
Return the first logical channel allocated to the beam.
- Return type:
- Returns:
the first logical channel allocated to the beam.
- stationBeamIds(station_beam_ids)
Set the station beam ids.
- stationIds(station_ids)
Set the station ids.
- class SubarrayBeamComponentManager(logger, communication_state_callback, component_state_callback, _station_beams=None)
A component manager for a subarray beam.
- __init__(logger, communication_state_callback, component_state_callback, _station_beams=None)
Initialise a new instance.
- Parameters:
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_station_beams (
Optional
[dict
[str
,Any
]]) – a optional injected station beams for testing purposes only. defaults to None
- abort(task_callback=None)
Abort the observation.
- abort_device(task_callback=None)
Abort only this device, for use in RestartSubarray().
- assign_resources(task_callback=None, *, interface=None, subarray_id, subarray_beam_id=0, apertures, first_subarray_channel=0, number_of_channels)
Submit the assign_resources slow task.
This method returns immediately after it is submitted for execution.
- Parameters:
task_callback (
Optional
[Callable
]) – Update task state, defaults to Noneinterface (
Optional
[str
]) – the schema version this is running against.subarray_id (
int
) – ID of the subarray which controls this beamapertures (
Iterable
) – Allocated aperturesfirst_subarray_channel (
Optional
[int
]) – First channel (default 0)number_of_channels (
int
) – Number of allocated channels
- Return type:
- Returns:
A tuple containing a task status and a unique id string to identify the command
- property channels: list[list[int]]
Return the ids of the channels configured for this subarray beam.
- Returns:
the ids of the channels configured for this subarray beam.
- configure(task_callback=None, *, interface=None, subarray_id, subarray_beam_id, update_rate=0.0, logical_bands, apertures, sky_coordinates)
Submit the configure slow task.
This method returns immediately after it is submitted for execution.
- Parameters:
task_callback (
Optional
[Callable
]) – Update task state, defaults to Noneinterface (
Optional
[str
]) – the schema version this is running against.subarray_id (
int
) – ID of the subarray to which thissubarray_beam_id (
int
) – ID of (this) subarray beamupdate_rate (
Optional
[float
]) – Update rate for pointing in secondslogical_bands (
list
[dict
]) – list of spectral bands to observe
- Return type:
- Returns:
A tuple containing a task status and a unique id string to identify the command
- end(task_callback=None)
Submit the End slow task.
This method returns immediately after it is submitted for execution.
- end_scan(task_callback=None, task_abort_event=None)
Submit the EndScan slow task.
This method returns immediately after it is submitted for execution.
- property first_channel: int
Return the first assigned subarray channel.
- Returns:
the first assigned subarray channel.
- property is_beam_locked: bool
Return whether the beam is locked.
- Returns:
whether the beam is locked
- property number_of_channels: int
Return the number of allocated subarray channels.
- Returns:
the number of channels
- obsreset(task_callback=None)
Submit the ObsReset command.
This method returns immediately after it is submitted for execution.
- release_all_resources(task_callback=None)
Submit the ReleaseAllResources slow task.
This method returns immediately after it is submitted for execution.
- release_resources(task_callback=None)
Submit the ReleaseResources slow task.
This method returns immediately after it is submitted for execution.
- restart(task_callback=None)
Submit the Restart command.
This method returns immediately after it is submitted for execution.
- scan(task_callback=None, *, scan_id, start_time=None, duration=0.0)
Submit the Scan slow task.
This method returns immediately after it is submitted for execution.
- Parameters:
- Return type:
- Returns:
Task status and response message
- class SubarrayBeamHealthModel(station_beam_trls, component_state_callback, thresholds=None)
A health model for subarray beams.
- __init__(station_beam_trls, component_state_callback, thresholds=None)
Initialise a new instance.
- Parameters:
station_beam_trls (
Sequence
[str
]) – the TRLs of this subarray beam’s station beamscomponent_state_callback (
Callable
[...
,None
]) – callback to be called whenever there is a change to this component’s state, including the health model’s evaluated health state.thresholds (
Optional
[dict
[str
,float
]]) – the threshold parameters for the health rules
- evaluate_health()
Compute overall health of the subarray beam.
The overall health is based on the whether the beam is locked or not.
- Return type:
- Returns:
an overall health of the subarray beam
- is_beam_locked_changed(is_beam_locked)
Handle a change in whether the subarray beam is locked.
This is a callback hook called when the subarray beam lock changes.
- remove_station_beam(station_beam_trl)
Remove a station beam from the station beams used to compute health.
- station_beam_health_changed(station_beam_trl, station_beam_health)
Handle a change in station beam health.
If the station beam TRL is not in the internal dictionary of station beam healths, it is added with the provided health
- Parameters:
station_beam_trl (
str
) – the TRL of the station beam whose health has changed or whose health is to be addedstation_beam_health (
Optional
[HealthState
]) – the health state of the specified station beam, or None if the station beam’s admin mode indicates that its health should not be rolled up.
- Return type:
- Subarray beam component manager
SubarrayBeamComponentManager
SubarrayBeamComponentManager.__init__()
SubarrayBeamComponentManager.abort()
SubarrayBeamComponentManager.abort_device()
SubarrayBeamComponentManager.antenna_weights
SubarrayBeamComponentManager.assign_resources()
SubarrayBeamComponentManager.channels
SubarrayBeamComponentManager.configure()
SubarrayBeamComponentManager.desired_pointing
SubarrayBeamComponentManager.end()
SubarrayBeamComponentManager.end_scan()
SubarrayBeamComponentManager.first_channel
SubarrayBeamComponentManager.is_beam_locked
SubarrayBeamComponentManager.logical_beam_id
SubarrayBeamComponentManager.number_of_channels
SubarrayBeamComponentManager.obsreset()
SubarrayBeamComponentManager.phase_centre
SubarrayBeamComponentManager.release_all_resources()
SubarrayBeamComponentManager.release_resources()
SubarrayBeamComponentManager.restart()
SubarrayBeamComponentManager.scan()
SubarrayBeamComponentManager.start_communicating()
SubarrayBeamComponentManager.station_beam_ids
SubarrayBeamComponentManager.station_ids
SubarrayBeamComponentManager.stop_communicating()
SubarrayBeamComponentManager.subarray_beam_id
SubarrayBeamComponentManager.subarray_id
SubarrayBeamComponentManager.update_rate
- Subarray beam device
MccsSubarrayBeam
MccsSubarrayBeam.Abort()
MccsSubarrayBeam.AbortCommand
MccsSubarrayBeam.AbortDevice()
MccsSubarrayBeam.AbortDeviceCommand
MccsSubarrayBeam.AssignResources()
MccsSubarrayBeam.Configure()
MccsSubarrayBeam.End()
MccsSubarrayBeam.EndScan()
MccsSubarrayBeam.InitCommand
MccsSubarrayBeam.ObsReset()
MccsSubarrayBeam.ReleaseAllResources()
MccsSubarrayBeam.Restart()
MccsSubarrayBeam.Scan()
MccsSubarrayBeam.__init__()
MccsSubarrayBeam.antennaWeights()
MccsSubarrayBeam.channels()
MccsSubarrayBeam.create_component_manager()
MccsSubarrayBeam.desiredPointing()
MccsSubarrayBeam.firstSubarrayChannel()
MccsSubarrayBeam.healthModelParams()
MccsSubarrayBeam.init_command_objects()
MccsSubarrayBeam.init_device()
MccsSubarrayBeam.isBeamLocked()
MccsSubarrayBeam.logicalBeamId()
MccsSubarrayBeam.numberOfChannels()
MccsSubarrayBeam.phaseCentre()
MccsSubarrayBeam.stationBeamIds()
MccsSubarrayBeam.stationIds()
MccsSubarrayBeam.subarrayBeamId()
MccsSubarrayBeam.subarrayId()
MccsSubarrayBeam.updateRate()
main()
- Subarray beam health model
- Subarray beam health rules