Telescopes (pyobs.modules.telescope)

Modules for telescopes. TODO: write doc

BaseTelescope

class BaseTelescope(fits_headers: Dict[str, Any] | None = None, min_altitude: float = 10, wait_for_dome: str | None = None, **kwargs: Any)

Bases: WeatherAwareMixin, MotionStatusMixin, WaitForMotionMixin, ITelescope, IFitsHeaderBefore, Module

Base class for telescopes.

Initialize a new base telescope.

Parameters:
  • fits_headers – Additional FITS headers to send.

  • min_altitude – Minimal altitude for telescope.

  • wait_for_dome – Name of dome module to wait for.

async get_fits_header_before(namespaces: List[str] | None = None, **kwargs: Any) Dict[str, Tuple[Any, str]][source]

Returns FITS header for the current status of this module.

Parameters:

namespaces – If given, only return FITS headers for the given namespaces.

Returns:

Dictionary containing FITS headers.

async move_altaz(alt: float, az: float, **kwargs: Any) None[source]

Moves to given coordinates.

Parameters:
  • alt – Alt in deg to move to.

  • az – Az in deg to move to.

Raises:

MoveError – If telescope cannot be moved.

async move_radec(ra: float, dec: float, **kwargs: Any) None[source]

Starts tracking on given coordinates.

Parameters:
  • ra – RA in deg to track.

  • dec – Dec in deg to track.

Raises:

MoveError – If telescope cannot be moved.

async open() None[source]

Open module.

DummyTelescope

class DummyTelescope(world: SimWorld | None = None, **kwargs: Any)

Bases: BaseTelescope, IOffsetsRaDec, IFocuser, IFilters, IFitsHeaderBefore, ITemperatures, FitsNamespaceMixin

A dummy telescope for testing.

Creates a new dummy telescope.

Parameters:

world – Optional SimWorld object.

async get_altaz(**kwargs: Any) Tuple[float, float][source]

Returns current Alt and Az.

Returns:

Tuple of current Alt and Az in degrees.

async get_filter(**kwargs: Any) str[source]

Get currently set filter.

Returns:

Name of currently set filter.

async get_fits_header_before(namespaces: List[str] | None = None, **kwargs: Any) Dict[str, Tuple[Any, str]][source]

Returns FITS header for the current status of this module.

Parameters:

namespaces – If given, only return FITS headers for the given namespaces.

Returns:

Dictionary containing FITS headers.

async get_focus(**kwargs: Any) float[source]

Return current focus.

Returns:

Current focus.

async get_focus_offset(**kwargs: Any) float[source]

Return current focus offset.

Returns:

Current focus offset.

async get_offsets_radec(**kwargs: Any) Tuple[float, float][source]

Get RA/Dec offset.

Returns:

Tuple with RA and Dec offsets.

async get_radec(**kwargs: Any) Tuple[float, float][source]

Returns current RA and Dec.

Returns:

Tuple of current RA and Dec in degrees.

async get_temperatures(**kwargs: Any) Dict[str, float][source]

Returns all temperatures measured by this module.

Returns:

Dict containing temperatures.

async init(**kwargs: Any) None[source]

Initialize telescope.

Raises:

InitError – If device could not be initialized.

async is_ready(**kwargs: Any) bool[source]

Returns the device is “ready”, whatever that means for the specific device.

Returns:

Whether device is ready

async list_filters(**kwargs: Any) List[str][source]

List available filters.

Returns:

List of available filters.

async open() None[source]

Open module.

async park(**kwargs: Any) None[source]

Park telescope.

Raises:

ParkError – If telescope could not be parked.

async set_filter(filter_name: str, **kwargs: Any) None[source]

Set the current filter.

Parameters:

filter_name – Name of filter to set.

Raises:

MoveError – If filter wheel cannot be moved.

async set_focus(focus: float, **kwargs: Any) None[source]

Sets new focus.

Parameters:

focus – New focus value.

Raises:

MoveError – If telescope cannot be moved.

async set_focus_offset(offset: float, **kwargs: Any) None[source]

Sets focus offset.

Parameters:

offset – New focus offset.

Raises:
  • ValueError – If given value is invalid.

  • MoveError – If telescope cannot be moved.

async set_offsets_radec(dra: float, ddec: float, **kwargs: Any) None[source]

Move an RA/Dec offset.

Parameters:
  • dra – RA offset in degrees.

  • ddec – Dec offset in degrees.

Raises:

MoveError – If telescope cannot be moved.

async stop_motion(device: str | None = None, **kwargs: Any) None[source]

Stop the motion.

Parameters:

device – Name of device to stop, or None for all.