MTCS#

class lsst.ts.observatory.control.maintel.MTCS(domain=None, log=None, intended_usage=None)#

Bases: BaseTCS

High level library for the Main Telescope Control System

This is the high level interface for interacting with the CSCs that control the Main Telescope. Essentially this will allow the user to slew and track the telescope.

This is a placeholder for the Main Telescope Class.

Parameters:
  • domain (salobj.Domain) – Domain to use of the Remotes. If None, create a new domain.

  • log (Optional[Logger], default: None)

  • intended_usage (Optional[int], default: None)

Attributes Summary

CoordFrame

Return CoordFrame enumeration.

RotFrame

Return RotFrame enumeration.

RotMode

Return RotMode enumeration.

WrapStrategy

Return WrapStrategy enumeration

compensation_mode_components

Set with the name of the components that support compensation mode.

dome_trajectory_name

Return name of the DomeTrajectory component.

m1m3_engineering_states

M1M3 engineering states.

plate_scale

Plate scale in mm/arcsec.

ptg_name

Return name of the pointing component.

usages

Define class usages.

valid_use_cases

Returns valid usages.

Methods Summary

abort_raise_m1m3()

Abort a raise m1m3 operation.

assert_has_compensation_mode(component)

Assert that component is part of the set of components that supports compensation mode.

assert_m1m3_detailed_state(detailed_states)

Assert that M1M3 detailed state is one of the input set.

assert_m1m3_force_balance_system_enabled()

Assert that the M1M3 force balance system is enabled.

assert_m1m3_slew_controller_settings()

Assert that all M1M3 slew controller flags are enabled.

close_dome([force])

Method to close dome shutter.

close_m1_cover()

Method to close mirror covers.

close_m1m3_booster_valve()

Close M1M3 booster valves.

disable_aos_closed_loop()

disable_ccw_following()

Disable camera cable wrap following the rotator.

disable_compensation_mode(component)

Disable compensation mode for one of the hexapods.

disable_m1m3_balance_system()

Disable m1m3 balance system.

disable_m2_balance_system()

Disable m2 balance system.

dome_az_in_position()

Wait for _dome_az_in_position event to be set and return a string indicating the dome azimuth is in position.

dome_el_in_position()

Wait for _dome_el_in_position event to be set and return a string indicating the dome elevation is in position.

enable_aos_closed_loop(config)

enable_ccw_following()

Enable camera cable wrap following the rotator.

enable_compensation_mode(component)

Enable compensation mode for one of the hexapods.

enable_m1m3_balance_system()

Enable m1m3 balance system.

enable_m2_balance_system()

Enable m2 balance system.

ensure_m1m3_not_in_engineering_mode()

Ensure M1M3 is not in engineering mode.

enter_m1m3_engineering_mode()

Enter M1M3 engineering mode.

exit_m1m3_engineering_mode()

Exit M1M3 engineering mode.

flush_offset_events()

Abstract method to flush events before and offset is performed.

get_bore_sight_angle()

Get the instrument bore sight angle with respect to the telescope axis.

get_compensation_mode_camera_hexapod()

Return the last sample of compensationMode event from camera hexapod.

get_compensation_mode_m2_hexapod()

Return the last sample of compensationMode event from m2 hexapod.

get_critical_components_for_prepare_for_onsky()

get_m1m3_actuator_ids()

Get a list of the M1M3 actuator ids.

get_m1m3_actuator_index(actuator_id)

Convert from actuator_id into actuator index using M1M3 FATable.

get_m1m3_actuator_secondary_ids()

Get a list of the M1M3 actuator secondary ids.

get_m1m3_actuator_secondary_index(actuator_id)

Convert from actuator_id into actuator secondary index using M1M3 FATable.

get_m1m3_actuator_to_test(actuators_to_test)

Given a list of m1m3 actuator to test, generate a list of actuator that can be tested concurrently.

get_m1m3_applied_balance_forces()

Returns the last sample of appliedBalanceForces data from m1m3.

get_m1m3_bump_test_status(actuator_id)

Get latest m1m3 bump test status.

get_m1m3_slew_controller_settings()

Retrieve the current M1M3 slew controller settings.

get_m2_hardpoints()

Retrieve the current list of M2 hardpoints.

handle_aos_close_loop()

Handle MTAOS close loop.

home_both_axes([homing_attempts])

