Observing State
- class ska_control_model.ObsState(value)
Python enumerated type for observing state.
- ABORTED = 7
The subarray is in an aborted state.
- ABORTING = 6
The subarray has been interrupted and is aborting what it was doing.
- CONFIGURING = 3
The subarray is being configured for an observation.
This is a transient state; the subarray will automatically transition to READY when configuring completes normally.
- EMPTY = 0
The sub-array has no resources allocated and is unconfigured.
- FAULT = 9
The subarray has detected an error in its observing state.
- IDLE = 2
The subarray has resources allocated but is unconfigured.
- READY = 4
The subarray is fully prepared to scan, but is not scanning.
It may be tracked, but it is not moving in the observed coordinate system, nor is it taking data.
- RESETTING = 8
The subarray device is resetting to a base (EMPTY or IDLE) state.
- RESOURCING = 1
Resources are being allocated to, or deallocated from, the subarray.
In normal science operations these will be the resources required for the upcoming SBI execution.
This may be a complete de/allocation, or it may be incremental. In both cases it is a transient state; when the resourcing operation completes, the subarray will automatically transition to EMPTY or IDLE, according to whether the subarray ended up having resources or not.
For some subsystems this may be a very brief state if resourcing is a quick activity.
- RESTARTING = 10
The subarray device is restarting.
After restarting, the subarray will return to EMPTY state, with no allocated resources and no configuration defined.
- SCANNING = 5
The subarray is scanning.
It is taking data and, if needed, all components are synchronously moving in the observed coordinate system.
Any changes to the sub-systems are happening automatically (this allows for a scan to cover the case where the phase centre is moved in a pre-defined pattern).
- class ska_control_model.ObsStateModel(logger, callback=None, state_machine_factory=<class 'ska_control_model.obs_state._ObsStateMachine'>)
Implements the observation state model for subarray.
The model supports all of the states of the
ObsState
enum:EMPTY: the subarray is unresourced
RESOURCING: the subarray is performing a resourcing operation
IDLE: the subarray is resourced but unconfigured
CONFIGURING: the subarray is performing a configuring operation
READY: the subarray is resourced and configured
SCANNING: the subarray is scanning
ABORTING: the subarray is aborting
ABORTED: the subarray has aborted
RESETTING: the subarray is resetting from an ABORTED or FAULT state back to IDLE
RESTARTING: the subarray is restarting from an ABORTED or FAULT state back to EMPTY
FAULT: the subarray has encountered a observation fault.
A diagram of the subarray observation state model is shown below. This model is non-deterministic as diagrammed, but the underlying state machines has extra states and transitions that render it deterministic. This class simply maps those extra classes onto valid ObsState values.
- __init__(logger, callback=None, state_machine_factory=<class 'ska_control_model.obs_state._ObsStateMachine'>)
Initialise the model.
- Parameters:
logger (
Logger
) – the logger to be used by this state model.callback (
Optional
[Callable
[[ObsState
],None
]]) – A callback to be called when a transition causes a change to device obs_statestate_machine_factory (
Callable
[...
,LockedMachine
]) – a callable that returns a state machine for this model to use
- __weakref__
list of weak references to the object (if defined)
- is_action_allowed(action, raise_if_disallowed=False)
Return whether a given action is allowed in the current state.
- Parameters:
- Raises:
StateModelError – if the action is unknown to the state machine
- Return type:
- Returns:
whether the action is allowed in the current state