CBPCSC#
- class lsst.ts.cbp.CBPCSC(simulation_mode=0, initial_state=State.STANDBY, config_dir=None)#
Bases:
ConfigurableCscThis defines the CBP CSC using ts_salobj.
- Parameters:
simulation_mode (
int, optional) –Supported simulation mode values
0: normal operation
1: mock controller
initial_state (
lsst.ts.salobj.State, optional) – Initial state is meant for unit tests, defaults tolsst.ts.salobj.State.STANDBYconfig_dir (
Noneorstrorpathlib.Path, optional) – Meant for unit tests. Tells the CSC where to look for the configuration files. Normal operation will always be in a configuration repository returnedget_config_dir.
- component#
Component wrapper around the controller connection.
- Type:
- simulator#
Mock controller used in simulation mode.
- Type:
NoneorMockServer
- telemetry_task#
Background task that publishes telemetry.
- Type:
- monitor_task#
Background task that reads hardware telemetry.
- Type:
- in_position#
Component-owned in-position snapshot used for command responses.
- Type:
Attributes Summary
Return the component-owned command-facing in-position state.
The valid simulation modes for the CBP.
Methods Summary
Assert that the CBP is not parked.
cancel_task(task)Cancel and await task result.
Cancel CSC background tasks and close component resources.
configure(config)Configure the CSC.
do_changeMask(data)Changes the mask.
do_changeMaskRotation(data)Changes the mask rotation variable and moves the current mask to that rotation value.
do_move(data)Move the CBP mount to a specified position.
do_park(data)Park the CBP.
do_setFocus(data)Sets the focus.
do_unpark(data)Unpark the CBP.
Return the name of the configuration repository.
React to the current summary state and manage background tasks.
monitor()Read hardware state and update component telemetry snapshots.
publish_in_position([in_position])Publish an in-position state.
publish_target([target])Publish a commanded target state.
publish_target_update(target_update)Publish an accepted component target update.
publish_telemetry([telemetry])Publish component telemetry from one immutable snapshot.
Publish the updated telemetry.
Wait for all axes of the CBP to be in position.
wait_for_park_completion(parked)Wait for the monitor loop to observe the requested park state.
Attributes Documentation
- in_position#
Return the component-owned command-facing in-position state.
- valid_simulation_modes: Sequence[int] = (0, 1)#
The valid simulation modes for the CBP.
- version = '1.6.0'#
Methods Documentation
- assert_unparked()#
Assert that the CBP is not parked.
- Raises:
lsst.ts.salobj.ExpectedError – Raised if the component telemetry reports that the CBP is parked.
- Return type:
- async cancel_task(task)#
Cancel and await task result. noop if already done.
Suppresses asyncio.CancelledError.
- Parameters:
task (
asyncio.Future) – The cancellable future or task to cancel and await.- Return type:
- async configure(config)#
Configure the CSC.
- Parameters:
config (
types.SimpleNamespace) – Parsed configuration namespace.- Return type:
- async do_changeMask(data)#
Changes the mask.
- Parameters:
data (
cmd_changeMask.DataType) – Command payload containing the target mask identifier.- Return type:
- async do_changeMaskRotation(data)#
Changes the mask rotation variable and moves the current mask to that rotation value.
- Parameters:
data (
cmd_changeMaskRotation.DataType) – Command payload containing the target mask rotation.- Return type:
- async do_move(data)#
Move the CBP mount to a specified position.
- Parameters:
data (
cmd_move.DataType) – Command payload containing the target azimuth and elevation.- Return type:
- async do_park(data)#
Park the CBP.
- Parameters:
data (
cmd_park.DataType) – Command payload for the park command.- Return type:
- async do_setFocus(data)#
Sets the focus.
- Parameters:
data (
cmd_setFocus.DataType) – Command payload containing the target focus value.- Return type:
- async do_unpark(data)#
Unpark the CBP.
- Parameters:
data (
cmd_unpark.DataType) – Command payload for the unpark command.- Return type:
- static get_config_pkg()#
Return the name of the configuration repository.
- Returns:
config_pkg – Name of the configuration package.
- Return type:
- async handle_summary_state()#
React to the current summary state and manage background tasks.
- Return type:
- async publish_in_position(in_position=None)#
Publish an in-position state.
If
in_positionis provided, it is usually a telemetry-derived snapshot fromcomponent.TelemetrySnapshot.in_positionor a command-facing snapshot fromcomponent.TargetUpdate. If omitted, this publishes the component-owned transient state.- Parameters:
in_position (
component.InPosition, optional) – In-position snapshot to publish. If omitted, publish the component-owned transient in-position state.- Return type:
- async publish_target(target=None)#
Publish a commanded target state.
- async publish_target_update(target_update)#
Publish an accepted component target update.
- Parameters:
target_update (
component.TargetUpdate) – Component-owned target update to publish through SAL.- Return type:
- async publish_telemetry(telemetry=None)#
Publish component telemetry from one immutable snapshot.
- Parameters:
telemetry (
component.TelemetrySnapshot, optional) – Snapshot to publish. If omitted, the latest component snapshot is captured once at the start of the method.- Return type: