BaseTCS

class lsst.ts.observatory.control.BaseTCS(components: List[str], domain: lsst.ts.salobj.domain.Domain | None = None, log: logging.Logger | None = None, intended_usage: int | None = None, concurrent_operation: bool = True)

Bases: RemoteGroup

Base class for Telescope Control System.

Parameters:
componentslist [str]

A list of strings with the names of the SAL components that are part of the telescope control system group.

domainlsst.ts.salobj.Domain

Domain for remotes. If None create a domain.

loglogging.Logger

Optional logging class to be used for logging operations. If None, creates a new logger.

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.

concurrent_operationbool, optional

If False, tasks like enable and other concurrent tasks will be done sequentially. Default=True.

Attributes Summary

CoordFrame

Return CoordFrame enumeration.

RotFrame

Return RotFrame enumeration.

RotMode

Return RotMode enumeration.

WrapStrategy

Return WrapStrategy enumeration

components

List of components names.

components_attr

List of remotes names.

dome_trajectory_name

Return name of the DomeTrajectory component.

instrument_focus

plate_scale

Plate scale in mm/arcsec.

ptg_name

Return name of the pointing component.

usages

Define class usages.

valid_use_cases

Define valid usages.

Methods Summary

add_point_data()

Add current position to a point file.

assert_all_enabled([message])

Check if all components are in the enabled state.

assert_liveliness()

Assert liveliness of components belonging to the group.

azel_from_radec(ra, dec[, time])

Calculate Az/El coordinates from RA/Dec in ICRS.

cancel_not_done(tasks)

Cancel all coroutines in coro_list.

check_comp_heartbeat(component)

Monitor heartbeats from the specified component and raises and exception if not.

check_component_state(component[, desired_state])

Monitor the summary state of a component and raises an exception if it is or goes to a state different than the desired state.

check_dome_following()

Check if dome following is enabled.

check_tracking([track_duration])

Check tracking state.

clear_catalog()

Clear internal catalog.

close()

close_dome()

Task to close dome.

close_m1_cover()

Task to close m1 cover.

components_to_check()

Return components for which check is enabled.

disable_dome_following([check])

Disable dome following mode.

enable([overrides])

Enable all components.

enable_dome_following([check])

Enabled dome following mode.

expand_overrides([overrides])

Expand an overrides dict with entries for every component.

find_target(az, el, mag_limit[, mag_range, ...])

Make a cone search and return a target close to the specified position.

find_target_dm_butler(az, el, mag_limit[, ...])

Make a cone search in the butler source catalog and return a target in the magnitude range, close to the specified position.

find_target_local_catalog(az, el, mag_limit)

Make a cone search in the internal catalog and return a target in the magnitude range, close to the specified position.

find_target_simbad(az, el, mag_limit[, ...])

Make a cone search in the HD catalog using Simbad and return a target with magnitude inside the magnitude range, close to the specified position.

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_heartbeat(component)

Get last heartbeat for component.

get_identity()

Get user identity.

get_required_resources(component, intended_usage)

Return the required resources based on the intended usage of the class.

get_rot_angle_alternatives(rot_angle)

Generate rotator angle alternatives based on the input rotator angle.

get_simulation_mode([components])

Return a list with the simulation mode for components in the group.

get_software_versions([components])

Return a list with the software versions for components in the group.

get_state(component[, ignore_timeout])

Get summary state for component.

get_sun_azel([time_tai])

Get the sun azimuth and elevation.

get_telescope_and_dome_vent_azimuth()

Get the telescope and dome vent azimuth.

get_work_components([components])

Parse input into a list of valid components from the group.

home_dome()

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

is_catalog_loaded()

Check if catalog is loaded.

list_available_catalogs()

List of available catalogs to load.

load_catalog(catalog_name)

Load a catalog from the available set.

monitor_position([check])

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

next_heartbeat(component)

Get next heartbeat for component.

next_state(component)

Get summary state for component.

object_list_add(name, radec)

Add object to object list.

object_list_clear()

Remove all objects stored in the internal object list.

object_list_get(name)

Get an object from the list or query Simbad and return it.

object_list_get_all()

Return list of objects in the object list.

object_list_remove(name)

Remove object from object list.

offline()

Put all CSCs in offline.

offset_azel(az, el[, relative, persistent, ...])

Offset telescope in azimuth and elevation.

offset_done()

Wait for offset events.

offset_pa(angle, radius)

Offset the telescope based on a position angle and radius.

offset_radec(ra, dec)

Offset telescope in RA and Dec.

offset_rot(rot)

Apply a rotation offset.

offset_xy(x, y[, relative, persistent, absorb])

Offsets in the detector X/Y plane.

open_dome_shutter()

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

open_m1_cover()

Task to open m1 cover.

parallactic_angle(ra, dec[, time])

Return parallactic angle for the given Ra/Dec coordinates.

point_azel(az, el[, rot_tel, target_name, ...])

Slew the telescope to a fixed alt/az position.

prepare_for_flatfield([check])

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

prepare_for_onsky([overrides])

Prepare telescope for on-sky operations.