Home both axes of the MTMount with retry logic.

home_dome([physical_az])

Utility method to home dome.

in_m1_cover_operational_range()

Check if MTMount is in safe range for mirror covers operation.

is_actuator_in_testing_state(actuator_data, ...)

is_m1m3_in_engineering_mode()

Check if M1M3 is in engineering mode.

lower_m1m3()

Lower M1M3.

m1m3_booster_valve()

Context manager to handle opening/closing M1M3 booster valves.

m1m3_in_engineering_mode()

Context manager to ensure m1m3 enters and exists engineering mode before/after an operation.

map_slew_setting_to_attribute(setting_enum)

Maps a SetSlewControllerSettings enum to the corresponding attribute returned by the evt_slew_controller_settings.

monitor_position([check])

Monitor MTCS axis position.

move_camera_hexapod(x, y, z, u, v[, w, sync])

Move camera hexapod.

move_m2_hexapod(x, y, z, u, v[, w, sync])

Move m2 hexapod.

move_p2p_azel(az, el[, timeout])

Move telescope using point to point mode.

move_p2p_radec(ra, dec[, timeout])

Move telescope using point to point mode.

move_rotator(position[, wait_for_in_position])

Move rotator to specified position and wait for movement to complete.

next_m1m3_applied_balance_forces(flush)

Returns the next sample of appliedBalanceForces data from m1m3.

offset_camera_hexapod(x, y, z, u, v[, w, sync])

Offset camera hexapod.

offset_done()

Wait for offset events.

offset_m2_hexapod(x, y, z, u, v[, w, sync])

Offset M2 hexapod.

open_dome_shutter([force])

Method to open dome shutter.

open_m1_cover()

Method to open mirror covers.

open_m1m3_booster_valve()

Open M1M3 booster valves.

park_dome()

Park the dome by moving it to the park azimuth.

park_mount(position)

Park the TMA in the selected position.

prepare_for_flatfield([check, homing_attempts])

Prepare Simonyi Telescope for flat-field operations.

prepare_for_onsky([overrides, homing_attempts])

Prepare Simonyi Telescope for on-sky operations

raise_m1m3()

Raise M1M3.

ready_to_offset()

Make sure telescope is ready to perform an offset.

reset_camera_hexapod_position()

Reset position of the camera hexapod.

reset_m1m3_forces()

Reset M1M3 forces.

reset_m2_forces()

Reset M2 forces.

reset_m2_hexapod_position()

Reset position of the M2 hexapod.

run_m1m3_actuator_bump_test(actuator_id[, ...])

M1M3 actuator bump test.

run_m1m3_hard_point_test(hp)

Test an M1M3 hard point.

run_m2_actuator_bump_test(actuator, force[, ...])

M2 actuator bump test.

set_azel_slew_checks(wait_dome)

Handle azEl slew to wait or not for the dome.

set_m1m3_slew_controller_settings(...)

Set a specific M1M3 slew controller setting based on the provided enumeration.

shutdown()

Shutdown components.

slew_dome_to(az[, check, timeout])

Utility method to slew dome to a specified position.

slew_to_m1_cover_operational_range()

Slew the telescope to safe range for mirror covers operation.

stop_all()

Stop telescope and dome.

stop_m1m3_bump_test()

Stop bump test.

stop_m1m3_hard_point_test(hp)

Interrupt hard point test.

stop_m2_bump_test()

Stop the M2 actuator bump test.

stop_rotator()

Stop rotator movement and wait for controller to publish Stationary substate event.

unpark_dome()

Un-Park the dome by moving it a small delta amount.

unpark_mount()

Un-park the TMA.

wait_for_dome_inposition(timeout[, wait_settle])

Wait for the Dome to be in position.

wait_for_dome_state(expected_states, ...[, ...])

Wait for a specific dome state.

wait_for_inposition(timeout[, wait_settle, ...])

Wait for Mount, Dome and Rotator to be in position.

wait_for_mtmount_inposition(timeout[, ...])

Wait for the MTMount inPosition event.

wait_for_rotator_inposition(timeout[, ...])

Wait for the Rotator inPosition event.

wait_for_shutter_close_state(timeout)

Wait until both shutter doors are in closed-like state.

wait_for_shutter_open_state(timeout)

Wait until both shutter doors are in open-like state.

