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
orstr
, optional) – The NAIF ID code of the object. May be given as an integer ID or as a string. Defaults toNone
.mass (
ArrayWUnits
, optional) – The mass of the body object. Recommend expressed in units of kilograms. Defaults toNone
.
: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 aspice_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`
andspice_id
parameter are passed, but the givenspice_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
The mass of the Body object.
The name of the Body object.
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:
- property mass: ArrayWUnits#
The mass of the Body object.