process_as_completed(tasks)

Process tasks are they complete.

radec_from_azel(az, el[, time])

Calculate Ra/Dec in ICRS coordinates from Az/El.

ready_to_take_data()

Wait for the telescope control system to be ready to take data.

reset_checks()

Reset all checks, enabling check for all components.

reset_offsets([absorbed, non_absorbed])

Reset pointing offsets.

rotation_matrix(angle)

Rotation matrix.

set_azel_slew_checks(wait_dome)

Abstract method to handle azEl slew to wait or not for the dome.

set_rem_loglevel(level)

Set remotes log level.

set_rot_angle_alternatives(...)

Set the rotator angle alternatives.

set_state(state[, overrides, components])

Set summary state for all components.

shutdown()

Shutdown components.

slew(ra, dec[, rotPA, target_name, frame, ...])

Slew the telescope and start tracking an Ra/Dec target.

slew_dome_to(az[, check])

Utility method to slew dome to a specified position.

slew_ephem_target(ephem_file, target_name[, ...])

Slew the telescope to a target defined by ephemeris data defined in a file.

slew_icrs(ra, dec[, rot, rot_type, ...])

Slew the telescope and start tracking an Ra/Dec target in ICRS coordinate frame.

slew_object(name[, rot, rot_type, dra, ...])

Slew to an object name.

slew_to_planet(planet[, rot_sky, slew_timeout])

Slew and track a solar system body.

standby()

Put all CSCs in standby.

start_tracking([slew_timeout])

Start tracking the current position of the telescope.

stop_all()

Stop telescope and dome.

stop_tracking()

Task to stop telescope tracking.

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

components

List of components names.

The name of the CSC follow the format used in the class constructor, e.g. CSCName or CSCName:index (for indexed components), e.g. “Hexapod:1” (for Hexapod with index=1) or “ATHexapod”.

Returns:
componentslist of str

List of CSCs names.

components_attr

List of remotes names.

The remotes names are reformatted to fit the requirements for object attributes. It will be the name of the CSC (as in components) in lowercase, replacing the colon by an underscore, e.g. “Hexapod:1” -> “hexapod_1” or “ATHexapod” -> “athexapod”.

Returns:
components_attrlist of str

List of remotes attribute names.

dome_trajectory_name

Return name of the DomeTrajectory component.

instrument_focus
plate_scale

Plate scale in mm/arcsec.

ptg_name

Return name of the pointing component.

usages

Define class usages.

This property defines what remote resources are needed for each class usages. Each item in the dictionary contain a list of components, if the remotes will be used for “read only” operations an which topics will be required. The “key” of the dictionary is the usage enumeration value.

Returns:
usagesdict

Dictionary with class usages.

valid_use_cases

Define valid usages.

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

Returns:
usages: enum

Methods Documentation

async add_point_data() None

Add current position to a point file. If a file is open it will append to that file. If no file is opened it will open a new one.

async assert_all_enabled(message: str = '') None

Check if all components are in the enabled state.

Parameters:
message: `str`

Additional message to append to error.

async assert_liveliness() None

Assert liveliness of components belonging to the group.

The assertion is done by waiting for a new heartbeat from the component. The check feature will apply to the assertion so components marked with check=False will be skipped.

Raises:
AssertionError

If cannot get heartbeat for one or more components.

azel_from_radec(ra: Union[float, str, Angle], dec: Union[float, str, Angle], time: Optional[Time] = None) AltAz

Calculate Az/El coordinates from RA/Dec in ICRS.

Parameters:
rafloat, str or astropy.coordinates.Angle

Target RA, either as a float (hour), a sexagesimal string (HH:MM:SS.S or HH MM SS.S) coordinates or astropy.coordinates.Angle.

decfloat, str or astropy.coordinates.Angle

Target Dec, either as a float (deg), a sexagesimal string (DD:MM:SS.S or DD MM SS.S) coordinates or astropy.coordinates.Angle.

timeastropy.time.core.Time or None, optional

The time which the coordinate trasformation is intended for. If None (default) use current time.

Returns:
azelastropy.coordinates.AltAz

Astropy coordinates with azimuth and elevation.

async static cancel_not_done(tasks: List[Task]) None

Cancel all coroutines in coro_list.

Remove futures from input tasks list and cancel them.

Parameters:
taskslist [futures]

A list of coroutines to cancel.

async check_comp_heartbeat(component: str) None

Monitor heartbeats from the specified component and raises and exception if not.

This method will run forever as long as the component continues to send heartbeats. The intention is that this can run alongside an operation, to make sure the component remains responsive.

Parameters:
componentstr

Name of the component to follow. The name of the CSC follow the format CSCName or CSCName:index (for indexed components), e.g. “Hexapod:1” (for Hexapod with index=1) or “ATHexapod”.

Raises:
RuntimeError

If the component does not send heartbeats in self.fast_timeout seconds.

async check_component_state(component: str, desired_state: State = State.ENABLED) None

Monitor the summary state of a component and raises an exception if it is or goes to a state different than the desired state.

