ATCS#

class lsst.ts.observatory.control.auxtel.ATCS(domain=None, log=None, intended_usage=None)#

Bases: BaseTCS

High level library for the Auxiliary Telescope Control System

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

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

  • log (logging.Logger) – Optional logging class to be used for logging operations. If None, creates a new logger. Useful to use in salobj.BaseScript and allow logging in the class use the script logging.

  • intended_usage (int) – Optional integer that maps to a list of intended operations. This is used to limit the resources allocated by the class by gathering some knowledge about the usage intention. By default allocates all resources.

atmcs#
Type:

salobj.Remote

ataos#
Type:

salobj.Remote

atpneumatics#
Type:

salobj.Remote

athexapod#
Type:

salobj.Remote

atdome#
Type:

salobj.Remote

atdometrajectory#
Type:

salobj.Remote

check#
Type:

SimpleNamespace

log#
Type:

logging.Logger

Attributes Summary

CoordFrame

Return CoordFrame enumeration.

RotFrame

Return RotFrame enumeration.

RotMode

Return RotMode enumeration.

WrapStrategy

Return WrapStrategy enumeration

dome_trajectory_name

Return name of the DomeTrajectory component.

plate_scale

Plate scale in mm/arcsec.

ptg_name

Return name of the pointing component.

telescope_position

telescope_target

usages

Define class usages.

valid_use_cases

Returns valid usages.

Methods Summary

assert_ataos_corrections_enabled()

Assert that m1, hexapod and atspectrograph corrections are enabled.

assert_m1_correction_disabled([message])

Assert that m1 corrections is disabled.

ataos_corrections_completed()

Check that all ATAOS corrections completed.

atmcs_in_position()

Check if atmcs is in position.

atmcs_target_callback(data)

Callback function to update the telescope target event topic.

check_target_status()

Check the targeting status of the atmcs.

close_dome([force])

Task to close ATDome.

close_dropout_door()

Close ATDome dropout door

close_m1_cover()

Task to close m1 cover.

close_m1_vent()

Task to open m1 vents.

disable_ataos_corrections([ignore_fail])

Disable ATAOS corrections.

enable_ataos_corrections()

Enable ATAOS corrections.

enable_monitor()

Enable monitor.

flush_offset_events()

Implement abstract method to flush events before an offset is performed.

focus_offset(offset)

Apply focus offset.

get_bore_sight_angle()

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

get_selected_nasmyth_angle()

Get selected nasmyth angle.

home_dome([force])

Task to execute dome home command and wait for it to complete.

in_pneumatics_operational_range()

Check if ATMCS is in operational range for pneumatics operation.

is_dome_homed()

Verify if the dome is homed.

is_monitor_enabled()

Is monitor position flag enabled?

monitor_position([check])

Monitor and log the position of the telescope and the dome.

mount_AzEl_Encoders_callback(data)

Callback function to update the telescope position telemetry topic.

next_telescope_position([timeout])

Wait for next telescope position to become available and return data.

next_telescope_target([timeout])

Wait for next telescope position to become available and return data.

offset_aos_lut([z, x, y, u, v, m1, ...])

Apply offsets to hexapod and optionally re-center telescope after hexapod offset.

offset_done()

Wait for events specifying that an offset completed.

open_dome_shutter()

Task to open dome shutter and return when it is done.

open_dropout_door()

Open ATdome dropout door.

open_m1_cover()

Task to open m1 cover.

open_m1_vent()

Task to open m1 vents.

open_valve_instrument()

Open ATPneumatics instrument valve.

open_valve_main()

Open ATPneumatics main valve.

open_valves()

Open the air valve system on ATPneumatics.

prepare_for_flatfield([check])

A high level method to position the telescope and dome for flat field operations.

prepare_for_onsky([overrides])

Prepare Auxiliary Telescope for on-sky operations.

prepare_for_vent([partially_open_dome])

Prepare Auxiliary Telescope for venting.

