adam_core.observers.state module

adam_core.observers.state.clear_observer_state_cache() None[source]

Clear the in-process observer-state cache (primarily for tests/benchmarks).

adam_core.observers.state.get_mpc_observer_state(code: str, times: Timestamp, frame: Literal['ecliptic', 'equatorial', 'itrf93'] = 'ecliptic', origin: OriginCodes = OriginCodes.SUN) CartesianCoordinates[source]

Get the state of an MPC observatory on Earth.

Combines Earth SPICE state and rotation with MPC observatory parallax coefficients.

Parameters:
  • code (str) – The MPC observatory code of the observer.

  • times (Timestamp) – The times at which to get the observer state.

  • frame ({'ecliptic', 'equatorial', 'itrf93'}) – The frame in which to return the observer state.

adam_core.observers.state.get_observer_state(code: str | OriginCodes, times: Timestamp, frame: Literal['ecliptic', 'equatorial', 'itrf93'] = 'ecliptic', origin: OriginCodes = OriginCodes.SUN) CartesianCoordinates[source]

Find state vectors for an observer at a given time in the given frame and measured from the given origin.

For NAIF Origin Codes this function uses the SPICE kernels to find the state vectors. See ~adam_core.utils.spice.get_perturber_state for more information.

For MPC observatory codes this function currently only supports ground-based observers on Earth. In this case, the Earth body-fixed frame used for calculations is the standard ITRF93, which takes into account:

  • precession (IAU-1976)

  • nutation (IAU-1980 with IERS corrections)

  • polar motion

This frame is retrieved through SPICE.

Parameters:
  • code (Union[str, OriginCodes]) – MPC observatory code as string, custom SPICE kernel NAIF code as string, or NAIF origin code for which to find the states.

  • times (Timestamp (N)) – Epochs for which to find the observatory locations.

  • frame ({'equatorial', 'ecliptic'}) – Return observer state in the equatorial or ecliptic J2000 frames.

  • origin (OriginCodes) – The NAIF ID of the origin.

Returns:

observer_states – The state vectors of the observer in the desired frame and measured from the desired origin.

Return type:

~adam_core.coordinates.cartesian.CartesianCoordinates