This method will run forever as long as the summary state remains unchanged. The intention is that this can run alongside an operation that require the component to be in a certain state, when the operation is completed, the task can be canceled.

Parameters:
componentstr

Name of the component to follow. Must be one of: atmcs, atptg, ataos, atpneumatics, athexapod, atdome, atdometrajectory

desired_statesalobj.State

Desired state of the CSC.

Raises:
RuntimeError

If state is not desired_state.

KeyError

If component is not found.

async check_dome_following() bool

Check if dome following is enabled.

Returns:
dome_followingbool

True is enabled False otherwise.

async check_tracking(track_duration: Optional[float] = None) None

Check tracking state.

This method monitors all the required parameters for tracking a target; from telescope and pointing component to the dome.

If any of those conditions fails, raise an exception.

This method is useful in case an operation required tracking to be active and be interrupted in case tracking stops. One can start this method concurrently and monitor it for any exception. If an exception is raise, the concurrent task can be interrupted or marked as failed as appropriately.

If a track_duration is specified, the method will return after the time has passed. Otherwise it will just check forever.

Parameters:
track_durationfloat or None

How long should tracking be checked for (second)? Must be a positive float or None (default).

clear_catalog() None

Clear internal catalog.

async close() None
abstract async close_dome() None

Task to close dome.

abstract async close_m1_cover() None

Task to close m1 cover.

components_to_check() List[str]

Return components for which check is enabled.

Returns:
list of str

Components to check.

async disable_dome_following(check: Any = None) None

Disable dome following mode.

async enable(overrides: Optional[Dict[str, str]] = None) None

Enable all components.

This method will enable all group components. Users can provide overrides for the start command (in a dictionary).

Parameters:
overrides: `dict`

Dictionary with overrides to apply. If None use recommended overrides.

async enable_dome_following(check: Any = None) None

Enabled dome following mode.

async expand_overrides(overrides: Optional[Dict[str, str]] = None) Dict[str, str]

Expand an overrides dict with entries for every component.

Any components that have no specified override are set to “”.

Parameters:
overridesdict or None

A dictionary with (component name, overrides) pair or None. The component name is as it appears in the components_attr attribute, which is the name of the CSC in lowercase, replacing “:” by “_” for indexed components, e.g. “Hexapod:1” -> “hexapod_1” or “ATHexapod” -> “athexapod”.

Returns:
complete_overridesdict

Dictionary with overrides for every component in the group. Unspecifies components have override “”.

Raises:
RuntimeError

If an item in the parameter overrides dictionary is not a CSC in the group.

async find_target(az: float, el: float, mag_limit: float, mag_range: float = 2.0, radius: float = 0.5) Table

Make a cone search and return a target close to the specified position.

Parameters:
az: `float`

Azimuth (in degrees).

el: `float`

Elevation (in degrees).

mag_limit: `float`

Minimum (brightest) V-magnitude limit.

mag_range: `float`, optional

Magnitude range. The maximum/faintest limit is defined as mag_limit+mag_range (default=2).

radius: `float`, optional

Radius of the cone search (default=2 degrees).

Returns:
targetastropy.Table

Target information.

async find_target_dm_butler(az: float, el: float, mag_limit: float, mag_range: float = 2.0, radius: float = 0.5) str

Make a cone search in the butler source catalog and return a target in the magnitude range, close to the specified position.

Parameters:
az: `float`

Azimuth (in degrees).

el: `float`

Elevation (in degrees).

mag_limit: `float`

Minimum (brightest) V-magnitude limit.

mag_range: `float`, optional

Magnitude range. The maximum/faintest limit is defined as mag_limit+mag_range (default=2).

radius: `float`, optional

Radius of the cone search (default=2 degrees).

Returns:
str

Name of the target.

Raises:
RuntimeError:

If DM stack is not available.

async find_target_local_catalog(az: float, el: float, mag_limit: float, mag_range: float = 2.0, radius: float = 0.5) str

Make a cone search in the internal catalog and return a target in the magnitude range, close to the specified position.

Parameters:
az: `float`

Azimuth (in degrees).

el: `float`

Elevation (in degrees).

mag_limit: `float`

Minimum (brightest) V-magnitude limit.

mag_range: `float`, optional

Magnitude range. The maximum/faintest limit is defined as mag_limit+mag_range (default=2).

radius: `float`, optional

Radius of the cone search (default=2 degrees).

Returns:
str

Name of the target.

Raises:
RuntimeError:

If catalog is not loaded. If no object is found.

async find_target_simbad(az: float, el: float, mag_limit: float, mag_range: float = 2.0, radius: float = 0.5) str

Make a cone search in the HD catalog using Simbad and return a target with magnitude inside the magnitude range, close to the specified position.

Parameters:
az: `float`

Azimuth (in degrees).

el: `float`

Elevation (in degrees).

mag_limit: `float`

Minimum (brightest) V-magnitude limit.

mag_range: `float`, optional

Magnitude range. The maximum/faintest limit is defined as mag_limit+mag_range (default=2).

radius: `float`, optional

Radius of the cone search (default=2 degrees).

Returns:
str

Name of the target.

