CelestialBody¶

class
CelestialBody
¶ Represents a celestial body (such as a planet or moon). See
SpaceCenter.bodies
.
name
¶ The name of the body.
Attribute: Readonly, cannot be set Return type: string

satellites
¶ A list of celestial bodies that are in orbit around this celestial body.
Attribute: Readonly, cannot be set Return type: List of SpaceCenter.CelestialBody

orbit
¶ The orbit of the body.
Attribute: Readonly, cannot be set Return type: SpaceCenter.Orbit

mass
¶ The mass of the body, in kilograms.
Attribute: Readonly, cannot be set Return type: number

gravitational_parameter
¶ The standard gravitational parameter of the body in \(m^3s^{2}\).
Attribute: Readonly, cannot be set Return type: number

surface_gravity
¶ The acceleration due to gravity at sea level (mean altitude) on the body, in \(m/s^2\).
Attribute: Readonly, cannot be set Return type: number

rotational_period
¶ The sidereal rotational period of the body, in seconds.
Attribute: Readonly, cannot be set Return type: number

rotational_speed
¶ The rotational speed of the body, in radians per second.
Attribute: Readonly, cannot be set Return type: number

rotation_angle
¶ The current rotation angle of the body, in radians. A value between 0 and \(2\pi\)
Attribute: Readonly, cannot be set Return type: number

initial_rotation
¶ The initial rotation angle of the body (at UT 0), in radians. A value between 0 and \(2\pi\)
Attribute: Readonly, cannot be set Return type: number

equatorial_radius
¶ The equatorial radius of the body, in meters.
Attribute: Readonly, cannot be set Return type: number

surface_height
(latitude, longitude)¶ 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:  latitude (number) – Latitude in degrees.
 longitude (number) – Longitude in degrees.
Return type: number

bedrock_height
(latitude, longitude)¶ 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 seabed and is therefore negative value.
Parameters:  latitude (number) – Latitude in degrees.
 longitude (number) – Longitude in degrees.
Return type: number

msl_position
(latitude, longitude, reference_frame)¶ The position at mean sea level at the given latitude and longitude, in the given reference frame.
Parameters:  latitude (number) – Latitude in degrees.
 longitude (number) – Longitude in degrees.
 reference_frame (SpaceCenter.ReferenceFrame) – Reference frame for the returned position vector.
Returns: Position as a vector.
Return type: Tuple of (number, number, number)

surface_position
(latitude, longitude, reference_frame)¶ 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:  latitude (number) – Latitude in degrees.
 longitude (number) – Longitude in degrees.
 reference_frame (SpaceCenter.ReferenceFrame) – Reference frame for the returned position vector.
Returns: Position as a vector.
Return type: Tuple of (number, number, number)

bedrock_position
(latitude, longitude, reference_frame)¶ 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 seabed.
Parameters:  latitude (number) – Latitude in degrees.
 longitude (number) – Longitude in degrees.
 reference_frame (SpaceCenter.ReferenceFrame) – Reference frame for the returned position vector.
Returns: Position as a vector.
Return type: Tuple of (number, number, number)

position_at_altitude
(latitude, longitude, altitude, reference_frame)¶ The position at the given latitude, longitude and altitude, in the given reference frame.
Parameters:  latitude (number) – Latitude in degrees.
 longitude (number) – Longitude in degrees.
 altitude (number) – Altitude in meters above sea level.
 reference_frame (SpaceCenter.ReferenceFrame) – Reference frame for the returned position vector.
Returns: Position as a vector.
Return type: Tuple of (number, number, number)

altitude_at_position
(position, reference_frame)¶ The altitude, in meters, of the given position in the given reference frame.
Parameters:  position (Tuple) – Position as a vector.
 reference_frame (SpaceCenter.ReferenceFrame) – Reference frame for the position vector.
Return type: number

latitude_at_position
(position, reference_frame)¶ The latitude of the given position, in the given reference frame.
Parameters:  position (Tuple) – Position as a vector.
 reference_frame (SpaceCenter.ReferenceFrame) – Reference frame for the position vector.
Return type: number

longitude_at_position
(position, reference_frame)¶ The longitude of the given position, in the given reference frame.
Parameters:  position (Tuple) – Position as a vector.
 reference_frame (SpaceCenter.ReferenceFrame) – Reference frame for the position vector.
Return type: number

sphere_of_influence
¶ The radius of the sphere of influence of the body, in meters.
Attribute: Readonly, cannot be set Return type: number

