AxisDevice

class lsst.ts.MTMount.mock.AxisDevice(controller, device_id)

Bases: lsst.ts.MTMount.mock.base_device.BaseDevice

Mock axis controller device.

Suports all commands except MOVE_VELOCITY.

Parameters:
controller : MockController

Mock controller.

device_id : DeviceId

Device ID. Must be one of:

  • enums.DeviceId.AZIMUTH_AXIS
  • enums.DeviceId.ELEVATION_AXIS
  • enums.DeviceId.CAMERA_CABLE_WRAP

Notes

There is no mock azimuth cable wrap because in the real system the azimuth axis takes care of that cable wrap, so MTMountCsc has no need to send commands to it.

Turning on the device also enables it.

Attributes Summary

all_command_names
end_tai Get the end time of the current path, as TAI unix seconds.
power_on Return true if the device is powered on.

Methods Summary

abort()
add_methods() Add do_methods to the command dict
assert_enabled() Raise RuntimeError if device is not fully enabled.
assert_on() Raise RuntimeError if device off or in an alarm state.
assert_tracking_enabled(enabled) Raise RuntimeError if tracking is or is not enabled.
close() Cancel any background tasks and clean up resources.
do_drive_enable(command) Enable or disable the drive.
do_drive_reset(command) Reset the drive.
do_enable_tracking(command) Enable or disable tracking mode.
do_home(command) Home the actuator.
do_move(command) Set target position.
do_move_velocity(command)
do_power(command)
do_reset_alarm(command)
do_stop(command) Stop the actuator.
do_track(command) Specify a tracking target position, velocity, and time.
monitor_move_command(command) Return a task that is set done when the move is done.
move_point_to_point(position, command) Move to the specified position.
supersede_move_command() Report the current move command (if any) as superseded.

Attributes Documentation

all_command_names = {'ENCODER_INTERFACE_BOX_RESET_ERROR', 'CAMERA_CABLE_WRAP_DRIVE_ENABLE', 'LOCKING_PINS_POWER', 'BOTH_AXES_STOP', 'EXIT', 'MIRROR_COVER_LOCKS_MOVE_VELOCITY', 'STATE_INFO', 'MAIN_POWER_SUPPLY_POWER', 'TOP_END_CHILLER_POWER', 'OIL_SUPPLY_SYSTEM_RESET_ALARM', 'ENCODER_INTERFACE_BOX_REFERENCE', 'ENCODER_INTERFACE_BOX_EXIT', 'ENCODER_INTERFACE_BOX_RESET', 'AZIMUTH_THERMAL_POWER', 'ELEVATION_AXIS_DRIVE_RESET', 'ENABLE_CAMERA_WRAP', 'AZIMUTH_AXIS_MOVE_VELOCITY', 'DEPLOYABLE_PLATFORM_STOP', 'MIRROR_COVER_LOCKS_MOVE_ALL', 'START', 'TRANSFER_FUNCTION_AZIMUTH_EXCITATION', 'AZIMUTH_AXIS_DRIVE_RESET', 'OPEN_MIRROR_COVER', 'ELEVATION_AXIS_MOVE_VELOCITY', 'LOCKING_PINS_RESET_ALARM', 'CAMERA_CABLE_WRAP_TRACK', 'CAMERA_CABLE_WRAP_DRIVE_RESET', 'MIRROR_COVERS_RETRACT', 'BALANCE_RESET_ALARM', 'MIRROR_COVERS_MOVE', 'CAMERA_CABLE_WRAP_MOVE', 'DEPLOYABLE_PLATFORM_POWER', 'ELEVATION_AXIS_RESET_ALARM', 'MIRROR_COVERS_MOVE_VELOCITY', 'BALANCE_POWER', 'SAFETY_RESET', 'AZIMUTH_AXIS_POWER', 'MIRROR_COVERS_RESET_ALARM', 'ELEVATION_AXIS_STOP', 'LOCKING_PINS_MOVE_ALL', 'AZIMUTH_AXIS_DRIVE_ENABLE', 'AZIMUTH_AXIS_ENABLE_TRACKING', 'AZIMUTH_CABLE_WRAP_MOVE', 'MIRROR_COVERS_STOP', 'ELEVATION_AXIS_ENABLE_TRACKING', 'OIL_SUPPLY_SYSTEM_POWER_OIL', 'LOCKING_PINS_MOVE_VELOCITY', 'TRANSFER_FUNCTION_ELEVATION_EXCITATION', 'AZIMUTH_AXIS_HOME', 'BOTH_AXES_MOVE', 'TRACK_TARGET', 'AZIMUTH_AXIS_TRACK', 'CAMERA_CABLE_WRAP_POWER', 'BALANCE_STOP', 'AZIMUTH_CABLE_WRAP_MOVE_VELOCITY', 'DEPLOYABLE_PLATFORM_RESET_ALARM', 'ELEVATION_AXIS_MOVE', 'APPLICATION_EXIT', 'AZIMUTH_CABLE_WRAP_RESET_ALARM', 'DEPLOYABLE_PLATFORM_MOVE_VELOCITY', 'CAMERA_CABLE_WRAP_MOVE_VELOCITY', 'OIL_SUPPLY_SYSTEM_POWER_COOLING', 'MIRROR_COVER_LOCKS_MOVE', 'AZIMUTH_AXIS_MOVE', 'AZIMUTH_THERMAL_RESET_ALARM', 'AZIMUTH_CABLE_WRAP_POWER', 'MAIN_POWER_SUPPLY_RESET_ALARM', 'MIRROR_COVERS_DEPLOY', 'ERROR', 'ASK_FOR_SET_OF_SETTINGS', 'ELEVATION_THERMAL_RESET_ALARM', 'CABINET_TRACK_AMBIENT', 'AZIMUTH_AXIS_STOP', 'LOCKING_PINS_STOP', 'ELEVATION_AXIS_DRIVE_ENABLE', 'LOCKING_PINS_MOVE', 'ELEVATION_AXIS_TRACK', 'TOP_END_CHILLER_TRACK_AMBIENT', 'AZIMUTH_CABLE_WRAP_DRIVE_RESET', 'ASK_FOR_COMMAND', 'MIRROR_COVER_LOCKS_RESET_ALARM', 'ENTER_CONTROL', 'STAND_BY', 'DISABLE_CAMERA_WRAP', 'OIL_SUPPLY_SYSTEM_POWER_MAIN_PUMP', 'AZIMUTH_CABLE_WRAP_DRIVE_ENABLE', 'AZIMUTH_THERMAL_TRACK_AMBIENT', 'DISABLE', 'ELEVATION_AXIS_HOME', 'STOP_MOUNT', 'OIL_SUPPLY_SYSTEM_POWER', 'ELEVATION_THERMAL_TRACK_AMBIENT', 'AZIMUTH_CABLE_WRAP_STOP', 'AZIMUTH_CABLE_WRAP_ENABLE_TRACKING', 'BALANCE_MOVE', 'BOTH_AXES_TRACK', 'MOVE_TO_TARGET', 'CLEAR_ERRORS', 'ENABLE', 'AZIMUTH_AXIS_RESET_ALARM', 'CAMERA_CABLE_WRAP_STOP', 'MIRROR_COVER_LOCKS_POWER', 'AZIMUTH_CABLE_WRAP_TRACK', 'SYSTEM_READY', 'ENCODER_INTERFACE_BOX_POWER', 'ENTER_PUBLISHONLY', 'DEPLOYABLE_PLATFORM_LOCK_EXTENSION', 'CAMERA_CABLE_WRAP_RESET_ALARM', 'CAMERA_CABLE_WRAP_ENABLE_TRACKING', 'OVERRIDE_CAUSES', 'ELEVATION_AXIS_POWER', 'PXI_COMMAND_DONE', 'MIRROR_COVER_LOCKS_STOP', 'MIRROR_COVERS_POWER', 'CABINET_RESET_ALARM', 'ENCODER_INTERFACE_BOX_CLEAR_POSITION_ERROR', 'TOP_END_CHILLER_RESET_ALARM', 'ELEVATION_THERMAL_POWER', 'CLOSE_MIRROR_COVER'}
end_tai

