1. Body#

class Body(name: str, spice_id: int | str = None, mass: ArrayWUnits = None)#

Bases: object

Defines the simplest form of ephemeris object in Scarabaeus.

From NAIF [1]:

“An ephemeris object is any object that may have ephemeris or trajectory data such as a planet, natural satellite, tracking station, spacecraft, barycenter (the center of mass of a group of bodies), asteroid, or comet. Each body in the solar system is associated with an integer code for use with SPICE.”

Body objects serve to hold information relevant to some ephemeris object that exists within the kernel pool.

Parameters:
  • name (str) – The unique name of the body.

  • spice_id (int or str, optional) – The NAIF ID code of the object. May be given as an integer ID or as a string. Defaults to None.

  • mass (ArrayWUnits, optional) – The mass of the body object. Recommend expressed in units of kilograms. Defaults to None.

:raises ValueError(`'Body not found in the kernel pool. A SPICE ID must be provided as an input for new bodies.'): | Raised when a ``name` parameter is passed without a spice_id and no ephemeris object with matching name is found in any of the furnished kernels. :raises ValueError(`'Input SPICE ID does not match the SPICE ID found in the kernel pool for the body.'): | Raised when both a ``name` and spice_id parameter are passed, but the given spice_id does not align with the ID assigned to the object by the furnished kernels.

See also

scarabaeus.SpiceManager

Provides many useful methods related to SPICE objects.

Notes

Body can automatically assign a SPICE ID to an object given a name if that name matches the name of the object in the kernel pool.

References

Attributes

mass

The mass of the Body object.

name

The name of the Body object.

spice_id

The SPICE ID of the Body object.

Methods

get_state(epoch_0[, reference_frame, origin])

Retrieves the state of the body relative to a given origin in a specified reference frame.

get_state(epoch_0, reference_frame: str = 'J2000', origin: str = 'EARTH')#

Retrieves the state of the body relative to a given origin in a specified reference frame.

Parameters:
  • epoch_0 (EpochArray) – The epoch times for which the state is to be computed.

  • reference_frame (str) – The reference frame in which the state is desired. Defaults to ‘J2000’.

  • origin (str) – The origin body relative to which the state is computed. Defaults to 'EARTH'.

Returns:

state_vector – The state vector of the body relative to the origin.

Return type:

ArrayWUnits

property mass: ArrayWUnits#

The mass of the Body object.

property name: str#

The name of the Body object.

property spice_id: int | str#

The SPICE ID of the Body object.