Skip to content

Celestial bodies

Source: AI/Tools/CelestialBodyTools.cs

Two tools for accessing the SPICE-backed ephemeris and intrinsic geophysical properties of celestial items.

GetEphemerisAsStateVectors

Get the state vectors (position and velocity) of a target observed from an observer in a given frame over a time range.

Parameter Type Description
observerName CelestialItemsEnum Observer (NAIF-keyed enum)
targetName CelestialItemsEnum Target
frame FramesEnum Output reference frame
startTime ISO 8601 string Window start (Time rules)
endTime ISO 8601 string Window end
timeStep seconds, > 0 Sampling cadence
aberrationCorrection Aberration None, LT, LT+S, …

Returns a list of StateVector (position, velocity, epoch, center of motion, frame).

{
  "observerName": "SUN",
  "targetName": "EARTH",
  "frame": "ICRF",
  "startTime": "2024-06-21T00:00:00",
  "endTime": "2024-06-22T00:00:00",
  "timeStep": 3600,
  "aberrationCorrection": "None"
}

GetCelestialBodyProperties

Get the geophysical properties of a celestial body: NAIF IDs, name, tri-axial radii, GM, body-fixed frame, and zonal harmonics J2/J3/J4.

Parameter Type Description
celestialBodyName PlanetsMoonsEnum Body with an ellipsoid model

Returns a CelestialBody record with the body's intrinsic parameters.

{ "celestialBodyName": "EARTH" }