CelestialBody#

CelestialBody

Represents a celestial body (such as a planet or moon). See GET /space-center/bodies.

A CelestialBody object is passed and returned as its identifier, a number. A path that acts on an object takes it as (id).

GET /space-center/celestial-body/(id)/name#

The name of the body.

Parameters:
Response JSON Object:
  • value (string)

GET /space-center/celestial-body/(id)/satellites#

A list of celestial bodies that are in orbit around this celestial body.

Parameters:
Response JSON Object:
  • value (list<SpaceCenter.CelestialBody>)

GET /space-center/celestial-body/(id)/orbit#

The orbit of the body.

Parameters:
Response JSON Object:
  • value (SpaceCenter.Orbit?)

GET /space-center/celestial-body/(id)/mass#

The mass of the body, in kilograms.

Parameters:
Response JSON Object:
  • value (double)

GET /space-center/celestial-body/(id)/gravitational-parameter#

The standard gravitational parameter of the body in \(\mathrm{m^{3} \cdot s^{-2}}\). This is \(GM\), where \(G\) is the gravitational constant and \(M\) the mass of the body.

Parameters:
Response JSON Object:
  • value (double)

GET /space-center/celestial-body/(id)/surface-gravity#

The acceleration due to gravity at sea level (mean altitude) on the body, in \(\mathrm{m/s^{2}}\).

Parameters:
Response JSON Object:
  • value (double)

GET /space-center/celestial-body/(id)/rotational-period#

The sidereal rotational period of the body, in seconds.

Parameters:
Response JSON Object:
  • value (double)

GET /space-center/celestial-body/(id)/rotational-speed#

The rotational speed of the body, in \(\mathrm{rad/s}\).

Parameters:
Response JSON Object:
  • value (double)

GET /space-center/celestial-body/(id)/rotation-angle#

The current rotation angle of the body, in radians. A value between 0 and \(2\pi\).

Parameters:
Response JSON Object:
  • value (double)

GET /space-center/celestial-body/(id)/initial-rotation#

The initial rotation angle of the body (at UT 0), in radians. A value between 0 and \(2\pi\).

Parameters:
Response JSON Object:
  • value (double)

GET /space-center/celestial-body/(id)/equatorial-radius#

The equatorial radius of the body, in meters.

Parameters:
Response JSON Object:
  • value (double)

POST /space-center/celestial-body/(id)/surface-height#

The height of the surface relative to mean sea level, in meters, at the given position. When over water this is equal to 0.

Parameters:
Request JSON Object:
  • latitude (double) – Latitude in degrees.

  • longitude (double) – Longitude in degrees.

Response JSON Object:
  • value (double)

POST /space-center/celestial-body/(id)/bedrock-height#

The height of the surface relative to mean sea level, in meters, at the given position. When over water, this is the height of the sea-bed and is therefore negative value.

Parameters:
Request JSON Object:
  • latitude (double) – Latitude in degrees.

  • longitude (double) – Longitude in degrees.

Response JSON Object:
  • value (double)

POST /space-center/celestial-body/(id)/msl-position#

The position at mean sea level at the given latitude and longitude, in the given reference frame.

Parameters:
Request JSON Object:
  • latitude (double) – Latitude in degrees.

  • longitude (double) – Longitude in degrees.

  • reference_frame (SpaceCenter.ReferenceFrame) – Reference frame for the returned position vector.

Response JSON Object:
  • value (tuple<double, double, double>) – Position as a vector.

POST /space-center/celestial-body/(id)/surface-position#

The position of the surface at the given latitude and longitude, in the given reference frame. When over water, this is the position of the surface of the water.

Parameters:
Request JSON Object:
  • latitude (double) – Latitude in degrees.

  • longitude (double) – Longitude in degrees.

  • reference_frame (SpaceCenter.ReferenceFrame) – Reference frame for the returned position vector.

Response JSON Object:
  • value (tuple<double, double, double>) – Position as a vector.

POST /space-center/celestial-body/(id)/bedrock-position#