Raises:
RuntimeError:

If no object is found.

abstract flush_offset_events() None

Abstract method to flush events before and offset is performed.

abstract async get_bore_sight_angle() float

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

async get_heartbeat(component: str) BaseMsgType

Get last heartbeat for component.

Parameters:
componentstr

Name of the component.

Returns:
heartbeat

Last component heartbeat.

get_identity() str

Get user identity.

Returns:
str

Identity.

get_required_resources(component: str, intended_usage: Union[None, int]) Any

Return the required resources based on the intended usage of the class.

When subclassing, overwrite this method to add the child class use cases.

Parameters:
component: `str`

Name of the component, with index as it appears in components_attr attribute (e.g. test_1 for the Test component with index 1).

intended_usage: `int` or `None`

An integer constructed from the self.valid_use_cases. Usages can be combined to enable combined operations (see base class documentation). If None, returns appropriate values to load all resources.

Returns:
resources: types.SimpleNamespace

A simple namespaces with the following attributes:

add_this: bool

Should this remote be added to the collection?

readonly: bool

Create the remote for this component in readonly mode? Some operations does not require commanding.

include: list [str]

What topics should be included?

Raises:
KeyError: If component is not in the list of components.
get_rot_angle_alternatives(rot_angle: float) Generator[float, None, None]

Generate rotator angle alternatives based on the input rotator angle.

Parameters:
rot_anglefloat

Desired rotator angle (in deg).

Yields:
float

Rotator angle alternatives (in deg).

async get_simulation_mode(components: Optional[List[str]] = None) Dict[str, BaseMsgType]

Return a list with the simulation mode for components in the group.

Parameters:
componentslist of str, optional

List with the name of components to get the simulation mode. If None (default) return the values for all components.

Returns:
simulation_mode: dict

Dictionary with the name of the component and the value of simulation mode.

async get_software_versions(components: Optional[List[str]] = None) Dict[str, BaseMsgType]

Return a list with the software versions for components in the group.

Parameters:
componentslist of str, optional

List with the name of components to get the software versions. If None (default) return the values for all components.

Returns:
software_versions: dict

Dictionary with the name of the component and the value of software versions.

async get_state(component: str, ignore_timeout: bool = False) State

Get summary state for component.

Parameters:
componentstr

Name of the component.

ignore_timeoutbool

If True will return None in case it times out getting the state. Default is False, which means raise TimeoutError.

Returns:
statesalobj.State or None

Current state of component.

Raises:
asyncio.TimeoutError

If can not get state in self.fast_timeout seconds.

get_sun_azel(time_tai: float | None = None) tuple[float, float]

Get the sun azimuth and elevation.

Parameters:
time_taifloat or None, optional

TAI timestamp to get sun position. If None compute current tai.

Returns:
tuple`[`float, float]

Sun elevation and azimuth in degrees.

get_telescope_and_dome_vent_azimuth() tuple[float, float]

Get the telescope and dome vent azimuth.

Returns:
tel_vent_azimuthfloat

Azimuth to vent the telescope (in deg).

dome_vent_azimuthfloat

Azimuth to vent the dome (in deg).

get_work_components(components: Optional[List[str]] = None) List[str]

Parse input into a list of valid components from the group.

Parameters:
componentslist of str or None

Input list of components to process or None. If None return a list with all components.

Returns:
work_componentslist of str

List of valid components.

Raises:
RuntimeError

If a component in the components input list is not part of the group.

abstract async home_dome() None

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

is_catalog_loaded() bool

Check if catalog is loaded.

Returns:
bool

True if catalog was loaded, False otherwise.

list_available_catalogs() Set[str]

List of available catalogs to load.

Returns:
catalog_namesset

Set with the names of the available catalogs.

See also

load_catalog

Load a catalog from the available set.

load_catalog(catalog_name: str) None

Load a catalog from the available set.

Parameters:
catalog_namestr

Name of the catalog to load. Must be a valid entry in the list of available catalogs.

Raises:
RuntimeError

If input catalog_name is not a valid entry in the list of available catalogs. If catalog was already loaded or not cleared before loading a new one.

See also

list_available_catalogs

List available catalogs to load.

abstract async monitor_position(check: Any = None) None

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

Parameters:
checktypes.SimpleNamespace or None

Override self.check for defining which resources are used.

async next_heartbeat(component: str) BaseMsgType

Get next heartbeat for component.

Parameters:
componentstr

Name of the component.

Returns:
heartbeat

Last component heartbeat.

async next_state(component: str) State

Get summary state for component.

Parameters:
componentstr

Name of the component.

Returns:
statesalobj.State

Current state of component.

object_list_add(name: str, radec: ICRS) None

Add object to object list.

Parameters:
name: `str`

Name of the object.

object_table: `astropy.table.row.Row`

Table row with object information.

object_list_clear() None

Remove all objects stored in the internal object list.

object_list_get(name: str) ICRS

Get an object from the list or query Simbad and return it.

Parameters:
name: `str`

Name of the object.

Returns:
radec: ICRS

Table row with object information.

object_list_get_all() Set[str]