wait_m1m3_actuator_in_testing_state(actuator)

Wait until the specified actuator enters testing state.

wait_m1m3_force_balance_system(timeout)

Wait for m1m3 force balance system to stabilize.

wait_m1m3_settle()

Wait until m1m3 has settle.

wait_tracking_stopped()

Wait until the mount and rotator reports that they have stopped tracking.

Attributes Documentation

CoordFrame#

Return CoordFrame enumeration.

RotFrame#

Return RotFrame enumeration.

RotMode#

Return RotMode enumeration.

WrapStrategy#

Return WrapStrategy enumeration

compensation_mode_components#

Set with the name of the components that support compensation mode.

dome_trajectory_name#

Return name of the DomeTrajectory component.

m1m3_engineering_states#

M1M3 engineering states.

Returns:

Set with the M1M3 detailed states.

Return type:

set`[ `MTM1M3.DetailedStates ]

plate_scale#

Plate scale in mm/arcsec.

ptg_name#

Return name of the pointing component.

usages#
valid_use_cases#

Returns valid usages.

Returns:

usages

Return type:

enum

Methods Documentation

async abort_raise_m1m3()#

Abort a raise m1m3 operation.

Return type:

None

assert_has_compensation_mode(component)#

Assert that component is part of the set of components that supports compensation mode.

Parameters:

component (str) – Name of the component

Raises:

AssertionError – If component does not support compensation mode or if it is not a valid MTCS component.

Return type:

None

async assert_m1m3_detailed_state(detailed_states)#

Assert that M1M3 detailed state is one of the input set.

Parameters:

detailed_states (set[DetailedStates])

Return type:

None

async assert_m1m3_force_balance_system_enabled()#

Assert that the M1M3 force balance system is enabled.

This method checks the current state of the M1M3 force balance system (hardpoint corrections) and raises an error if it is not enabled.

Raises:

RuntimeError – If the force balance system is not enabled.

Return type:

None

async assert_m1m3_slew_controller_settings()#

Assert that all M1M3 slew controller flags are enabled.

This method checks the current state of the M1M3 slew controller settings and returns a list of warning messages for any flags that are not enabled.

Returns:

List of warning messages for flags that are not enabled. Empty list if all flags are enabled.

Return type:

list of str

async close_dome(force=False)#

Method to close dome shutter.

Warning

The dome shutter should not be closed when the mirror covers are retracted. This method will check if the covers are deployed or if the telescope is in a safe elevation to continue.

Raises:

RuntimeError – If shutter motion state is neither OPEN nor CLOSED. If mirror covers are RETRACTED and telescope elevation is not in safe range unless force=True.

Parameters:

force (bool, default: False)

Return type:

None

async close_m1_cover()#

Method to close mirror covers. :rtype: None

Warning

The mirror covers should be closed when the telescope is pointing to the zenith. The method will check if the telescope is in an operational range and, if not, will move the telescope to an operational elevation, maintaining the same azimuth before closing the mirror cover. The telescope will be left in that same position in the end.

Raises:

RuntimeError – If mirror covers state is neither DEPLOYED nor RETRACTED. If mirror system state is FAULT.

async close_m1m3_booster_valve()#

Close M1M3 booster valves.

Return type:

None

async disable_aos_closed_loop()#
Return type:

None

async disable_ccw_following()#

Disable camera cable wrap following the rotator.

Return type:

None

async disable_compensation_mode(component)#

Disable compensation mode for one of the hexapods.

Parameters:

component (str) – Name of the component

Return type:

None

See also

enable_compensation_mode

Enable compensation mode.

compensation_mode_components

Set of components with compensation mode.

async disable_m1m3_balance_system()#

Disable m1m3 balance system.

Return type:

None

async disable_m2_balance_system()#

Disable m2 balance system.

Return type:

None

async dome_az_in_position()#

Wait for _dome_az_in_position event to be set and return a string indicating the dome azimuth is in position.

Return type:

str

async dome_el_in_position()#

Wait for _dome_el_in_position event to be set and return a string indicating the dome elevation is in position.

Return type:

str

async enable_aos_closed_loop(config)#
Parameters:

config (dict)

Return type:

None

async enable_ccw_following()#

Enable camera cable wrap following the rotator.

Return type:

None

async enable_compensation_mode(component)#

Enable compensation mode for one of the hexapods.

Parameters:

component (str) – Name of the component. Must be in compensation_mode_components.

Return type:

None

See also

disable_compensation_mode

Disable compensation mode.

compensation_mode_components

Set of components with compensation mode.

async enable_m1m3_balance_system()#

Enable m1m3 balance system.

Return type:

None

async enable_m2_balance_system()#

Enable m2 balance system.

Return type:

None

async ensure_m1m3_not_in_engineering_mode()#

Ensure M1M3 is not in engineering mode.

If M1M3 is in engineering mode, this method will exit engineering mode. If M1M3 is not in engineering mode, this method does nothing.

Return type:

None

async enter_m1m3_engineering_mode()#

Enter M1M3 engineering mode.

Return type:

None

async exit_m1m3_engineering_mode()#

Exit M1M3 engineering mode.

Return type:

None

flush_offset_events()#

Abstract method to flush events before and offset is performed.

Return type:

None

async get_bore_sight_angle()#

Get the instrument bore sight angle with respect to the telescope axis.

Return type:

float

async get_compensation_mode_camera_hexapod()#

Return the last sample of compensationMode event from camera hexapod.

Return type:

MTHexapod_logevent_compensationMode

async get_compensation_mode_m2_hexapod()#

Return the last sample of compensationMode event from m2 hexapod.

Return type:

MTHexapod_logevent_compensationMode

static get_critical_components_for_prepare_for_onsky()#
Return type:

list[str]

get_m1m3_actuator_ids()#

Get a list of the M1M3 actuator ids.

Returns:

List of M1M3 actuator ids.

Return type:

list`[ `int ]

get_m1m3_actuator_index(actuator_id)#

Convert from actuator_id into actuator index using M1M3 FATable.

Parameters:

actuator_id (int) – Actuator id.

Returns:

actuator_index – Array index of actuator.

Return type:

int

Raises:

RuntimeError – If actuator_id is not valid.

See also

get_m1m3_actuator_secondary_index

Get m1m3 actuator secondary index from actuator secondary id.

get_m1m3_actuator_secondary_ids()#

Get a list of the M1M3 actuator secondary ids.

Returns:

List of M1M3 actuator secondary ids.

Return type:

list`[ `int ]

get_m1m3_actuator_secondary_index(actuator_id)#

Convert from actuator_id into actuator secondary index using M1M3 FATable.

Parameters:

actuator_id (int) – Actuator id.

Returns:

actuator_index – Secondary array index of actuator.

Return type:

int

Raises:

RuntimeError – If actuator_id is not valid.

See also

get_m1m3_actuator_index

Get m1m3 actuator index from actuator id.

async get_m1m3_actuator_to_test(actuators_to_test)#

Given a list of m1m3 actuator to test, generate a list of actuator that can be tested concurrently.

Yields:

int – Id of the next suitable M1M3 actuator to test.

Parameters:

actuators_to_test (list[int])

Return type:

AsyncGenerator[ForceActuatorData, None]

async get_m1m3_applied_balance_forces()#

Returns the last sample of appliedBalanceForces data from m1m3.

Return type:

MTM1M3_logevent_appliedBalanceForces or MTM1M3_appliedBalanceForces

async get_m1m3_bump_test_status(actuator_id)#

Get latest m1m3 bump test status.

Parameters:

actuator_id (int) – Id of the actuator.

Return type:

tuple[BumpTest, BumpTest | None]

Returns:

  • primary_status (MTM1M3.BumpTest) – Status of the primary (z-axis) test.

  • secondary_status (MTM1M3.BumpTest | None) – Status of the secondary (xy-axis) test.

async get_m1m3_slew_controller_settings()#

Retrieve the current M1M3 slew controller settings.

Returns:

A dictionary containing the current settings, where the keys are the names used in the SetSlewControllerSettings enumeration.

Return type:

dict

Raises:

RuntimeError – If the expected attribute is not found in the event.

async get_m2_hardpoints()#

Retrieve the current list of M2 hardpoints.

Returns:

List of M2 hardpoints.

Return type:

list [ int ]

async handle_aos_close_loop()#

Handle MTAOS close loop.

This method checks if MTAOS corrections are ready to be applied and instruct the MTAOS to apply them.

It is a no-op if MTAOS is idle.

Return type:

None

async home_both_axes(homing_attempts=10)#

