poliastro.ephem

Module Contents

Classes

InterpolationMethods

Interpolation methods to sample the ephemerides.

Ephem

Time history of position and velocity of some object at particular epochs.

Functions

build_ephem_interpolant(body, period, t_span, rtol=1e-05)

Interpolates ephemerides data

Attributes

EPHEM_FORMAT

poliastro.ephem.EPHEM_FORMAT = Ephemerides at {num} epochs from {start} ({start_scale}) to {end} ({end_scale})
class poliastro.ephem.InterpolationMethods

Bases: enum.Enum

Interpolation methods to sample the ephemerides.

SINC
SPLINES
poliastro.ephem.build_ephem_interpolant(body, period, t_span, rtol=1e-05)

Interpolates ephemerides data

Parameters
  • body (Body) – Source body.

  • period (Quantity) – Orbital period.

  • t_span (list(Quantity)) – Initial and final epochs.

  • rtol (float, optional) – Relative tolerance. Controls the number of sampled data points, defaults to 1e-5.

Returns

intrp – Interpolated function.

Return type

interp1d

class poliastro.ephem.Ephem(coordinates, epochs, plane)

Time history of position and velocity of some object at particular epochs.

Instead of creating Ephem objects directly, use the available classmethods.

Parameters
__str__(self)

Return str(self).

__repr__(self)

Return repr(self).

property epochs(self)

Epochs at which the ephemerides was originally sampled.

property plane(self)

Reference plane of the ephemerides.

classmethod from_body(cls, body, epochs, *, attractor=None, plane=Planes.EARTH_EQUATOR)

Return Ephem for a SolarSystemPlanet at certain epochs.

Parameters
  • body (SolarSystemPlanet) – Body.

  • epochs (Time) – Epochs to sample the body positions.

  • attractor (SolarSystemPlanet, optional) – Body to use as central location, if not given the Solar System Barycenter will be used.

  • plane (Planes, optional) – Fundamental plane of the frame, default to Earth Equator.

classmethod from_horizons(cls, name, epochs, *, attractor=None, plane=Planes.EARTH_EQUATOR, id_type=None)

Return Ephem for an object using JPLHorizons module of Astroquery.

Parameters
  • name (str) – Name of the body to query for.

  • epochs (Time) – Epochs to sample the body positions.

  • attractor (SolarSystemPlanet, optional) – Body to use as central location, if not given the Solar System Barycenter will be used.

  • plane (Planes, optional) – Fundamental plane of the frame, default to Earth Equator.

  • id_type (NoneType or str, optional) – Use “smallbody” for Asteroids and Comets and None (default) to first search for Planets and Satellites.

classmethod from_orbit(cls, orbit, epochs, plane=Planes.EARTH_EQUATOR)

Return Ephem from an Orbit at certain epochs.

Parameters
  • orbit (Orbit) – Orbit.

  • epochs (Time) – Epochs to sample the orbit positions.

  • plane (Planes, optional) – Fundamental plane of the frame, default to Earth Equator.

sample(self, epochs=None, *, method=InterpolationMethods.SPLINES, **kwargs)

Returns coordinates at specified epochs.

Parameters
  • epochs (Time, optional) – Epochs to sample the ephemerides, if not given the original one from the object will be used.

  • method (InterpolationMethods, optional) – Interpolation method to use for epochs outside of the original ones, default to splines.

Returns

Sampled coordinates with velocities.

Return type

CartesianRepresentation

rv(self, epochs=None, **kwargs)

Position and velocity vectors at given epochs.

Parameters

epochs (Time, optional) – Epochs to sample the ephemerides, default to now.