Station beam subpackage
This subpackage implements station beam functionality for MCCS.
- class MccsStationBeam(*args: Any, **kwargs: Any)[source]
An implementation of a station beam Tango device for MCCS.
- Abort() tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Abort the current scan associated with the station_beam.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- class AbortCommand(*args: Any, **kwargs: Any)[source]
A class for MccsSubarrayBeam’s Abort() command.
- __init__(command_tracker: ska_tango_base.base.CommandTracker, component_manager: StationBeamComponentManager, 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 Abort() 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.
- ApplyPointing() tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Apply pointing delays to antennas associated with the station_beam.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- AssignResources(argin: str) tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Assign resources to the station beam with all relevant parameters.
- Parameters:
argin – Assign Resources parameters encoded in a json string
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Configure(argin: str) tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Configure the station_beam with all relevant parameters.
- Parameters:
argin – Configuration parameters encoded in a json string
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- End() tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Deconfigure the station_beam.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- EndScan() tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Stop the current scan associated with the station_beam.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- class InitCommand(*args: Any, **kwargs: Any)[source]
A class for
MccsStationBeam’s Init command.- The
do()method below is called upon
MccsStationBeam’s initialisation.
- do() tuple[ska_control_model.ResultCode, str][source]
Initialise the attributes and properties of the MccsStationBeam.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- The
- ObsReset() tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Reset to IDLE the station_beam.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- ReleaseAllResources() tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Release all allocated resources from the station_beam.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Restart() tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Restart to EMPTY the station_beam.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- Scan(argin: str) tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Start the scan associated with the station_beam.
- Parameters:
argin – Configuration parameters encoded in a json string
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose only.
- ToFault() tuple[list[ska_control_model.ResultCode], list[Optional[str]]][source]
Put this station beam in ObsState.FAULT.
This is for use in testing only.
- Returns:
A tuple containing a return code and a string message indicating status. The message is for information purpose 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
- antennaWeights() list[float][source]
Return the antenna weights configured for this beam.
- Returns:
antenna weightd
- apertureId() str[source]
Return the Aperture Id.
- Returns:
the station beam Aperture Id, in the form APx.y y=substation
- channels() list[list[int]][source]
Return the ids of the channels configured for this beam.
- Returns:
channel ids
- create_component_manager() StationBeamComponentManager[source]
Create and return a component manager for this device.
- Returns:
a component manager for this device.
- desiredPointing() list[float][source]
Return the desired pointing of this beam.
- Returns:
the desired point of this beam, conforming to the Sky Coordinate Set definition
- hardwareBeamId() int[source]
Return the timestamp used for the pointing coordinates.
- Returns:
the timestamp used for the pointing coordinates.
- 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.
- isBeamLocked() bool[source]
Return a flag indicating whether the beam is locked or not.
- Returns:
whether the beam is locked or not
- logicalBeamId() int[source]
Return the logical beam id.
- Todo:
this documentation needs to differentiate logical beam id from beam id
- Returns:
the logical beam id
- pointingDelay() list[float][source]
Return the pointing delay of this beam.
- Returns:
the pointing delay of this beam
- pointingDelayRate() list[float][source]
Return the pointing delay rate of this beam.
- Returns:
the pointing delay rate of this beam
- pointingReferenceFrame() str[source]
Return the Reference Frame ID for the pointing coordinates.
- Returns:
the Reference Frame ID for the pointing coordinates
- pointingTimestamp() str[source]
Return the timestamp used for the pointing coordinates.
- Returns:
the timestamp used for the pointing coordinates.
- class StationBeamComponentManager(*args: Any, **kwargs: Any)[source]
A component manager for a station beam.
- __init__(beam_id: int, logger: Logger, communication_state_callback: Callable[[ska_control_model.CommunicationStatus], None], component_state_callback: Callable[[...], None]) None[source]
Initialise a new instance.
- Parameters:
beam_id – the beam id of this station beam
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 – a callback to be called whenever the state of the station beam 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.
- apply_pointing(task_callback: Callable | None = None, task_abort_event: Event | None = None) tuple[ska_control_model.TaskStatus, str][source]
Submit the apply_pointing slow task.
This method returns immediately after it is submitted for execution.
- Parameters:
task_callback – Update task state, defaults to None
task_abort_event – Check for abort, defaults to None
- Returns:
Task status and response message
- assign_resources(task_callback: Callable | None = None, *, interface: str | None = None, subarray_id: int, subarray_beam_id: int, aperture_id: str, station_id: int, station_trl: int, channel_blocks: list[int], hardware_beam: int, first_subarray_channel: int, number_of_channels: int) tuple[ska_control_model.TaskStatus, str][source]
Submit the assign_resources slow task.
This method returns immediately after it is submitted for execution.
- Parameters:
task_callback – Update task state, defaults to None
interface – the schema version this is running against.
subarray_id – ID of the subarray to which the beam belongs
subarray_beam_id – ID of the subarray beam
aperture_id – ID of the aperture, of the form “APx.y”
station_id – ID of the associated station
station_trl – TRL of the associated station
channel_blocks – List of the allocated station channel blocks
hardware_beam – Allocated station hardware beam
first_subarray_channel – First channel
number_of_channels – Number of channels
- 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 station beam.
- Returns:
the ids of the channels configured for this subarray beam.
- configure(task_callback: Callable | None = None, task_abort_event: Event | None = None, *, interface: str | None = None, update_rate: float | None = 1.0, logical_bands: list[dict], weighting_key_ref: str | None = 'uniform', sky_coordinates: dict[str, Any]) tuple[ska_control_model.TaskStatus, str][source]
Submit the configure slow task.
This method returns immediately after it is submitted for execution.
- Parameters:
task_callback – Update task state, defaults to None
task_abort_event – Check for abort, defaults to None
interface – the schema version this is running against.
update_rate – Update rate for pointing, default never
logical_bands – Description of observed sky frequency bands
weighting_key_ref – Antenna weights, default uniform,
sky_coordinates – Pointing direction
- Returns:
A return code and a unique command ID.
- end(task_callback: Callable | None = None) tuple[ska_control_model.TaskStatus, str][source]
Submit the end slow task.
This method returns immediately after it is submitted for execution.
- Parameters:
task_callback – Update task state, defaults to None
- Returns:
Task status and response message
- end_scan(task_callback: Callable | None = None, task_abort_event: Event | None = None) tuple[ska_control_model.TaskStatus, str][source]
Submit the EndScan slow task.
This method returns immediately after it is submitted for execution.
- Parameters:
task_callback – Update task state, defaults to None
task_abort_event – Check for abort, defaults to None
- Returns:
Task status and response message
- property is_beam_locked: bool
Return whether the beam is locked.
- Returns:
whether the beam is locked
- 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, task_abort_event: Event | None = None) tuple[ska_control_model.TaskStatus, str][source]
Submit the obs_reset slow task.
This method returns immediately after it is submitted for execution.
- Parameters:
task_callback – Update task state, defaults to None
task_abort_event – Check for abort, defaults to None
- Returns:
Task status and response message
- property pointing_delay_rate: list[float]
Return the pointing delay rate.
- Returns:
the pointing delay rate
- property power_state: ska_control_model.PowerState | None
Return my power state.
- Returns:
my power state
- release_all_resources(task_callback: Callable | None = None) tuple[ska_control_model.TaskStatus, str][source]
Submit the release__all_resources slow task.
This method returns immediately after it is submitted for execution.
- Parameters:
task_callback – Update task state, defaults to None
- Returns:
Task status and response message
- restart(task_callback: Callable | None = None, task_abort_event: Event | None = None) tuple[ska_control_model.TaskStatus, str][source]
Submit the restart slow task.
This method returns immediately after it is submitted for execution.
- Parameters:
task_callback – Update task state, defaults to None
task_abort_event – Check for abort, defaults to None
- Returns:
Task status and response message
- scan(task_callback: Callable | None = None, *, scan_id: int, start_time: str | None = None, duration: float | None = 864000.0) tuple[ska_control_model.TaskStatus, str][source]
Submit the Scan slow task.
This method returns immediately after it is submitted for execution.
- Parameters:
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 forever
task_callback – Update task state, defaults to None
- Returns:
Task status and response message
- property station_trl: str
Return the station TRL.
If the station TRL is not set, return the empty string.
- Returns:
the station TRL
- class StationBeamHealthModel(*args: Any, **kwargs: Any)[source]
A health model for station beams.
- __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 station beam (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 degraded states.
- antenna_health_changed(trl: str, health_state: ska_control_model.HealthState) None[source]
Handle change in station health.
This is a callback hook, called by the component manager when the health of a station changes. :param trl: the TRL of the antenna whose health has changed :param health_state: the new health state of the antenna.
- evaluate_health() tuple[ska_control_model.HealthState, str][source]
Compute overall health of the station beam.
The overall health is based on the whether the beam is locked or not.
- Returns:
an overall health of the station beam
- is_beam_locked_changed(is_beam_locked: bool) None[source]
Handle a change in whether the station beam is locked.
This is a callback hook that is called when whether asubarray beam is locked changes.
- Parameters:
is_beam_locked – whether the station beam is locked
- resources_changed(antenna_trls: set[str]) None[source]
Change the resources used for the station beam.
- Parameters:
antenna_trls – TRLs of the antennas used for the beam
- station_fault_changed(station_fault: bool) None[source]
Handle a change in the fault state of the station beam’s station device.
This is a callback hook that is called when whether a station beam detects that the fault state of its station has changed. This could occur because the station’s health changes, or because the beam changes station.
- Parameters:
station_fault – the fault state of the station that is controlled by this beam.
- station_health_changed(station_health: ska_control_model.HealthState) None[source]
Handle a change in the health of the station device that this beam controls.
This is a callback hook that is called when whether a station beam detects that the health of its station has changed. This could occur because the station’s health changes, or because the beam changes station.
- Parameters:
station_health – the health of the station that is controlled by this beam
- Station beam component manager
StationBeamComponentManagerStationBeamComponentManager.__init__()StationBeamComponentManager.abort()StationBeamComponentManager.antenna_weightsStationBeamComponentManager.aperture_idStationBeamComponentManager.apply_pointing()StationBeamComponentManager.assign_resources()StationBeamComponentManager.beam_idStationBeamComponentManager.channelsStationBeamComponentManager.configure()StationBeamComponentManager.desired_pointingStationBeamComponentManager.end()StationBeamComponentManager.end_scan()StationBeamComponentManager.is_beam_lockedStationBeamComponentManager.logical_beam_idStationBeamComponentManager.max_executing_tasksStationBeamComponentManager.obsreset()StationBeamComponentManager.phase_centreStationBeamComponentManager.pointing_delayStationBeamComponentManager.pointing_delay_rateStationBeamComponentManager.power_stateStationBeamComponentManager.release_all_resources()StationBeamComponentManager.restart()StationBeamComponentManager.scan()StationBeamComponentManager.start_communicating()StationBeamComponentManager.station_idStationBeamComponentManager.station_trlStationBeamComponentManager.stop_communicating()StationBeamComponentManager.subarray_idStationBeamComponentManager.update_rate
- Station beam device
MccsStationBeamMccsStationBeam.Abort()MccsStationBeam.AbortCommandMccsStationBeam.ApplyPointing()MccsStationBeam.AssignResources()MccsStationBeam.Configure()MccsStationBeam.End()MccsStationBeam.EndScan()MccsStationBeam.InitCommandMccsStationBeam.ObsReset()MccsStationBeam.ReleaseAllResources()MccsStationBeam.Restart()MccsStationBeam.Scan()MccsStationBeam.ToFault()MccsStationBeam.__init__()MccsStationBeam.antennaWeights()MccsStationBeam.apertureId()MccsStationBeam.beamId()MccsStationBeam.channels()MccsStationBeam.create_component_manager()MccsStationBeam.desiredPointing()MccsStationBeam.hardwareBeamId()MccsStationBeam.healthModelParams()MccsStationBeam.healthReport()MccsStationBeam.init_command_objects()MccsStationBeam.init_device()MccsStationBeam.isBeamLocked()MccsStationBeam.logicalBeamId()MccsStationBeam.phaseCentre()MccsStationBeam.pointingDelay()MccsStationBeam.pointingDelayRate()MccsStationBeam.pointingReferenceFrame()MccsStationBeam.pointingTimestamp()MccsStationBeam.scanId()MccsStationBeam.stationId()MccsStationBeam.stationTrl()MccsStationBeam.subarrayId()MccsStationBeam.updateRate()
main()
- Station beam health model
StationBeamHealthModelStationBeamHealthModel.__init__()StationBeamHealthModel.antenna_health_changed()StationBeamHealthModel.evaluate_health()StationBeamHealthModel.is_beam_locked_changed()StationBeamHealthModel.resources_changed()StationBeamHealthModel.station_fault_changed()StationBeamHealthModel.station_health_changed()
- Station beam health rules