Home both axes of the MTMount with retry logic.

This method attempts to home both axes multiple times, checking that MTMount is enabled and M1M3 is raised before each attempt. The M1M3 booster valve is activated during homing to protect the mirror.

Parameters:

homing_attempts (int, optional) – Number of attempts to home both axes (default: 10, minimum: 1).

Raises:

RuntimeError – If MTMount is not enabled. If M1M3 is not raised (ACTIVE or ACTIVEENGINEERING). If homing fails after all attempts.

Return type:

None

async home_dome(physical_az=0.0)#

Utility method to home dome.

Parameters:

physical_az (float) – Azimuth angle of the dome as read by markings (in deg).

Return type:

None

async in_m1_cover_operational_range()#

Check if MTMount is in safe range for mirror covers operation.

Returns:

elevation_in_range – Returns True when telescope elevation is in safe range for mirror covers operation.

Return type:

bool

is_actuator_in_testing_state(actuator_data, bump_test_status)#
Parameters:
  • actuator_data (ForceActuatorData)

  • bump_test_status (BaseMsgType)

Return type:

bool

async is_m1m3_in_engineering_mode()#

Check if M1M3 is in engineering mode.

Returns:

True if M1M3 in engineering mode, False otherwise.

Return type:

bool

async lower_m1m3()#

Lower M1M3.

Return type:

None

m1m3_booster_valve()#

Context manager to handle opening/closing M1M3 booster valves.

Return type:

AsyncIterator[None]

m1m3_in_engineering_mode()#

Context manager to ensure m1m3 enters and exists engineering mode before/after an operation.

If M1M3 is in engineering mode before, this context manager is a nop, e.g. it will leave M1M3 in engineering mode afterwards.

Return type:

AsyncIterator[None]

map_slew_setting_to_attribute(setting_enum)#

Maps a SetSlewControllerSettings enum to the corresponding attribute returned by the evt_slew_controller_settings.

Parameters:

setting_enum (MTM1M3.SetSlewControllerSettings) – The enum member to be mapped.

Returns:

The corresponding attribute name.

Return type:

str

async monitor_position(check=None)#

Monitor MTCS axis position.

Monitor/log a selected set of axis from the main telescope. This is useful during slew activities to make sure everything is going as expected.

Parameters:

check (types.SimpleNamespace or None) – Override self.check for defining which resources are used.

Return type:

None

async move_camera_hexapod(x, y, z, u, v, w=0.0, sync=True)#

Move camera hexapod.

When the camera hexapod compensation mode is on, move it to a new position relative to the LUT. When the camera hexapod compensation mode is off, move it to a new absolute position.

Parameters:
  • x (float) – Hexapod-x position (microns).

  • y (float) – Hexapod-y position (microns).

  • z (float) – Hexapod-z position (microns).

  • u (float) – Hexapod-u angle (degrees).

  • v (float) – Hexapod-v angle (degrees).

  • w (float, optional) – Hexapod-w angle (degrees). Default 0.

  • sync (bool, optional) – Should the hexapod movement be synchronized? Default True.

Return type:

None

async move_m2_hexapod(x, y, z, u, v, w=0.0, sync=True)#

Move m2 hexapod.

When the m2 hexapod compensation mode is on, move it to a new position relative to the LUT. When the m2 hexapod compensation mode is off, move it to a new absolute position.

Parameters:
  • x (float) – Hexapod-x position (microns).

  • y (float) – Hexapod-y position (microns).

  • z (float) – Hexapod-z position (microns).

  • u (float) – Hexapod-u angle (degrees).

  • v (float) – Hexapod-v angle (degrees).

  • w (float, optional) – Hexapod-w angle (degrees). Default 0.

  • sync (bool, optional) – Should the hexapod movement be synchronized? Default True.

Return type:

None

async move_p2p_azel(az, el, timeout=120.0)#

Move telescope using point to point mode.

Parameters:
  • az (float) – Azimuth (in deg).

  • el (float) – Elevation (in deg).

  • timeout (float, optional) – Timeout for positioning the telescope, by default=120.0 (in seconds).

Return type:

None

async move_p2p_radec(ra, dec, timeout=120.0)#

Move telescope using point to point mode.

Telescope will not track after getting in position.

Parameters:
  • ra (float) – Desired right ascension (in hours).

  • dec (float) – Desired declination (in deg).

  • timeout (float, optional) – Timeout for positioning the telescope, by default 120.0 (in seconds)

