astra.utils.frames#
Conversion between Astra’s internal ICRS coordinates and the mount’s frame.
Astra works in ICRS (J2000) everywhere: schedule ra/dec, SIMBAD lookups,
JPL Horizons positions and the astrometric planet positions from astropy. A mount
may expect a different frame. The ASCOM EquatorialSystem property says which
one. Most modern drivers report equTopocentric, the apparent coordinates of
date (JNow). Sending J2000 coordinates to such a mount misses by the precession
since 2000, about 20 arcminutes in the mid 2020s.
The observatory reads EquatorialSystem once per mount and converts at the
hardware boundary, just before a slew or sync. A mount that reports J2000, or
whose property cannot be read, gets the ICRS coordinates unchanged.
Functions
|
Convert a position read from the mount into ICRS. |
|
Return True if coordinates must be transformed before reaching the mount. |
|
Parse an ASCOM enum value or a config string into an EquatorialSystem. |
|
Convert an ICRS position to the mount's frame. |
Classes
|
ASCOM |
- class astra.utils.frames.EquatorialSystem(value)[source]#
Bases:
IntEnumASCOM
EquatorialCoordinateTypevalues reported byEquatorialSystem.- OTHER = 0#
- TOPOCENTRIC = 1#
- J2000 = 2#
- J2050 = 3#
- B1950 = 4#
- astra.utils.frames.parse_equatorial_system(value: object) EquatorialSystem | None[source]#
Parse an ASCOM enum value or a config string into an EquatorialSystem.
Accepts the integer the driver returns (0 to 4) or a name such as “J2000” or “JNow”, in any case. Returns None for “auto”, for an unknown value, and for anything that is not an int or a str. None means “unknown, send ICRS unchanged”.
- astra.utils.frames.to_mount_frame(ra_deg: float, dec_deg: float, system: EquatorialSystem | None, obstime: Time | None = None, location: EarthLocation | None = None) tuple[float, float][source]#
Convert an ICRS position to the mount’s frame.
- Parameters:
ra_deg – ICRS right ascension in degrees.
dec_deg – ICRS declination in degrees.
system – The mount’s
EquatorialSystem. None, J2000 and OTHER return the input unchanged.obstime – Time of the slew. Defaults to now. Needed for JNow and B1950.
location – Observer location. Improves the JNow result slightly.
- Returns:
(ra_deg, dec_deg) in the mount’s frame.
- astra.utils.frames.from_mount_frame(ra_deg: float, dec_deg: float, system: EquatorialSystem | None, obstime: Time | None = None, location: EarthLocation | None = None) tuple[float, float][source]#
Convert a position read from the mount into ICRS. Inverse of to_mount_frame.
- astra.utils.frames.needs_conversion(system: EquatorialSystem | None) bool[source]#
Return True if coordinates must be transformed before reaching the mount.