The position of the surface at the given latitude and longitude, in the given reference frame. When over water, this is the position at the bottom of the sea-bed.

Parameters:
Request JSON Object:
  • latitude (double) – Latitude in degrees.

  • longitude (double) – Longitude in degrees.

  • reference_frame (SpaceCenter.ReferenceFrame) – Reference frame for the returned position vector.

Response JSON Object:
  • value (tuple<double, double, double>) – Position as a vector.

POST /space-center/celestial-body/(id)/position-at-altitude#

The position at the given latitude, longitude and altitude, in the given reference frame.

Parameters:
Request JSON Object:
  • latitude (double) – Latitude in degrees.

  • longitude (double) – Longitude in degrees.

  • altitude (double) – Altitude in meters above sea level.

  • reference_frame (SpaceCenter.ReferenceFrame) – Reference frame for the returned position vector.

Response JSON Object:
  • value (tuple<double, double, double>) – Position as a vector.

POST /space-center/celestial-body/(id)/surface-reference-frame#

Create a reference frame fixed to the surface at the given latitude and longitude.

  • The origin is the given altitude above the surface, at the given latitude and longitude.

  • The axes rotate with the body.

  • The x-axis points out from the center of the body.

  • The y-axis points north.

  • The z-axis points east.

Note

Each call returns a new frame, as for POST /space-center/reference-frame/create-relative.

Parameters:
Request JSON Object:
  • latitude (double) – Latitude in degrees.

  • longitude (double) – Longitude in degrees.

  • altitude (double) – Altitude of the origin above the surface, in meters. Optional, defaults to 0.0.

Response JSON Object:
  • value (SpaceCenter.ReferenceFrame)

POST /space-center/celestial-body/(id)/msl-normal#

The normal to the sphere at mean sea level, at the given latitude and longitude, in the given reference frame. This points straight up, away from the center of the body, and takes no account of the shape of the terrain.

Parameters:
Request JSON Object:
  • latitude (double) – Latitude in degrees.

  • longitude (double) – Longitude in degrees.

  • reference_frame (SpaceCenter.ReferenceFrame) – Reference frame for the returned normal vector.

Response JSON Object:
  • value (tuple<double, double, double>) – The normal as a unit vector.

POST /space-center/celestial-body/(id)/surface-normal#

The normal to the surface at the given latitude and longitude, in the given reference frame. This describes the slope of the terrain, and is the normal of the surface of the water when over water.

Parameters:
Request JSON Object:
  • latitude (double) – Latitude in degrees.

  • longitude (double) – Longitude in degrees.

  • reference_frame (SpaceCenter.ReferenceFrame) – Reference frame for the returned normal vector.

Response JSON Object:
  • value (tuple<double, double, double>) – The normal as a unit vector.

POST /space-center/celestial-body/(id)/bedrock-normal#

The normal to the surface at the given latitude and longitude, in the given reference frame. This describes the slope of the terrain, and is the normal of the sea-bed when over water.

Parameters:
Request JSON Object:
  • latitude (double) – Latitude in degrees.

  • longitude (double) – Longitude in degrees.

  • reference_frame (SpaceCenter.ReferenceFrame) – Reference frame for the returned normal vector.

Response JSON Object:
  • value (tuple<double, double, double>) – The normal as a unit vector.

POST /space-center/celestial-body/(id)/altitude-at-position#

The altitude, in meters, of the given position in the given reference frame.

Parameters:
Request JSON Object:
  • position (tuple<double, double, double>) – Position as a vector.

  • reference_frame (SpaceCenter.ReferenceFrame) – Reference frame for the position vector.

Response JSON Object:
  • value (double)

POST /space-center/celestial-body/(id)/latitude-at-position#

The latitude of the given position, in the given reference frame.

Parameters:
Request JSON Object:
  • position (tuple<double, double, double>) – Position as a vector.

  • reference_frame (SpaceCenter.ReferenceFrame) – Reference frame for the position vector.