Return type:

None

async move_rotator(position, wait_for_in_position=True)#

Move rotator to specified position and wait for movement to complete.

Parameters:
  • position (float) – Desired rotator position (deg).

  • wait_for_in_position (bool, optional) – Wait for rotator to reach desired position before returning the function? Default True.

Raises:

RuntimeError – If CCW following is disabled and check MTMount is enabled.

Return type:

None

async next_m1m3_applied_balance_forces(flush)#

Returns the next sample of appliedBalanceForces data from m1m3.

Parameters:

flush (bool) – Flush the topic queue before getting the next sample?

Return type:

MTM1M3_logevent_appliedBalanceForces or MTM1M3_appliedBalanceForces

async offset_camera_hexapod(x, y, z, u, v, w=0.0, sync=True)#

Offset camera hexapod.

Offsets are always relative to the current hexapod position, regardless of the compensation mode being on or off.

Parameters:
  • x (float) – Hexapod-x position (microns).

  • y (float) – Hexapod-y position (microns).

  • z (float) – Hexapod-z position (microns).

  • u (float) – Hexapod-u angle (degrees).

  • v (float) – Hexapod-v angle (degrees).

  • w (float, optional) – Hexapod-w angle (degrees). Default 0.

  • sync (bool, optional) – Should the hexapod movement be synchronized? Default True.

Return type:

None

async offset_done()#

Wait for offset events.

Return type:

None

async offset_m2_hexapod(x, y, z, u, v, w=0.0, sync=True)#

Offset M2 hexapod.

Offsets are always relative to the current hexapod position, regardless of the compensation mode being on or off.

Parameters:
  • x (float) – Hexapod-x position (microns).

  • y (float) – Hexapod-y position (microns).

  • z (float) – Hexapod-z position (microns).

  • u (float) – Hexapod-u angle (degrees).

  • v (float) – Hexapod-v angle (degrees).

  • w (float, optional) – Hexapod-w angle (degrees). Default 0.

  • sync (bool, optional) – Should the hexapod movement be synchronized? Default True.

Return type:

None

async open_dome_shutter(force=False)#

Method to open dome shutter.

Warning

The dome shutter should not be opened when the mirror covers are retracted. This method will check if the covers are deployed or if the telescope is in a safe elevation to continue.

Raises:

RuntimeError – If shutter motion state is neither OPEN nor CLOSED. If mirror covers are RETRACTED and telescope elevation is not in safe range unless force=True.

Parameters:

force (bool, default: False)

Return type:

None

async open_m1_cover()#

Method to open mirror covers. :rtype: None

Warning

The mirror covers should be opened when the telescope is pointing to the zenith. The method will check if the telescope is in an operational range and, if not, will move the telescope to an operational elevation, maintaining the same azimuth before opening the mirror cover. The telescope will be left in that same position in the end.

Raises:

RuntimeError – If mirror covers state is neither DEPLOYED nor RETRACTED. If mirror system state is FAULT.

async open_m1m3_booster_valve()#

Open M1M3 booster valves.

Return type:

None

async park_dome()#

Park the dome by moving it to the park azimuth.

Return type:

None

async park_mount(position)#

Park the TMA in the selected position.

Parameters:

position (MTMount.ParkPosition) – The position to park the TMA.

Return type:

None

async prepare_for_flatfield(check=None, homing_attempts=10)#

Prepare Simonyi Telescope for flat-field operations.

This method performs an end-to-end operation to prepare the MTCS components for in dome flat-field. It is mostly used at the end of the night to prepare the telescope for flat-field calibration, but can be also used during the day.

The high-level steps are:

  1. Enable all MTCS components (no-op if already enabled).

  2. Enable the M2 balance system.

  3. Close mirror covers, then close the dome shutter.

  4. Park the dome.

  5. Check elevation and raise M1M3 if safe; otherwise fail.

  6. Assert M1M3 force balance system is enabled.

  7. Open mirror covers for calibration.

  8. Disable dome following (if not ignored).

  9. Home both mount axes (with retry logic).

  10. Enable camera cable wrap following.

  11. Enable hexapod compensation mode if not ignored.

  12. Slew to the flat-field target (rotator at 0 deg).

  13. Stop tracking.

  14. Ensure M1M3 is not in engineering mode.