set_azel_slew_checks(wait_dome)

Handle azEl slew to wait or not for the dome.

shutdown()

Shutdown ATTCS components.

slew_dome_to(az[, check, timeout])

Utility method to slew dome to a specified position.

slew_to_pneumatics_operational_range()

Slew the telescope to safe range for pneumatics operation.

stop_all()

Stop telescope and dome.

stop_dome()

Stop all dome motion.

stop_monitor()

Stop any monitor position.

stop_tracking()

Task to stop telescope tracking.

wait_for_atdome_inposition(timeout)

Wait until the telescope is cleared by the dome.

wait_for_atdome_shutter_inposition()

Wait for the atdome shutter to be in position.

wait_for_atmcs_inposition(timeout)

Wait for inPosition of atmcs to be ready.

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

Wait for both the ATMCS and ATDome to be in position.

Attributes Documentation

CoordFrame#

Return CoordFrame enumeration.

RotFrame#

Return RotFrame enumeration.

RotMode#

Return RotMode enumeration.

WrapStrategy#

Return WrapStrategy enumeration

dome_trajectory_name#

Return name of the DomeTrajectory component.

plate_scale#

Plate scale in mm/arcsec.

ptg_name#

Return name of the pointing component.

telescope_position#
telescope_target#
usages#
valid_use_cases#

Returns valid usages.

When subclassing, overwrite this method to return the proper enum.

Returns:

usages

Return type:

enum

Methods Documentation

async assert_ataos_corrections_enabled()#

Assert that m1, hexapod and atspectrograph corrections are enabled.

Raises:

AssertionError – If ATAOS m1, hexapod, or atspectrograph corrections are disabled.

Return type:

None

async assert_m1_correction_disabled(message='')#

Assert that m1 corrections is disabled.

Parameters:

message (str) – Additional message to append to error.

Raises:

AssertionError – If ATAOS m1 corrections are enabled.

Return type:

None

async ataos_corrections_completed()#

Check that all ATAOS corrections completed.

Returns:

corrections_completed – Returns True when corrections are completed.

Return type:

bool

Raises:

RuntimeError: – If the last atspectrographCorrectionCompleted event was published before the last atspectrographCorrectionStarted and a timeout happens when waiting for a new atspectrographCorrectionCompleted.

async atmcs_in_position()#

Check if atmcs is in position.

This method will try to get the next event published after the call. If it fails, it will return the last event seen. If no event was ever seen, it will fail with a TimeoutError.

Returns:

in_position – In position flag value.

Return type:

bool

async atmcs_target_callback(data)#

Callback function to update the telescope target event topic.

Parameters:

data (BaseMsgType)

Return type:

None

async check_target_status()#

Check the targeting status of the atmcs.

Return type:

None

async close_dome(force=True)#

Task to close ATDome.

Parameters:

force (bool) – Close the dome shutter even if the method is unable to determine the state of m1 cover and/or the mirror is open.

Return type:

None

async close_dropout_door()#

Close ATDome dropout door

Return type:

None

async close_m1_cover()#

Task to close m1 cover. :rtype: None

Warning

The Mirror cover can only be closed if the telescope is pointing above self.tel_el_operate_pneumatics (=70 degrees). 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.

async close_m1_vent()#

Task to open m1 vents.

Return type:

None

async disable_ataos_corrections(ignore_fail=True)#

Disable ATAOS corrections.

Parameters:

ignore_fail (bool, default: True)

Return type:

None

async enable_ataos_corrections()#

Enable ATAOS corrections.

Return type:

None

enable_monitor()#

Enable monitor.

Return type:

None

flush_offset_events()#

Implement abstract method to flush events before an offset is performed. :rtype: None

See also

offset_done

Wait for events that mark an offset as completed.

offset_azel

Offset in local AzEl coordinates.

offset_xy

Offset in terms of boresight.

offset_radec

Offset in sky coordinates.

