boinor.ephem

calculate Ephemerides of objects

Attributes

EPHEM_FORMAT

Classes

BaseInterpolator

Dummy interpolator, the correct one has to be set

SincInterpolator

Whittaker-Shannon interpolator

SplineInterpolator

spline interpolator, by default a cubic spline is used

Ephem

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

Functions

build_ephem_interpolant(body, epochs[, attractor])

Interpolates ephemerides data.

Module Contents

boinor.ephem.EPHEM_FORMAT = 'Ephemerides at {num} epochs from {start} ({start_scale}) to {end} ({end_scale})'
boinor.ephem.build_ephem_interpolant(body, epochs, attractor=Earth)

Interpolates ephemerides data.

Parameters:
  • body (Body) – Source body.

  • epochs (Time) – Array of time values, can be generated with boinor.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

class boinor.ephem.BaseInterpolator

Dummy interpolator, the correct one has to be set

abstractmethod interpolate(epochs, reference_epochs, coordinates)

Dummy interpolation function, the correct one has to be set

class boinor.ephem.SincInterpolator

Whittaker-Shannon interpolator

interpolate(epochs, reference_epochs, coordinates)

Interpolation function of the Whittaker-Shannon interpolator

class boinor.ephem.SplineInterpolator(kind='cubic')

spline interpolator, by default a cubic spline is used

interpolate(epochs, reference_epochs, coordinates)

interpolation function of the spline interpolator (by default a cubic spline is used)

class boinor.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__()
__repr__()
property epochs

Epochs at which the ephemerides was originally sampled.

property coordinates

Coordinates with velocitiy.

property plane

Reference plane of the ephemerides.

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.

sample(epochs=None, *, interpolator=SplineInterpolator())

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

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.