Parameters:
  • check (types.SimpleNamespace or None) – Override self.check for defining which resources are used.

  • homing_attempts (int, optional) – Number of attempts to home both axes (default: 10).

Return type:

None

async prepare_for_onsky(overrides=None, homing_attempts=10)#

Prepare Simonyi Telescope for on-sky operations

This method performs the start-of-night procedure for the MTCS components. The high-level steps are:

  1. Assert that all MTCS components are enabled.

  2. Assert that critical components are not ignored.

  3. Slew the dome to the open position (az=150).

  4. Ensure the M2 balance system is enabled.

  5. Check telescope elevation and raise M1M3 if safe.

  6. Assert M1M3 force balance system is enabled.

  7. Assert M1M3 slew controller flags are enabled (warning if not).

  8. Home both axes of the mount (with retry logic).

  9. Enable camera cable wrap following.

  10. Enable hexapod compensation mode if not ignored.

  11. Slew the telescope to the open position (az=150, el=70). Rotator set to 0 deg.

  12. Stop tracking.

  13. Ensure mirror covers are closed before opening the dome.

  14. Open the dome shutter.

  15. Open the mirror covers.

  16. Enable dome following if not ignored.

  17. Ensure M1M3 is not in engineering mode.

Parameters:
  • overrides (Optional[Dict[str, str]], optional) – Dictionary of component overrides, by default None

  • homing_attempts (int, optional) – Number of attempts to home both axes (default: 10).

Return type:

None

async raise_m1m3()#

Raise M1M3.

Return type:

None

ready_to_offset()#

Make sure telescope is ready to perform an offset.

Overrides the parent class to implement setting/unsetting the slew flag on m1m3.

Return type:

AsyncIterator[None]

async reset_camera_hexapod_position()#

Reset position of the camera hexapod.

Return type:

None

async reset_m1m3_forces()#

Reset M1M3 forces.

Return type:

None

async reset_m2_forces()#

Reset M2 forces.

Return type:

None

async reset_m2_hexapod_position()#

Reset position of the M2 hexapod.

Return type:

None

async run_m1m3_actuator_bump_test(actuator_id, primary=True, secondary=False)#

M1M3 actuator bump test.

Parameters:
  • actuator_id (int) – Id of the actuator.

  • primary (bool, optional) – Test primary (z) actuator (default=True)?

  • secondary (bool, optional) – Test secondary (x/y) actuators (default=False)?

Return type:

None

async run_m1m3_hard_point_test(hp)#

Test an M1M3 hard point.

Parameters:

hp (int) – Id of the hard point to test (start at 1).

Return type:

None

async run_m2_actuator_bump_test(actuator, force, period=60)#

M2 actuator bump test.

Parameters:
  • actuator (int) – Id of the actuator.

  • force (float) – the +/- push/pull foce to be applied in N

  • period (float, optional) – There will be two bumps and each bump will wait for (2 * period) seconds. Default time is 60 seconds.

Return type:

None

set_azel_slew_checks(wait_dome)#

Handle azEl slew to wait or not for the dome.

Parameters:

wait_dome (bool) – Should the slew wait for the dome?

Returns:

check – Reformated check namespace.

Return type:

types.SimpleNamespace

async set_m1m3_slew_controller_settings(slew_setting, enable_slew_management)#

Set a specific M1M3 slew controller setting based on the provided enumeration.

Parameters:
  • slew_setting (enum.IntEnum) – The specific force component setting to be changed.

  • enable_slew_management (bool) – True to enable, False to disable the specified force component controlled by the slew controller.

Return type:

None

async shutdown()#

Shutdown components.

Return type:

None

async slew_dome_to(az, check=None, *, timeout=None)#

Utility method to slew dome to a specified position.

Parameters:
  • az (float or str) – Azimuth angle for the dome (in deg).

  • check (types.SimpleNamespace or None) – Override self.check for defining which resources are used.

  • timeout (float, optional) – How long to wait for dome to arrive in position. Defaults to self.move_dome_timeout if not provided.

Raises:

RuntimeError – If the mtdometrajectory is ignored while the dome following is enabled. This is to prevent conflicts between the dome trajectory and the dome following features, which could result in unexpected behavior while slewing the dome.

Return type:

None

async slew_to_m1_cover_operational_range()#