has_atmosphere
¶ True
if the body has an atmosphere.Attribute: Readonly, cannot be set Return type: boolean

atmosphere_depth
¶ The depth of the atmosphere, in meters.
Attribute: Readonly, cannot be set Return type: number

atmospheric_density_at_position
(position, reference_frame)¶ The atmospheric density at the given position, in \(kg/m^3\), in the given reference frame.
Parameters:  position (Tuple) – The position vector at which to measure the density.
 reference_frame (SpaceCenter.ReferenceFrame) – Reference frame that the position vector is in.
Return type: number

has_atmospheric_oxygen
¶ True
if there is oxygen in the atmosphere, required for airbreathing engines.Attribute: Readonly, cannot be set Return type: boolean

temperature_at
(position, reference_frame)¶ The temperature on the body at the given position, in the given reference frame.
Parameters:  position (Tuple) – Position as a vector.
 reference_frame (SpaceCenter.ReferenceFrame) – The reference frame that the position is in.
Return type: number
Note
This calculation is performed using the bodies current position, which means that the value could be wrong if you want to know the temperature in the far future.

density_at
(altitude)¶ Gets the air density, in \(kg/m^3\), for the specified altitude above sea level, in meters.
Parameters: altitude (number) – Return type: number 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.

pressure_at
(altitude)¶ Gets the air pressure, in Pascals, for the specified altitude above sea level, in meters.
Parameters: altitude (number) – Return type: number

biomes
¶ The biomes present on this body.
Attribute: Readonly, cannot be set Return type: Set of string

biome_at
(latitude, longitude)¶ The biome at the given latitude and longitude, in degrees.
Parameters:  latitude (number) –
 longitude (number) –
Return type: string

flying_high_altitude_threshold
¶ The altitude, in meters, above which a vessel is considered to be flying “high” when doing science.
Attribute: Readonly, cannot be set Return type: number

space_high_altitude_threshold
¶ The altitude, in meters, above which a vessel is considered to be in “high” space when doing science.
Attribute: Readonly, cannot be set Return type: number

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 xaxis points from the center of the body towards the intersection of the prime meridian and equator (the position at 0° longitude, 0° latitude).
 The yaxis points from the center of the body towards the north pole.
 The zaxis points from the center of the body towards the equator at 90°E longitude.
Attribute: Readonly, cannot be set Return type: SpaceCenter.ReferenceFrame

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 xaxis points in an arbitrary direction through the equator.
 The yaxis points from the center of the body towards the north pole.
 The zaxis points in an arbitrary direction through the equator.
Attribute: Readonly, cannot be set Return type: SpaceCenter.ReferenceFrame

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 xaxis points in the orbital antiradial direction.
 The yaxis points in the orbital prograde direction.
 The zaxis points in the orbital normal direction.
Attribute: Readonly, cannot be set Return type: SpaceCenter.ReferenceFrame

position
(reference_frame)¶ The position of the center of the body, in the specified reference frame.
Parameters: reference_frame (SpaceCenter.ReferenceFrame) – The reference frame that the returned position vector is in. Returns: The position as a vector. Return type: Tuple of (number, number, number)

velocity
(reference_frame)¶ The linear velocity of the body, in the specified reference frame.
Parameters: reference_frame (SpaceCenter.ReferenceFrame) – The reference frame that the returned velocity vector is in. Returns: The velocity as a vector. The vector points in the direction of travel, and its magnitude is the speed of the body in meters per second. Return type: Tuple of (number, number, number)

rotation
(reference_frame)¶ The rotation of the body, in the specified reference frame.
Parameters: reference_frame (SpaceCenter.ReferenceFrame) – The reference frame that the returned rotation is in. Returns: The rotation as a quaternion of the form \((x, y, z, w)\). Return type: Tuple of (number, number, number, number)

direction
(reference_frame)¶ The direction in which the north pole of the celestial body is pointing, in the specified reference frame.
Parameters: reference_frame (SpaceCenter.ReferenceFrame) – The reference frame that the returned direction is in. Returns: The direction as a unit vector. Return type: Tuple of (number, number, number)

angular_velocity
(reference_frame)¶ The angular velocity of the body in the specified reference frame.
Parameters: reference_frame (SpaceCenter.ReferenceFrame) – The reference frame the returned angular velocity is in. Returns: The angular velocity as a vector. The magnitude of the vector is the rotational speed of the body, in radians per second. The direction of the vector indicates the axis of rotation, using the righthand rule. Return type: Tuple of (number, number, number)