Return list of objects in the object list.

Returns:
object_list_namesset

Set with the names of all targets in the object list.

object_list_remove(name: str) None

Remove object from object list.

Parameters:
name: `str`

Object name.

Raises:
RuntimeError

If input object name not in the object list.

async offline() None

Put all CSCs in offline.

async offset_azel(az: float, el: float, relative: bool = True, persistent: Optional[bool] = None, absorb: bool = False) None

Offset telescope in azimuth and elevation.

For more information see the Notes section below or the package documentation in https://ts-observatory-control.lsst.io/.

Parameters:
azfloat

Offset in azimuth (arcsec).

elfloat

Offset in elevation (arcsec).

relativebool, optional

If True (default) offset is applied relative to the current position, if False offset replaces any existing offsets.

persistentbool or None, optional (deprecated)

(Deprecated) Should the offset be absorbed and persisted between slews? Use of this parameter is deprecated. Use absorb instead.

absorbbool, optional

Should the offset be absorbed and persisted between slews? (default: False)

See also

offset_xy

Offsets in the detector X/Y plane.

offset_radec

Offset in sky coordinates.

reset_offsets

Reset offsets.

Notes

The persistent flag is deprecated. Use absorb instead.

There are a couple different ways users can modify how offsets are treated via the input flags relative and absorb.

These flags allows users to control the following behavior;

1 - If the offset is relative to the current position

(relative=True) or relative to the pointing origin (e.g. the initial slew position).

2 - If the offset will only apply only to the current target

(absorb=False) or if they will be absorbed by the pointing and persist after a new targets (absorb=True).

By default relative=True and absorb=False, which means offsets will be relative to the current position and will reset after a slew.

The default relative offsets will accumulate. For instance,

>>> await tcs.offset_azel(az=10, el=0)
>>> await tcs.offset_azel(az=0, el=10)

Will result in a 10 arcsec offset in both azimuth and elevation.

Non-relative offsets will overrides any previous non-relative offset. For instance, the pair of commands below:

>>> await tcs.offset_azel(az=10, el=0)
>>> await tcs.offset_azel(az=0, el=10)

Results in only 10 arcsec offset in elevation, e.g., is equivalent to just doing the second command;

>>> await tcs.offset_azel(az=0, el=10, relative=True)

This is because the non-relative offset requested by the second command will reset the offset done on the previous command.

It is important to keep in mind that these offsets can also be combined with one another. For instance, if you do;

>>> await tcs.offset_azel(az=10, el=0)
>>> await tcs.offset_azel(az=0, el=10)
>>> await tcs.offset_azel(az=0, el=10, relative=False)

You will get 10 arcsec offset in azimuth and 20 arcsec in elevation.

Nevertheless, if after doing the above you do;

>>> await tcs.offset_azel(az=0, el=0, relative=False)

It will result in a 10 arcsec offset in both azimuth and elevation, from the relative offsets done previously.

In all cases above, the offset will be overwritten if a new target is sent, e.g.;

>>> await tcs.offset_azel(az=10, el=0, relative=True)
>>> await tcs.offset_azel(az=0, el=10, relative=True)
>>> await tcs.offset_azel(az=0, el=10)
>>> await tcs.slew_object("HD 164461")  # reset all offsets above

Will result in a slew with no offsets.

If you want offsets to persist between slews use absorb=True.

The relative flag applies the same way to absored offsets.

The following sequence of commands;

>>> await tcs.offset_azel(az=10, el=0, relative=True, absorb=True)
>>> await tcs.offset_azel(az=0, el=10, relative=True, absorb=True)
>>> await tcs.offset_azel(az=0, el=10, relative=False, absorb=True)
>>> await tcs.slew_object("HD 164461")

Will result in a slew offset by 10 arcsec in azimuth and 20 arcsec in elevation.

abstract async offset_done() None

Wait for offset events.

async offset_pa(angle: float, radius: float) None

Offset the telescope based on a position angle and radius.

Parameters:
anglefloat

Offset position angle, clockwise from North (degrees).

radiusfloat

Radial offset relative to target position (arcsec).

async offset_radec(ra: float, dec: float) None

Offset telescope in RA and Dec.

Perform arc-length offset in sky coordinates. The magnitude of the offset is sqrt(ra^2 + dec^2) and the angle is the usual atan2(dec, ra).

Parameters:
rafloat

Offset in ra (arcsec).

decfloat or str

Offset in dec (arcsec).

See also

offset_azel

Offset in local AzEl coordinates.

offset_xy

Offsets in the detector X/Y plane.

async offset_rot(rot: float) None

Apply a rotation offset.

Parameters:
rotfloat

Rotator offset (deg).

async offset_xy(x: float, y: float, relative: bool = True, persistent: bool | None = None, absorb: bool = False) None

Offsets in the detector X/Y plane.

Offset the telescope field-of-view in the x and y direction.

Parameters:
xfloat

Offset in camera x-axis (arcsec).

yfloat

Offset in camera y-axis (arcsec).

relativebool, optional

If True (default) offset is applied relative to the current position, if False offset replaces any existing offsets.

