CBPCSC#

class lsst.ts.cbp.CBPCSC(simulation_mode=0, initial_state=State.STANDBY, config_dir=None)#

Bases: ConfigurableCsc

This 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 to lsst.ts.salobj.State.STANDBY

  • config_dir (None or str or pathlib.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 returned get_config_dir.

component#

Component wrapper around the controller connection.

Type:

CBPComponent

simulator#

Mock controller used in simulation mode.

Type:

None or MockServer

telemetry_task#

Background task that publishes telemetry.

Type:

asyncio.Future

monitor_task#

Background task that reads hardware telemetry.

Type:

asyncio.Future

telemetry_interval#

The interval that telemetry is published.

Type:

float

in_position_timeout#

The time to wait for all encoders of the CBP to be in position.

Type:

int

mask_timeout#

The time to wait for a mask motion to complete.

Type:

int

in_position#

Component-owned in-position snapshot used for command responses.

Type:

component.InPosition

polling_interval#

The interval between monitor reads.

Type:

float

Attributes Summary

in_position

Return the component-owned command-facing in-position state.

valid_simulation_modes

The valid simulation modes for the CBP.

version

Methods Summary

assert_unparked()

Assert that the CBP is not parked.

cancel_task(task)

Cancel and await task result.

close_tasks()

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.

get_config_pkg()

Return the name of the configuration repository.

handle_summary_state()

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.

telemetry()

Publish the updated telemetry.

wait_for_move_completion()

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.0a1'#

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:

None

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:

None

async close_tasks()#

Cancel CSC background tasks and close component resources.

Return type:

None

async configure(config)#

Configure the CSC.

Parameters:

config (types.SimpleNamespace) – Parsed configuration namespace.

Return type:

None

async do_changeMask(data)#

Changes the mask.

Parameters:

data (cmd_changeMask.DataType) – Command payload containing the target mask identifier.

Return type:

None

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:

None

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:

None

async do_park(data)#

Park the CBP.

Parameters:

data (cmd_park.DataType) – Command payload for the park command.

Return type:

None

async do_setFocus(data)#

Sets the focus.

Parameters:

data (cmd_setFocus.DataType) – Command payload containing the target focus value.

Return type:

None

async do_unpark(data)#

Unpark the CBP.

Parameters:

data (cmd_unpark.DataType) – Command payload for the unpark command.

Return type:

None

static get_config_pkg()#

Return the name of the configuration repository.

Returns:

config_pkg – Name of the configuration package.

Return type:

str

async handle_summary_state()#

React to the current summary state and manage background tasks.

Return type:

None

async monitor()#

Read hardware state and update component telemetry snapshots.

Return type:

None

async publish_in_position(in_position=None)#

Publish an in-position state.

If in_position is provided, it is usually a telemetry-derived snapshot from component.TelemetrySnapshot.in_position or a command-facing snapshot from component.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:

None

async publish_target(target=None)#

Publish a commanded target state.

Parameters:

target (Target | None, default: None)

Return type:

None

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:

None

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:

None

async telemetry()#

Publish the updated telemetry.

Return type:

None

async wait_for_move_completion()#

Wait for all axes of the CBP to be in position.

Return type:

None

async wait_for_park_completion(parked)#

Wait for the monitor loop to observe the requested park state.

Parameters:

parked (bool)

Return type:

None