ATCS¶
- class lsst.ts.observatory.control.auxtel.ATCS(domain: Optional[Domain] = None, log: Optional[Logger] = None, intended_usage: Optional[int] = 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.
- Attributes:
- atmcs: salobj.Remote
- ataos: salobj.Remote
- atpneumatics: salobj.Remote
- athexapod: salobj.Remote
- atdome: salobj.Remote
- atdometrajectory: salobj.Remote
- check: SimpleNamespace
- log: logging.Logger
Attributes Summary
Return CoordFrame enumeration.
Return RotFrame enumeration.
Return RotMode enumeration.
Return WrapStrategy enumeration
List of components names.
List of remotes names.
Return name of the DomeTrajectory component.
Plate scale in mm/arcsec.
Return name of the pointing component.
Define class usages.
Returns valid usages.
Methods Summary
Add current position to a point file.
assert_all_enabled
([message])Check if all components are in the enabled state.
Assert that m1, hexapod and atspectrograph corrections are enabled.
Assert liveliness of components belonging to the group.
assert_m1_correction_disabled
([message])Assert that m1 corrections is disabled.
Check that all ATAOS corrections completed.
Check if atmcs is in position.
atmcs_target_callback
(data)Callback function to update the telescope target event topic.
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 if dome following is enabled.
Check the targeting status of the atmcs.
check_tracking
([track_duration])Check tracking state.
Clear internal catalog.
close
()close_dome
([force])Task to close ATDome.
Close ATDome dropout door
Task to close m1 cover.
Task to open m1 vents.
Return components for which check is enabled.
disable_ataos_corrections
([ignore_fail])Disable ATAOS corrections.
disable_dome_following
([check])Disable dome following mode.
enable
([overrides])Enable all components.
Enable ATAOS corrections.
enable_dome_following
([check])Enabled dome following mode.
Enable monitor.
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.
Implement abstract method to flush events before an offset is performed.
focus_offset
(offset)Apply focus offset.
Get the instrument bore sight angle with respect to the telescope axis.
get_heartbeat
(component)Get last heartbeat for component.
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 selected nasmyth 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 the telescope and dome vent azimuth.
get_work_components
([components])Parse input into a list of valid components from the group.
home_dome
([force])Task to execute dome home command and wait for it to complete.
Check if ATMCS is in operational range for pneumatics operation.
Check if catalog is loaded.
Verify if the dome is homed.
Is monitor position flag enabled?
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.
Callback function to update the telescope position telemetry topic.
next_heartbeat
(component)Get next heartbeat for component.
next_state
(component)Get summary state for component.
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.
object_list_add
(name, radec)Add object to object list.
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.
Return list of objects in the object list.
object_list_remove
(name)Remove object from object list.
offline
()Put all CSCs in offline.
offset_aos_lut
([z, x, y, u, v, m1, ...])Apply offsets to hexapod and optionally re-center telescope after hexapod offset.
offset_azel
(az, el[, relative, persistent, ...])Offset telescope in azimuth and elevation.
Wait for events specifying that an offset completed.
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.
Task to open dome shutter and return when it is done.
Open ATdome dropout door.
Task to open m1 cover.
Task to open m1 vents.
Open ATPneumatics instrument valve.
Open ATPneumatics main valve.
Open the air valve system on ATPneumatics.
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 Auxiliary Telescope for on-sky operations.
prepare_for_vent
([partially_open_dome])Prepare Auxiliary Telescope for venting.
process_as_completed
(tasks)Process tasks are they complete.
radec_from_azel
(az, el[, time])Calculate Ra/Dec in ICRS coordinates from Az/El.
Wait for the telescope control system to be ready to take data.
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)Handle azEl slew to wait or not for the dome.
set_rem_loglevel
(level)Set remotes log level.
Set the rotator angle alternatives.
set_state
(state[, overrides, components])Set summary state for all components.
shutdown
()Shutdown ATTCS 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.
Slew the telescope to safe range for pneumatics operation.
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 all dome motion.
Stop any monitor position.
Task to stop telescope tracking.
wait_for_atdome_inposition
(timeout)Wait until the telescope is cleared by the dome.
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
- 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”.
- 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”.
- 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.
- telescope_position¶
- telescope_target¶
- usages¶
- valid_use_cases¶
Returns 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_ataos_corrections_enabled() None ¶
Assert that m1, hexapod and atspectrograph corrections are enabled.
- Raises:
- AssertionError
If ATAOS m1, hexapod, or atspectrograph corrections are disabled.
- 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 withcheck=False
will be skipped.- Raises:
- AssertionError
If cannot get heartbeat for one or more components.
- async assert_m1_correction_disabled(message: str = '') None ¶
Assert that m1 corrections is disabled.
- Parameters:
- message
str
Additional message to append to error.
- message
- Raises:
- AssertionError
If ATAOS m1 corrections are enabled.
- async atmcs_in_position() bool ¶
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:
bool
In position flag value.
- in_position:
- async atmcs_target_callback(data: BaseMsgType) None ¶
Callback function to update the telescope target event topic.
- 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:
- ra
float
,str
orastropy.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
.- dec
float
,str
orastropy.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
.- time
astropy.time.core.Time
orNone
, optional The time which the coordinate trasformation is intended for. If
None
(default) use current time.
- ra
- Returns:
- azel
astropy.coordinates.AltAz
Astropy coordinates with azimuth and elevation.
- azel
- 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:
- tasks
list
[futures
] A list of coroutines to cancel.
- tasks
- 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:
- component
str
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”.
- component
- 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:
- component
str
Name of the component to follow. Must be one of: atmcs, atptg, ataos, atpneumatics, athexapod, atdome, atdometrajectory
- desired_state
salobj.State
Desired state of the CSC.
- component
- Raises:
- RuntimeError
If state is not
desired_state
.- KeyError
If component is not found.
- 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.
- async close_dome(force: bool = True) None ¶
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.
- force
- async close_m1_cover() None ¶
Task to close m1 cover.
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 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 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:
- overrides
dict
orNone
A dictionary with (component name, overrides) pair or
None
. The component name is as it appears in thecomponents_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”.
- overrides
- Returns:
- complete_overrides
dict
Dictionary with overrides for every component in the group. Unspecifies components have override “”.
- complete_overrides
- 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:
- target
astropy.Table
Target information.
- target
- 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.
- flush_offset_events() None ¶
Implement abstract method to flush events before an offset is performed.
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: float) None ¶
Apply focus offset.
Returns after offset is aplied.
- Parameters:
- offset
float
Offset in mm.
- offset
- async get_bore_sight_angle() float ¶
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
float
Bore sight angle.
- angle
- async get_heartbeat(component: str) BaseMsgType ¶
Get last heartbeat for component.
- Parameters:
- component
str
Name of the component.
- component
- Returns:
- heartbeat
Last component heartbeat.
- 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:
- 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.
- async get_selected_nasmyth_angle() float ¶
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
float
Calculated angle of the current selected nasmyth port.
- nasmyth_angle
- Raises:
- RuntimeError:
If cannot get mount_Nasmyth_Encoders.
- async get_simulation_mode(components: Optional[List[str]] = None) Dict[str, BaseMsgType] ¶
Return a list with the simulation mode for components in the group.
- async get_software_versions(components: Optional[List[str]] = None) Dict[str, BaseMsgType] ¶
Return a list with the software versions for components in the group.
- async get_state(component: str, ignore_timeout: bool = False) State ¶
Get summary state for component.
- Parameters:
- component
str
Name of the component.
- ignore_timeout
bool
If
True
will return None in case it times out getting the state. Default isFalse
, which means raiseTimeoutError
.
- component
- Returns:
- state
salobj.State
orNone
Current state of component.
- state
- 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.
- get_telescope_and_dome_vent_azimuth() tuple[float, float] ¶
Get the telescope and dome vent azimuth.
- get_work_components(components: Optional[List[str]] = None) List[str] ¶
Parse input into a list of valid components from the group.
- async home_dome(force: bool = False) None ¶
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).
- force
- async in_pneumatics_operational_range() bool ¶
Check if ATMCS is in operational range for pneumatics operation.
- list_available_catalogs() Set[str] ¶
List of available catalogs to load.
- Returns:
- catalog_names
set
Set with the names of the available catalogs.
- catalog_names
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_name
str
Name of the catalog to load. Must be a valid entry in the list of available catalogs.
- catalog_name
- 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.
- async monitor_position(check: Optional[Any] = None) None ¶
Monitor and log the position of the telescope and the dome.
- Parameters:
- check
types.SimpleNamespace
orNone
Override
self.check
for defining which resources are used.
- check
- async mount_AzEl_Encoders_callback(data: BaseMsgType) None ¶
Callback function to update the telescope position telemetry topic.
- async next_heartbeat(component: str) BaseMsgType ¶
Get next heartbeat for component.
- Parameters:
- component
str
Name of the component.
- component
- Returns:
- heartbeat
Last component heartbeat.
- async next_state(component: str) State ¶
Get summary state for component.
- Parameters:
- component
str
Name of the component.
- component
- Returns:
- state
salobj.State
Current state of component.
- state
- async next_telescope_position(timeout: Optional[float] = None) BaseMsgType ¶
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:
ATMCS_tel_mount_AzEl_Encoders
- data:
- Raises:
- asyncio.TimeoutError
If no new data is seen in less then
timeout
seconds.
- async next_telescope_target(timeout: Optional[float] = None) BaseMsgType ¶
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:
ATMCS_tel_mount_AzEl_Encoders
- data:
- Raises:
- asyncio.TimeoutError
If no new data is seen in less then
timeout
seconds.
- 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_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.
- radec:
- object_list_get_all() Set[str] ¶
Return list of objects in the object list.
- Returns:
- object_list_names
set
Set with the names of all targets in the object list.
- object_list_names
- 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 offset_aos_lut(z: float = 0.0, x: float = 0.0, y: float = 0.0, u: float = 0.0, v: float = 0.0, m1: float = 0.0, offset_telescope: bool = True) None ¶
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.
- z
- 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:
- az
float
Offset in azimuth (arcsec).
- el
float
Offset in elevation (arcsec).
- relative
bool
, optional If
True
(default) offset is applied relative to the current position, ifFalse
offset replaces any existing offsets.- persistent
bool
orNone
, optional (deprecated) (Deprecated) Should the offset be absorbed and persisted between slews? Use of this parameter is deprecated. Use
absorb
instead.- absorb
bool
, optional Should the offset be absorbed and persisted between slews? (default:
False
)
- az
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. Useabsorb
instead.There are a couple different ways users can modify how offsets are treated via the input flags
relative
andabsorb
.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
andabsorb=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.
- async offset_done() None ¶
Wait for events specifying that an offset completed.
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.
Notes
For ATMCS we expect the component to send
allAxesInPosition.inPosition=False
at the start of an offset and thenallAxesInPosition.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 anasyncio.Timeout
exception.
- async offset_pa(angle: float, radius: float) None ¶
Offset the telescope based on a position angle and radius.
- 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).
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:
- rot
float
Rotator offset (deg).
- rot
- 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:
- x
float
Offset in camera x-axis (arcsec).
- y
float
Offset in camera y-axis (arcsec).
- relative
bool
, optional If
True
(default) offset is applied relative to the current position, ifFalse
offset replaces any existing offsets.- persistent
bool
orNone
, optional (deprecated) (Deprecated) Should the offset be absorbed and persisted between slews? Use of this parameter is deprecated. Use
absorb
instead.- absorb
bool
, optional Should the offset be absorbed and persisted between slews? (default:
False
)
- x
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. Useabsorb
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 therelative
andpersistent
flags.
- async open_m1_cover() None ¶
Task to open m1 cover.
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.
- 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:
- ra
float
,str
orastropy.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
.- dec
float
,str
orastropy.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
.- time
astropy.time.core.Time
orNone
, optional The time which the coordinate trasformation is intended for. If
None
(default) use current time.
- ra
- Returns:
- pa_angle
astropy.coordinates.Angle
Parallactic angle.
- pa_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:
- az
float
,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
- el
float
orstr
Target Elevation (degree). Accepts float (deg), sexagesimal string (DD:MM:SS.S or DD MM SS.S) coordinates or
astropy.coordinates.Angle
- rot_tel
float
orstr
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_name
str
Name of the position.
- wait_dome
bool
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_timeout
float
Timeout for the slew command (second).
- az
- async prepare_for_flatfield(check: Any = None) 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
orNone
Override
self.check
for defining which resources are used.
- check
- async prepare_for_onsky(overrides: Optional[Dict[str, str]] = None) 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.
- async prepare_for_vent(partially_open_dome: bool = False) None ¶
Prepare Auxiliary Telescope for venting.
- Parameters:
- partially_open_dome: `bool`
Partially open the dome after positioning the telescope and dome?
- 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:
- tasks
list`[`asyncio.Tasks
] List of asyncio tasks to process.
- tasks
- Returns:
- ret_val
object
Return value from the first completed task.
- ret_val
- 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:
- az
float
,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
- el
float
orstr
Target Elevation (degree). Accepts float (deg), sexagesimal string (DD:MM:SS.S or DD MM SS.S) coordinates or
astropy.coordinates.Angle
- time
astropy.time.core.Time
orNone
, optional The time which the coordinate trasformation is intended for. If
None
(default) use current time.
- az
- Returns:
- radec_icrs
astropy.coordinates.ICRS
Astropy coordinates with azimuth and elevation.
- radec_icrs
- 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.
- 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.
- set_azel_slew_checks(wait_dome: bool) Any ¶
Handle azEl slew to wait or not for the dome.
- Parameters:
- wait_dome
bool
Should the slew wait for the dome?
- wait_dome
- Returns:
- check
types.SimpleNamespace
Reformated check namespace.
- check
- set_rem_loglevel(level: int) None ¶
Set remotes log level.
Useful to prevent the internal salobj warnings when read queues are filling up.
- Parameters:
- level
int
Log level.
- 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:
- state
salobj.State
Desired state.
- overrides
dict
or None Settings to apply for each component.
- components
list[`str
]` List of components to set state, as they appear in
self.components_attr
.
- state
- Raises:
- RuntimeError
If a component in
components
is not part of the group.If it fails to transition one or more components.
- async shutdown() None ¶
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.
- 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_name
str
Name of the target
- frame
int
Target co-ordinate reference frame.
- epoch
float
Target epoch in years e.g. 2000.0. Julian (J) epoch is assumed.
- equinox
float
Target equinox in years e.g. 2000.0
- parallax
float
Parallax (arcseconds).
- pmRA
float
Proper Motion (RA) in RA Seconds/year.
- pmDec
float
Proper motion (Dec) in Arcseconds/year.
- rv
float
Radial velocity (km/sec).
- dRA
float
Differential Track Rate in RA.
- rot_frame
enum
Rotator coordinate frame (
self.RotFrame
). Specify how to select the position of the rotator. Ifself.RotFrame.TARGET
uses sky position angle. Ifself.RotFrame.FIXED
uses rotator physical position.- rot_track_frame
enum
Rotator track frame (
self.RotFrame
). Specify the rotator tracking mode. Ifself.RotFrame.TARGET
, follow sky. Ifself.RotFrame.FIXED
keep rotator at fixed position.- rot_mode
enum
Rotator position mode (
self.RotMode
). Ifself.RotMode.FIELD
optimize for sky tracking, ifself.RotMode.SLIT
optimize for slit spectroscopy.- slew_timeout
float
Timeout for the slew command (second).
- stop_before_slew
bool
Stop tracking before starting the slew? This option is a workaround to some issues with the mount components not sending events reliably.
- wait_settle
bool
Wait telescope to settle before returning?
- async slew_dome_to(az: float, check: Any = None) 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
orstr
Azimuth angle for the dome (in deg).
- check
types.SimpleNamespace
orNone
Override
self.check
for defining which resources are used.
- az
- Raises:
- RuntimeError:
If ATDome is ENABLED while slewing the dome.
- 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:
- ra
float
,str
orastropy.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
.- dec
float
,str
orastropy.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
.- rot
float
,str
orastropy.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 orastropy.coordinates.Angle
- rot_type
lsst.ts.observatory.control.utils.RotType
Rotation type. This parameter defines how
rot_value
is threated. Default isSkyAuto
, the rotator is positioned with respect to the North axis and is automatically wrapped if outside the limit. SeeRotType
for more options.- target_name
str
Target name.
- slew_timeout
float
Timeout for the slew command (second). Default is 240s.
- ra
- Returns:
- radec_icrs
astropy.coordinates.ICRS
Coordinates used in slew command.
- rot_angle
astropy.coordinates.Angle
Angle used in command for rotator.
- radec_icrs
- Other Parameters:
- dra
float
, optional Differential Track Rate in RA (second/second). Default is 0.
- ddec
float
, optional Differential Track Rate in Dec (arcsec/second). Default is 0.
- offset_x
float
, optional Apply offset to original slew position (in arcsec).
- offset_y
float
, optional Apply offset to original slew position (in arcsec).
- az_wrap_strategy
azWrapStrategy
orNone
, 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_target
float
, 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_slew
bool
Stop tracking before starting the slew? This option is a workaround to some issues with the ATMCS not sending events reliably.
- wait_settle
bool
Wait telescope to settle before returning? It
True
add an additional sleep ofself.tel_settle_time
to the telescope positioning algorithm. Otherwise the algorithm will return as soon as it receivesallAxesInPosition
event from the ATMCS.
- dra
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:
- name
str
Target name.
- rot
float
,str
orastropy.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 orastropy.coordinates.Angle
- rot_type
lsst.ts.observatory.control.utils.RotType
, optional Rotation type. This parameter defines how
rot_value
is threated. Default isSkyAuto
, the rotator is positioned with respect to the North axis and is automacally wrapped if outside the limit. SeeRotType
for more options.- slew_timeout
float
, optional Timeout for the slew command (second). Default is 240 seconds.
- name
- Other Parameters:
- dra
float
, optional Differential Track Rate in RA (second/second). Default is 0.
- ddec
float
, optional Differential Track Rate in Dec (arcsec/second). Default is 0.
- offset_x
float
, optional Apply offset to original slew position (in arcsec).
- offset_y
float
, optional Apply offset to original slew position (in arcsec).
- az_wrap_strategy
azWrapStrategy
orNone
, 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_target
float
, 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.
- dra
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:
- planet
enum.IntEnum
Enumeration with planet name.
- rot_sky
float
Desired instrument position angle (degree), Eastwards from North.
- slew_timeout
float
, optional Timeout for the slew command (second).
- planet
- async slew_to_pneumatics_operational_range() None ¶
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.
- 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.
- async wait_for_atdome_inposition(timeout: float) str ¶
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 anasyncio.Event
.- Parameters:
- timeout: `float`
How long should it wait before timing out.
- Returns:
- status:
str
String with final status.
- status:
- Raises:
- asyncio.TimeoutError
If does not get a status update in less then
timeout
seconds.
- async wait_for_atdome_shutter_inposition() str ¶
Wait for the atdome shutter to be in position.
- Returns:
- status:
str
String with final status.
- status:
- Raises:
- asyncio.TimeoutError
If does not get in position before
self.open_dome_shutter_time
- async wait_for_atmcs_inposition(timeout: float) str ¶
Wait for inPosition of atmcs to be ready.
- Parameters:
- timeout: `float`
How long should it wait before timing out.
- Returns:
- status:
str
String with final status.
- status:
- Raises:
- asyncio.TimeoutError
If does not get a status update in less then
timeout
seconds.
- 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 completes, add an addional settle wait before returning.
- check
types.SimpleNamespace
orNone
Override
self.check
for defining which resources are used.
- Returns:
- Raises:
- RuntimeError:
If tasks times out.