Get the end time of the current path, as TAI unix seconds.

power_on

Return true if the device is powered on.

Notes

Override this implementation if the device has multiple subsystems that can individually be powered on.

Methods Documentation

abort()
add_methods()

Add do_methods to the command dict

assert_enabled()

Raise RuntimeError if device is not fully enabled.

To be fully enabled, the device must be on, no alarm present, and the drive enabled.

assert_on()

Raise RuntimeError if device off or in an alarm state.

assert_tracking_enabled(enabled)

Raise RuntimeError if tracking is or is not enabled.

close()

Cancel any background tasks and clean up resources.

do_drive_enable(command)

Enable or disable the drive.

Abort motion and disable tracking.

do_drive_reset(command)

Reset the drive.

The power must be on.

Abort motion, disable tracking, disable the drive.

do_enable_tracking(command)

Enable or disable tracking mode.

The drive must be enabled.

do_home(command)

Home the actuator.

The drive must be enabled and tracking must be disabled.

For sake of doing something vaguely plausible, move to the mid-point of the position limits.

do_move(command)

Set target position.

The drive must be enabled and tracking must be disabled.

Velocity and acceleration limits are not applied, because it is tricky to make sure the values are correctly restored when the move finishes, and the CSC doesn’t support these parameters anyway.

do_move_velocity(command)
do_power(command)
do_reset_alarm(command)
do_stop(command)

Stop the actuator.

do_track(command)

Specify a tracking target position, velocity, and time.

The drive must be enabled and tracking must be enabled.

monitor_move_command(command)

Return a task that is set done when the move is done.

Parameters:
command : Command

Move command.

Returns:
task : asyncio.Task

A task that is set done when the move is done.

move_point_to_point(position, command)

Move to the specified position.

The drive must be enabled and tracking must be disabled.

Parameters:
position : float

Desired position, in degrees.

command : Command

Command to monitor and report done.

Returns:
duration : float

Minimum duration of move (sec)

supersede_move_command()

Report the current move command (if any) as superseded.