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, FitsHeaderEntry][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(position: tuple[float, float] | None = None, offsets: tuple[float, float] | None = None, pointing_offset: tuple[float, float] | None = None, move_accuracy: float = 2.0, speed: float = 20.0, focus: float = 50.0, filters: list[str] | None = None, filter_name: str = 'clear', drift: tuple[float, float] | None = None, focal_length: float = 5000.0, wait_secs: float = 1.0, **kwargs: Any)

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

A dummy telescope for testing.

Creates a new dummy telescope.

Parameters:
  • position – Initial RA/Dec position in degrees.

  • offsets – Initial RA/Dec offsets in degrees.

  • pointing_offset – Pointing offset in RA/Dec in arcsecs.

  • move_accuracy – Accuracy of movements in arcsec (random error after any movement).

  • speed – Speed of telescope in deg/sec.

  • focus – Initial focus value.

  • filters – List of available filters.

  • filter_name – Initial filter name.

  • drift – RA/Dec drift in arcsec/sec.

  • focal_length – Focal length in mm.

  • wait_secs – Wait time between slew checks in seconds.

async get_fits_header_before(namespaces: list[str] | None = None, **kwargs: Any) dict[str, FitsHeaderEntry][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 init(**kwargs: Any) None[source]

Initialize telescope.

async open() None[source]

Open module.

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

Park telescope.

property real_pos: SkyCoord

Current position including offsets and drift.

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

Set the current filter.

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

Sets new focus.

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.

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.