Response JSON Object:
  • value (double)

POST /space-center/celestial-body/(id)/longitude-at-position#

The longitude of the given position, in the given reference frame.

Parameters:
Request JSON Object:
  • position (tuple<double, double, double>) – Position as a vector.

  • reference_frame (SpaceCenter.ReferenceFrame) – Reference frame for the position vector.

Response JSON Object:
  • value (double)

GET /space-center/celestial-body/(id)/sphere-of-influence#

The radius of the sphere of influence of the body, in meters.

Parameters:
Response JSON Object:
  • value (double)

GET /space-center/celestial-body/(id)/is-star#

Whether or not the body is a star.

Parameters:
Response JSON Object:
  • value (bool)

GET /space-center/celestial-body/(id)/has-solid-surface#

Whether or not the body has a solid surface.

Parameters:
Response JSON Object:
  • value (bool)

GET /space-center/celestial-body/(id)/has-atmosphere#

true if the body has an atmosphere.

Parameters:
Response JSON Object:
  • value (bool)

GET /space-center/celestial-body/(id)/atmosphere-depth#

The depth of the atmosphere, in meters.

Parameters:
Response JSON Object:
  • value (double)

GET /space-center/celestial-body/(id)/has-ocean#

true if the body has an ocean.

Parameters:
Response JSON Object:
  • value (bool)

GET /space-center/celestial-body/(id)/ocean-density#

The density of the body’s ocean, in \(\mathrm{kg/m^{3}}\). Returns zero if the body has no ocean.

Parameters:
Response JSON Object:
  • value (double)

POST /space-center/celestial-body/(id)/atmospheric-density-at-position#

The atmospheric density at the given position, in \(\mathrm{kg/m^{3}}\), in the given reference frame.

Parameters:
Request JSON Object:
  • position (tuple<double, double, double>) – The position vector at which to measure the density.

  • reference_frame (SpaceCenter.ReferenceFrame) – Reference frame that the position vector is in.

Response JSON Object:
  • value (double)

GET /space-center/celestial-body/(id)/has-atmospheric-oxygen#

true if there is oxygen in the atmosphere, required for air-breathing engines.

Parameters:
Response JSON Object:
  • value (bool)

POST /space-center/celestial-body/(id)/temperature-at#

The temperature on the body at the given position, in the given reference frame.

Note

The atmospheric ephemeris is evaluated at the current universal time.

Parameters:
Request JSON Object:
  • position (tuple<double, double, double>) – Position as a vector.

  • reference_frame (SpaceCenter.ReferenceFrame) – The reference frame that the position is in.

Response JSON Object:
  • value (double)

POST /space-center/celestial-body/(id)/density-at#

Gets the air density, in \(\mathrm{kg/m^{3}}\), for the specified altitude above sea level, in meters.

Note

This is an approximation, because actual calculations, taking sun exposure into account to compute air temperature, require us to know the exact point on the body where the density is to be computed (knowing the altitude is not enough). However, the difference is small for high altitudes, so it makes very little difference for trajectory prediction.

Parameters:
Request JSON Object:
  • altitude (double)

Response JSON Object:
  • value (double)

POST /space-center/celestial-body/(id)/pressure-at#

Gets the static pressure, in Pascals, for the specified altitude above sea level, in meters.

Note

Below sea level on a body with an ocean, this includes the pressure of the water.

Parameters:
Request JSON Object:
  • altitude (double)

Response JSON Object:
  • value (double)

GET /space-center/celestial-body/(id)/biomes#

The biomes present on this body.

Parameters:
Response JSON Object:
  • value (set<string>)

POST /space-center/celestial-body/(id)/biome-at#

The biome at the given latitude and longitude, in degrees.

Parameters:
Request JSON Object:
  • latitude (double)

  • longitude (double)

Response JSON Object:
  • value (string)

GET /space-center/celestial-body/(id)/flying-high-altitude-threshold#

The altitude, in meters, above which a vessel is considered to be flying “high” when doing science.

