poliastro2.core.ephem

Functions

build_ephem_interpolant(body, epochs[, ...])

Interpolates ephemerides data.

Classes

BaseInterpolator()

Ephem(coordinates, epochs, plane)

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

SincInterpolator()

SplineInterpolator([kind])

class poliastro2.core.ephem.BaseInterpolator
interpolate(epochs, reference_epochs, coordinates)
class poliastro2.core.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:
  • coordinates (astropy.coordinates.CartesianRepresentation) – Coordinates with velocities.

  • epochs (astropy.time.Time) – Epochs corresponding to the coordinates.

  • plane (Planes) – Reference plane of the coordinates.

property epochs

Epochs at which the ephemerides was originally sampled.

classmethod from_body(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(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(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.

property plane

Reference plane of the ephemerides.

rv(epochs=None, **kwargs)

Position and velocity vectors at given epochs.

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

  • **kwargs – Extra kwargs for interpolation method.

sample(epochs=None, *, interpolator=<poliastro2.core.ephem.SplineInterpolator object>)

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.

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

Returns:

Sampled coordinates with velocities.

Return type:

CartesianRepresentation

class poliastro2.core.ephem.SincInterpolator
interpolate(epochs, reference_epochs, coordinates)
class poliastro2.core.ephem.SplineInterpolator(kind='cubic')
interpolate(epochs, reference_epochs, coordinates)
poliastro2.core.ephem._get_destination_frame(attractor, plane, epochs)
poliastro2.core.ephem.build_ephem_interpolant(body, epochs, attractor=((None, <Quantity 1.32712442e+20 m3 / s2>, 'Sun', '☉', <Quantity 6.957e+08 m>, <Quantity 0. km>, <Quantity 0. km>, <Quantity 25.38 d>, <Quantity 2.2e-07>, <Quantity 0.>, <Quantity 1.98840987e+30 kg>, <Quantity 0. km>), <Quantity 3.98600442e+14 m3 / s2>, 'Earth', '♁', <Quantity 6378136.6 m>, <Quantity 6356751.9 m>, <Quantity 6371008.4 m>, <Quantity 0.9972698 d>, <Quantity 0.00108263>, <Quantity -2.53266132e-06>, <Quantity 5.97216787e+24 kg>, <Quantity 1.49597871e+08 km>))

Interpolates ephemerides data.

Parameters:
  • body (Body) – Source body.

  • epochs (Time) – Array of time values, can be generated with poliastro.util.time_range.

  • attractor (Body, optional) – Attractor, default to Earth.

Returns:

interpolant – Interpolant function that receives time increment in seconds since the initial epoch.

Return type:

callable