persistentbool or None, optional (deprecated)

(Deprecated) Should the offset be absorbed and persisted between slews? Use of this parameter is deprecated. Use absorb instead.

absorbbool, optional

Should the offset be absorbed and persisted between slews? (default: False)

See also

offset_azel

Offset in local AzEl coordinates.

offset_radec

Offset in sky coordinates.

reset_offsets

Reset offsets.

Notes

The persistent flag is deprecated. Use absorb instead.

If the image is displayed with the x-axis in horizontal position, increasing from left to right, a positive x-offset will result in the field-of-view moving to the right, and therefore, the stellar positions will move to the left.

If the image is displayed with y-axis in vertical position, increasing from bottom to top, a positive y-offset will result in field-of-view moving up, and therefore, the stellar positions will move down.

See the Notes section in offset_azel help page for more information about the relative and persistent flags.

abstract async open_dome_shutter() None

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

abstract async open_m1_cover() None

Task to open m1 cover.

parallactic_angle(ra: Union[float, str, Angle], dec: Union[float, str, Angle], time: Optional[Time] = None) Angle

Return parallactic angle for the given Ra/Dec coordinates.

Parameters:
rafloat, str or astropy.coordinates.Angle

Target RA, either as a float (hour), a sexagesimal string (HH:MM:SS.S or HH MM SS.S) coordinates or astropy.coordinates.Angle.

decfloat, str or astropy.coordinates.Angle

Target Dec, either as a float (deg), a sexagesimal string (DD:MM:SS.S or DD MM SS.S) coordinates or astropy.coordinates.Angle.

timeastropy.time.core.Time or None, optional

The time which the coordinate trasformation is intended for. If None (default) use current time.

Returns:
pa_angleastropy.coordinates.Angle

Parallactic angle.

async point_azel(az: float, el: float, rot_tel: float = 0.0, target_name: str = 'azel_target', wait_dome: bool = False, slew_timeout: float = 1200.0) None

Slew the telescope to a fixed alt/az position.

Telescope will not track once it arrives in position.

Parameters:
azfloat, str or astropy.coordinates.Angle

Target Azimuth (degree). Accepts float (deg), sexagesimal string (DD:MM:SS.S or DD MM SS.S) coordinates or astropy.coordinates.Angle

elfloat or str

Target Elevation (degree). Accepts float (deg), sexagesimal string (DD:MM:SS.S or DD MM SS.S) coordinates or astropy.coordinates.Angle

rot_telfloat or str

Specify rotator angle in mount physical coordinates. Accepts float (deg), sexagesimal string (DD:MM:SS.S or DD MM SS.S) coordinates or astropy.coordinates.Angle

target_namestr

Name of the position.

wait_domebool

Wait for dome to be in sync with the telescope? If preparing to take a flat, for instance, the dome will never be in sync.

slew_timeoutfloat

Timeout for the slew command (second).

abstract async prepare_for_flatfield(check: Any = None) None

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

Parameters:
checktypes.SimpleNamespace or None

Override self.check for defining which resources are used.

abstract async prepare_for_onsky(overrides: Optional[Dict[str, str]] = None) None

Prepare telescope for on-sky operations.

Parameters:
overrides: `dict`

Dictionary with overrides to apply. If None use the recommended overrides.

async process_as_completed(tasks: List[Task]) Any

Process tasks are they complete.

If the first task that finishes completes successfully, it will cancel all other tasks in the list, empty the input list and return the value of the task. If the task results in an exception, it will cancel all other tasks, empty the list and raise the exception.

Parameters:
taskslist`[`asyncio.Tasks]

List of asyncio tasks to process.

Returns:
ret_valobject

Return value from the first completed task.

radec_from_azel(az: Union[float, str, Angle], el: Union[float, str, Angle], time: Optional[Time] = None) ICRS

Calculate Ra/Dec in ICRS coordinates from Az/El.

Parameters:
azfloat, str or astropy.coordinates.Angle

Target Azimuth (degree). Accepts float (deg), sexagesimal string (DD:MM:SS.S or DD MM SS.S) coordinates or astropy.coordinates.Angle

elfloat or str

Target Elevation (degree). Accepts float (deg), sexagesimal string (DD:MM:SS.S or DD MM SS.S) coordinates or astropy.coordinates.Angle

timeastropy.time.core.Time or None, optional

The time which the coordinate trasformation is intended for. If None (default) use current time.

Returns:
radec_icrsastropy.coordinates.ICRS

Astropy coordinates with azimuth and elevation.

async ready_to_take_data() None

Wait for the telescope control system to be ready to take data.

reset_checks() None

Reset all checks, enabling check for all components.

async reset_offsets(absorbed: bool = True, non_absorbed: bool = True) None

Reset pointing offsets.

By default reset all pointing offsets. User can specify if they want to reset only the absorbed and non-absorbed offsets as well.

Parameters:
absorbedbool

Reset absorbed offset? Default True.

non_absorbedbool

Reset non-absorbed offset? Default True.

Raises:
RuntimeError:

If both absorbed and non_absorbed are False.