async focus_offset(offset)#

Apply focus offset.

Returns after offset is aplied.

Parameters:

offset (float) – Offset in mm.

Return type:

None

async get_bore_sight_angle()#

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

This method also determines the parity of the x-axis based on the currently selected focus.

Returns:

angle – Bore sight angle.

Return type:

float

async get_selected_nasmyth_angle()#

Get selected nasmyth angle.

Check which nasmyth port is selected and return its current position. If it cannot determine the current nasmyth, issue a warning and uses port 2, if self.parity_x == -1, or port 1, otherwise.

Returns:

nasmyth_angle – Calculated angle of the current selected nasmyth port.

Return type:

float

Raises:

RuntimeError: – If cannot get mount_Nasmyth_Encoders.

async home_dome(force=False)#

Task to execute dome home command and wait for it to complete.

Parameters:

force (bool, optional) – Force dome to be homed even if it is already homed (default=False).

Return type:

None

async in_pneumatics_operational_range()#

Check if ATMCS is in operational range for pneumatics operation.

Returns:

elevation_in_range – Returns True when telecsope elevation is in safe range for pneumatics operation.

Return type:

bool

async is_dome_homed()#

Verify if the dome is homed.

Returns:

dome_homedTrue if dome is homed, False otherwise.

Return type:

bool

is_monitor_enabled()#

Is monitor position flag enabled?

Return type:

bool

async monitor_position(check=None)#

Monitor and log the position of the telescope and the dome.

Parameters:

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

Return type:

None

async mount_AzEl_Encoders_callback(data)#

Callback function to update the telescope position telemetry topic.

Parameters:

data (BaseMsgType)

Return type:

None

async next_telescope_position(timeout=None)#

Wait for next telescope position to become available and return data.

Parameters:

timeout (float) – How long to wait for target to arrive (in seconds). Default is None, which means, wait for ever.

Returns:

data

Return type:

ATMCS_tel_mount_AzEl_Encoders

Raises:

asyncio.TimeoutError – If no new data is seen in less then timeout seconds.

async next_telescope_target(timeout=None)#

Wait for next telescope position to become available and return data.

Parameters:

timeout (float) – How long to wait for target to arrive (in seconds). Default is None, which means, wait for ever.

Returns:

data

Return type:

ATMCS_tel_mount_AzEl_Encoders

Raises:

asyncio.TimeoutError – If no new data is seen in less then timeout seconds.

async offset_aos_lut(z=0.0, x=0.0, y=0.0, u=0.0, v=0.0, m1=0.0, offset_telescope=True)#

Apply offsets to hexapod and optionally re-center telescope after hexapod offset.

Parameters:
  • z (float, optional) – Hexapod offset in z axis (mm)

  • x (float, optional) – Hexapod offset in x axis (mm)

  • y (float, optional) – Hexapod offset in y axis (mm)

  • u (float, optional) – Hexapod Rx offset (deg)

  • v (float, optional) – Hexapod Ry offset (deg)

  • m1 (float, optional) – M1 pressure offset (Pa). Must be less than 0.

  • offset_telescope (bool, optional) – Offset the telescope after the hexpod offset to compensate for chage in pointing.

Return type:

None

async offset_done()#

Wait for events specifying that an offset completed.

Return type:

None

Notes

For ATMCS we expect the component to send allAxesInPosition.inPosition=False at the start of an offset and then allAxesInPosition.inPosition=True when it is done.

If the ATMCS fails to send these events in more than self.tel_settle_time seconds, waiting for the event will timeout and raise an asyncio.Timeout exception.

See also

flush_offset_events

Flush events before an offset.

offset_azel

Offset in local AzEl coordinates.

offset_xy

Offset in terms of boresight.

offset_radec

Offset in sky coordinates.

async open_dome_shutter()#

Task to open dome shutter and return when it is done.

Return type:

None

async open_dropout_door()#

Open ATdome dropout door.

Return type:

None