Parameters:
Response JSON Object:
  • value (float)

GET /space-center/celestial-body/(id)/space-high-altitude-threshold#

The altitude, in meters, above which a vessel is considered to be in “high” space when doing science.

Parameters:
Response JSON Object:
  • value (float)

GET /space-center/celestial-body/(id)/reference-frame#

The reference frame that is fixed relative to the celestial body.

  • The origin is at the center of the body.

  • The axes rotate with the body.

  • The x-axis points from the center of the body towards the intersection of the prime meridian and equator (the position at 0° longitude, 0° latitude).

  • The y-axis points from the center of the body towards the north pole.

  • The z-axis points from the center of the body towards the equator at 90°E longitude.

Parameters:
Response JSON Object:
  • value (SpaceCenter.ReferenceFrame)

../../../_images/celestial-body.png

Celestial body reference frame origin and axes. The equator is shown in blue, and the prime meridian in red.#

GET /space-center/celestial-body/(id)/non-rotating-reference-frame#

The reference frame that is fixed relative to this celestial body, and orientated in a fixed direction (it does not rotate with the body).

  • The origin is at the center of the body.

  • The axes do not rotate.

  • The x-axis points in an arbitrary direction through the equator.

  • The y-axis points from the center of the body towards the north pole.

  • The z-axis points in an arbitrary direction through the equator.

Parameters:
Response JSON Object:
  • value (SpaceCenter.ReferenceFrame)

GET /space-center/celestial-body/(id)/orbital-reference-frame#

The reference frame that is fixed relative to this celestial body, but orientated with the body’s orbital prograde/normal/radial directions.

  • The origin is at the center of the body.

  • The axes rotate with the orbital prograde/normal/radial directions.

  • The x-axis points in the orbital anti-radial direction.

  • The y-axis points in the orbital prograde direction.

  • The z-axis points in the orbital normal direction.

Parameters:
Response JSON Object:
  • value (SpaceCenter.ReferenceFrame)

POST /space-center/celestial-body/(id)/position#

The position of the center of the body, in the specified reference frame.

Parameters:
Request JSON Object:
  • reference_frame (SpaceCenter.ReferenceFrame) – The reference frame that the returned position vector is in.

Response JSON Object:
  • value (tuple<double, double, double>) – The position as a vector.

POST /space-center/celestial-body/(id)/velocity#

The linear velocity of the body, in the specified reference frame.

Parameters:
Request JSON Object:
  • reference_frame (SpaceCenter.ReferenceFrame) – The reference frame that the returned velocity vector is in.

Response JSON Object:
  • value (tuple<double, double, double>) – The velocity as a vector. The vector points in the direction of travel, and its magnitude is the speed of the body in \(\mathrm{m/s}\).

POST /space-center/celestial-body/(id)/rotation#

The rotation of the body, in the specified reference frame.

Parameters:
Request JSON Object:
  • reference_frame (SpaceCenter.ReferenceFrame) – The reference frame that the returned rotation is in.

Response JSON Object:
  • value (tuple<double, double, double, double>) – The rotation as a quaternion of the form (x, y, z, w).

POST /space-center/celestial-body/(id)/direction#

The direction in which the north pole of the celestial body is pointing, in the specified reference frame.

Parameters:
Request JSON Object:
  • reference_frame (SpaceCenter.ReferenceFrame) – The reference frame that the returned direction is in.

Response JSON Object:
  • value (tuple<double, double, double>) – The direction as a unit vector.

POST /space-center/celestial-body/(id)/angular-velocity#

The angular velocity of the body in the specified reference frame.

Parameters:
Request JSON Object:
  • reference_frame (SpaceCenter.ReferenceFrame) – The reference frame the returned angular velocity is in.

Response JSON Object:
  • value (tuple<double, double, double>) – The angular velocity as a vector. The magnitude of the vector is the rotational speed of the body, in \(\mathrm{rad/s}\). The direction of the vector indicates the axis of rotation, using the right-hand rule.