static rotation_matrix(angle: float) Union[_SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]

Rotation matrix.

abstract set_azel_slew_checks(wait_dome: bool) None

Abstract method to handle azEl slew to wait or not for the dome.

Parameters:
wait_dome: `bool`

Should point_azel wait for the dome?

set_rem_loglevel(level: int) None

Set remotes log level.

Useful to prevent the internal salobj warnings when read queues are filling up.

Parameters:
levelint

Log level.

set_rot_angle_alternatives(rot_angle_alternatives: List[float]) None

Set the rotator angle alternatives.

It is not necessary to pass the 0. alternative, as it is added by default.

Duplicated entries are also removed.

Parameters:
rot_angle_alternativestyping.List[float]

List of rotator angle alternatives (in deg).

async set_state(state: State, overrides: Optional[Dict[str, str]] = None, components: Optional[List[str]] = None) None

Set summary state for all components.

Parameters:
statesalobj.State

Desired state.

overridesdict or None

Settings to apply for each component.

componentslist[`str]`

List of components to set state, as they appear in self.components_attr.

Raises:
RuntimeError
  • If a component in components is not part of the group.

  • If it fails to transition one or more components.

abstract async shutdown() None

Shutdown components.

async slew(ra: float, dec: float, rotPA: float = 0.0, target_name: str = 'slew_icrs', frame: Optional[IntEnum] = None, epoch: float = 2000.0, equinox: float = 2000.0, parallax: float = 0.0, pmRA: float = 0.0, pmDec: float = 0.0, rv: float = 0.0, dRA: float = 0.0, dDec: float = 0.0, rot_frame: Optional[IntEnum] = None, rot_track_frame: Optional[IntEnum] = None, rot_mode: Optional[IntEnum] = None, az_wrap_strategy: Optional[IntEnum] = None, time_on_target: float = 0.0, slew_timeout: float = 1200.0, stop_before_slew: bool = False, wait_settle: bool = True, offset_x: float = 0.0, offset_y: float = 0.0) None

Slew the telescope and start tracking an Ra/Dec target.

Parameters:
rafloat

Target Right Ascension (hour)

decfloat

Target Declination (degree)

rotPAfloat

Desired rotator position angle for slew (degree).

target_namestr

Name of the target

frameint

Target co-ordinate reference frame.

epochfloat

Target epoch in years e.g. 2000.0. Julian (J) epoch is assumed.

equinoxfloat

Target equinox in years e.g. 2000.0

parallaxfloat

Parallax (arcseconds).

pmRAfloat

Proper Motion (RA) in RA Seconds/year.

pmDecfloat

Proper motion (Dec) in Arcseconds/year.

rvfloat

Radial velocity (km/sec).

dRAfloat

Differential Track Rate in RA.

rot_frameenum

Rotator coordinate frame (self.RotFrame). Specify how to select the position of the rotator. If self.RotFrame.TARGET uses sky position angle. If self.RotFrame.FIXED uses rotator physical position.

rot_track_frameenum

Rotator track frame (self.RotFrame). Specify the rotator tracking mode. If self.RotFrame.TARGET, follow sky. If self.RotFrame.FIXED keep rotator at fixed position.

rot_modeenum

Rotator position mode (self.RotMode). If self.RotMode.FIELD optimize for sky tracking, if self.RotMode.SLIT optimize for slit spectroscopy.

slew_timeoutfloat

Timeout for the slew command (second).

stop_before_slewbool

Stop tracking before starting the slew? This option is a workaround to some issues with the mount components not sending events reliably.

wait_settlebool

Wait telescope to settle before returning?

abstract async slew_dome_to(az: float, check: Any = None) None

Utility method to slew dome to a specified position.

Parameters:
azfloat or str

Azimuth angle for the dome (in deg).

checktypes.SimpleNamespace or None

Override self.check for defining which resources are used.

async slew_ephem_target(ephem_file: str, target_name: str, rot_sky: float = 0.0, validate_only: bool = False, slew_timeout: float = 240.0) None

Slew the telescope to a target defined by ephemeris data defined in a file.

Parameters:
ephem_filestr

Name of the file containing ephemeris data.

target_namestr

Target name.

rot_skyfloat

Desired instrument position angle (degree), Eastwards from North. Default is 0.0.

validate_onlybool, optional

If True, validate the target without changing the current demand. Default is False.

slew_timeoutfloat, optional

Timeout for the slew command in seconds, default is 1200 seconds (20 minutes).

async slew_icrs(ra: float, dec: float, rot: float = 0.0, rot_type: RotType = RotType.SkyAuto, target_name: str = 'slew_icrs', dra: float = 0.0, ddec: float = 0.0, offset_x: float = 0.0, offset_y: float = 0.0, az_wrap_strategy: enum.IntEnum | None = None, time_on_target: float = 0.0, slew_timeout: float = 240.0, stop_before_slew: bool = False, wait_settle: bool = True) Tuple[ICRS, Angle]

Slew the telescope and start tracking an Ra/Dec target in ICRS coordinate frame.

Parameters:
rafloat, str or astropy.coordinates.Angle

Target RA, either as a float (hour), a sexagesimal string (HH:MM:SS.S or HH MM SS.S) coordinates or astropy.coordinates.Angle.

decfloat, str or astropy.coordinates.Angle

Target Dec, either as a float (deg), a sexagesimal string (DD:MM:SS.S or DD MM SS.S) coordinates or astropy.coordinates.Angle.

rotfloat, str or astropy.coordinates.Angle

Specify desired rotation angle. The value will have different meaning depending on the choince of rot_type parameter. Accepts float (deg), sexagesimal string (DD:MM:SS.S or DD MM SS.S) coordinates or astropy.coordinates.Angle

rot_typelsst.ts.observatory.control.utils.RotType

Rotation type. This parameter defines how rot_value is threated. Default is SkyAuto, the rotator is positioned with respect to the North axis and is automatically wrapped if outside the limit. See RotType for more options.

target_namestr

Target name.

slew_timeoutfloat

Timeout for the slew command (second). Default is 240s.

Returns:
radec_icrsastropy.coordinates.ICRS

Coordinates used in slew command.

rot_angleastropy.coordinates.Angle

Angle used in command for rotator.

Other Parameters:
drafloat, optional

Differential Track Rate in RA (second/second). Default is 0.

ddecfloat, optional

Differential Track Rate in Dec (arcsec/second). Default is 0.

offset_xfloat, optional

Apply offset to original slew position (in arcsec).

offset_yfloat, optional

Apply offset to original slew position (in arcsec).

az_wrap_strategyazWrapStrategy or None, optional

Azimuth wrap strategy. By default use maxTimeOnTarget=3, which attempts to maximize the time on target. Other options are; 1-noUnWrap, 2-optimize.

time_on_targetfloat, optional

Estimated time on target, in seconds. This is used by the optimize azimuth wrap algorithm to determine whether it needs to unwrap or not.

stop_before_slewbool

Stop tracking before starting the slew? This option is a workaround to some issues with the ATMCS not sending events reliably.

wait_settlebool

Wait telescope to settle before returning? It True add an additional sleep of self.tel_settle_time to the telescope positioning algorithm. Otherwise the algorithm will return as soon as it receives allAxesInPosition event from the ATMCS.

See also

slew_object

Slew to an object name.

async slew_object(name: str, rot: float = 0.0, rot_type: RotType = RotType.SkyAuto, dra: float = 0.0, ddec: float = 0.0, offset_x: float = 0.0, offset_y: float = 0.0, az_wrap_strategy: Optional[IntEnum] = None, time_on_target: float = 0.0, slew_timeout: float = 240.0) Tuple[ICRS, Angle]

Slew to an object name.

Use simbad to resolve the name and get coordinates.

Parameters:
namestr

Target name.

rotfloat, str or astropy.coordinates.Angle, optional

Specify desired rotation angle. Strategy depends on rot_type parameter. Accepts float (deg), sexagesimal string (DD:MM:SS.S or DD MM SS.S) coordinates or astropy.coordinates.Angle

rot_typelsst.ts.observatory.control.utils.RotType, optional

Rotation type. This parameter defines how rot_value is threated. Default is SkyAuto, the rotator is positioned with respect to the North axis and is automacally wrapped if outside the limit. See RotType for more options.

slew_timeoutfloat, optional

Timeout for the slew command (second). Default is 240 seconds.

Other Parameters:
drafloat, optional

Differential Track Rate in RA (second/second). Default is 0.

ddecfloat, optional

Differential Track Rate in Dec (arcsec/second). Default is 0.

offset_xfloat, optional

Apply offset to original slew position (in arcsec).

offset_yfloat, optional

Apply offset to original slew position (in arcsec).

az_wrap_strategyazWrapStrategy or None, optional

Azimuth wrap strategy. By default use maxTimeOnTarget=3, which attempts to maximize the time on target. Other options are; 1-noUnWrap, 2-optimize.

time_on_targetfloat, optional

Estimated time on target, in seconds. This is used by the optimize azimuth wrap algorithm to determine whether it needs to unwrap or not.

See also

slew_icrs

Slew to an ICRS coordinates.

async slew_to_planet(planet: IntEnum, rot_sky: float = 0.0, slew_timeout: float = 1200.0) None

Slew and track a solar system body.

Parameters:
planetenum.IntEnum

Enumeration with planet name.

rot_skyfloat

Desired instrument position angle (degree), Eastwards from North.

slew_timeoutfloat, optional

Timeout for the slew command (second).

async standby() None

Put all CSCs in standby.

async start_tracking(slew_timeout: float = 1200.0) None

Start tracking the current position of the telescope.

Method returns once telescope and dome are in sync.

abstract async stop_all() None

Stop telescope and dome.

async stop_tracking() None

Task to stop telescope tracking.

abstract async wait_for_inposition(timeout: float, wait_settle: bool, check: Optional[Any] = None) List[str]

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 complets, add an addional settle wait before returning.

checktypes.SimpleNamespace or None

Override self.check for defining which resources are used.

Returns:
status: str

String with final status.