async open_m1_cover()#

Task to open m1 cover. :rtype: None

Warning

The Mirror cover can only be opened if the telescope is pointing above self.tel_el_operate_pneumatics (=70 degrees). 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.

async open_m1_vent()#

Task to open m1 vents.

Return type:

None

async open_valve_instrument()#

Open ATPneumatics instrument valve.

Return type:

None

async open_valve_main()#

Open ATPneumatics main valve.

Return type:

None

async open_valves()#

Open the air valve system on ATPneumatics.

Return type:

None

async prepare_for_flatfield(check=None)#

A high level method to position the telescope and dome for flat field operations.

The method will,

1 - disable ATDomeTrajectory 2 - close the dome shutter (if open) 3 - send telescope to flat field position 4 - send dome to flat field position 5 - re-enable ATDomeTrajectory

Parameters:

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

Return type:

None

async prepare_for_onsky(overrides=None)#

Prepare Auxiliary Telescope for on-sky operations.

This method will perform the start of the night procedure for the ATCS component. It will enable all components, open the dome slit, open the telescope covers and activate AOS open loop corrections.

Parameters:

overrides (dict) – Dictionary with overrides to apply. If None use the recommended overrides.

Return type:

None

async prepare_for_vent(partially_open_dome=False)#

Prepare Auxiliary Telescope for venting.

Parameters:

partially_open_dome (bool) – Partially open the dome after positioning the telescope and dome?

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 shutdown()#

Shutdown ATTCS components.

This method will perform the end of the night procedure for the ATTCS component. It will close the telescope cover, close the dome, move the telescope and dome to the park position and disable all components.

Return type:

None

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

Utility method to slew dome to a specified position.

This method works at cross purposes to ATDomeTrajectory, so this method disables ATDomeTrajectory and leaves it disabled. If ATDomeTrajectory is enabled while the dome is slewing to the requested position this method raises an exception.

The method will return once the dome arrives in position, at which point all checks will be canceled before returning.

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.long_long_timeout if not provided.

Raises:

RuntimeError: – If ATDome is ENABLED while slewing the dome.

Return type:

None

async slew_to_pneumatics_operational_range()#

Slew the telescope to safe range for pneumatics operation.

This method will slew the telescope to a safe elevation to perform atpneumatics operations. It should be used in combination with the in_pneumatics_operational_range method. Telescope will be left in pneumatics position with tracking disabled.

Return type:

None

async stop_all()#

Stop telescope and dome.

Return type:

None

async stop_dome()#

Stop all dome motion.

Return type:

None

stop_monitor()#

Stop any monitor position.

Return type:

None

async stop_tracking()#

Task to stop telescope tracking.

Return type:

None

async wait_for_atdome_inposition(timeout)#

Wait until the telescope is cleared by the dome.

Instead of waiting until the dome finishes moving. This method will wait until the telescope is not vigneted by the dome. This is monitored in monitor_position and broadcasted as an asyncio.Event.

Parameters:

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

Returns:

status – String with final status.

Return type:

str

Raises:

asyncio.TimeoutError – If does not get a status update in less then timeout seconds.

async wait_for_atdome_shutter_inposition()#

Wait for the atdome shutter to be in position.

Returns:

status – String with final status.

Return type:

str

Raises:

asyncio.TimeoutError – If does not get in position before self.open_dome_shutter_time

async wait_for_atmcs_inposition(timeout)#

Wait for inPosition of atmcs to be ready.

Parameters:

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

Returns:

status – String with final status.

Return type:

str

Raises:

asyncio.TimeoutError – If does not get a status update in less then timeout seconds.

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

Wait for both the ATMCS and ATDome to be in position.

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

  • cmd_ack (CmdAck or None) – CmdAck from the command that started the slew process. This is an experimental feature to discard events that where sent before the slew starts.

  • wait_settle (bool) – After slew completes, 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

Raises:

RuntimeError: – If tasks times out.