Slew the telescope to safe range for mirror covers operation.

This method will slew the telescope to a safe elevation to perform mirror covers operations. It should be used in combination with the in_m1_covers_operational_range method.

Return type:

None

async stop_all()#

Stop telescope and dome.

Return type:

None

async stop_m1m3_bump_test()#

Stop bump test.

Return type:

None

async stop_m1m3_hard_point_test(hp)#

Interrupt hard point test.

Parameters:

hp (int) – Id of the hard point for which the test is to be interrupted (start at 1).

Return type:

None

async stop_m2_bump_test()#

Stop the M2 actuator bump test.

Raises:

NotImplementedError – This method is not currently implemented.

Return type:

None

async stop_rotator()#

Stop rotator movement and wait for controller to publish Stationary substate event.

Return type:

None

async unpark_dome()#

Un-Park the dome by moving it a small delta amount.

Return type:

None

async unpark_mount()#

Un-park the TMA.

Return type:

None

async wait_for_dome_inposition(timeout, wait_settle=True)#

Wait for the Dome to be in position.

Parameters:
  • timeout (float) – How to wait for mount to be in position (in seconds).

  • wait_settle (bool) – After receiving the in position command, add an additional settle wait? (default: True)

Returns:

ret_val – String indicating that dome is in position.

Return type:

str

async wait_for_dome_state(expected_states, bad_states, timeout, check_in_position=False)#

Wait for a specific dome state.

Parameters:
  • expected_states (set[MTDome.MotionState]) – Valid states to transition into while un-parking.

  • bad_states (set[MTDome.MotionState]) – States that are not allowed while un-parking and should raise an error.

  • timeout (float) – Maximum time to wait for the correct state.

  • check_in_position (bool, default: False)

Raises:

RuntimeError – If a bad state is encountered or the expected state is not reached in time.

Return type:

None

async wait_for_inposition(timeout, wait_settle=True, check=None)#

Wait for Mount, Dome and Rotator to be in position.

Parameters:
  • timeout (float) – How long should it wait before timing out.

  • wait_settle (bool) – After slew complets, add an addional settle wait before returning.

  • check (types.SimpleNamespace or None) – Override self.check for defining which resources are used.

Returns:

status – String with final status.

Return type:

list of str

async wait_for_mtmount_inposition(timeout, wait_settle=True)#

Wait for the MTMount inPosition event.

Parameters:
  • timeout (float) – How to to wait for mount to be in position (in seconds).

  • wait_settle (bool) – After receiving the in position command add an addional settle wait? (default: True)

Return type:

None

async wait_for_rotator_inposition(timeout, wait_settle=True)#

Wait for the Rotator inPosition event.

Parameters:
  • timeout (float) – How to to wait for mount to be in position (in seconds).

  • wait_settle (bool) – After receiving the in position command add an addional settle wait? (default: True)

Returns:

Message indicating the component is in position.

Return type:

str

async wait_for_shutter_close_state(timeout)#

Wait until both shutter doors are in closed-like state.

This waits on MTDome.evt_shutterMotion and treats a door as “closed-like” when its MotionState is in {CLOSED, STOPPED_BRAKED}.

Parameters:

timeout (float) – Maximum time to wait for convergence to the accepted states.

Raises:

RuntimeError – If a bad state is observed while waiting.

Return type:

None

async wait_for_shutter_open_state(timeout)#

Wait until both shutter doors are in open-like state.

This waits on MTDome.evt_shutterMotion and treats a door as “open-like” when its MotionState is in {OPEN, STOPPED_BRAKED}.

Parameters:

timeout (float) – Maximum time to wait for convergence to the accepted states.

Raises:

RuntimeError – If a bad state is observed while waiting.

Return type:

None

async wait_m1m3_actuator_in_testing_state(actuator)#

Wait until the specified actuator enters testing state.

Parameters:

actuator (ForceActuatorData) – Metadata about the actuator to wait for.

Return type:

None

async wait_m1m3_force_balance_system(timeout)#

Wait for m1m3 force balance system to stabilize.

Parameters:

timeout (float) – How long to wait before timing out (in seconds).

Return type:

None

async wait_m1m3_settle()#

Wait until m1m3 has settle.

Return type:

None

async wait_tracking_stopped()#

Wait until the mount and rotator reports that they have stopped tracking.

Return type:

None