Atmosphere

A Structure closely tied to Body A variable of type Atmosphere usually is obtained by the :ATM suffix of a Body. ALL The following values are read-only. You can’t change the value of a body’s atmosphere.

structure Atmosphere
Suffix Type Description
BODY string Name of the celestial body
EXISTS boolean True if this body has an atmosphere
OXYGEN boolean True if oxygen is present
SCALE (DEPRECATED) scalar Used to find atmospheric density
SEALEVELPRESSURE scalar (atm) pressure at sea level
ALTITUDEPRESSURE(altitude) scalar (atm) pressure at the givel altitude
HEIGHT scalar (m) advertised atmospheric height
Atmosphere:BODY
Type:string
Access:Get only

The Body that this atmosphere is around - as a STRING NAME, not a Body object.

Atmosphere:EXISTS
Type:boolean
Access:Get only

True if this atmosphere is “real” and not just a dummy placeholder.

Atmosphere:OXYGEN
Type:boolean
Access:Get only

True if the air has oxygen and could therefore be used by a jet engine’s intake.

Atmosphere:SEALEVELPRESSURE
Type:scalar (atm)
Access:Get only

Pressure at the body’s sea level.

Result is returned in Atmospheres. 1.0 Atmosphere = same as Kerbin or Earth. If you prefer to see the answer in KiloPascals, multiply the answer by Constant:AtmToKPa.

Warning

Changed in version 1.1.0: Previous versions returned this value in KiloPascals by mistake, which has now been changed to Atmospheres.

Atmosphere:ALTITUDEPRESSURE(altitude)
Parameters:
  • altitude – The altitude above sea level (in meters) you want to know the pressure for.
Return type:

scalar (atm)

Number of Atm’s of atmospheric pressure at the given altitude. If you pass in zero, you should get the sea level pressure. If you pass in 10000, you get the pressure at altitude=10,000m. This will return zero if the body has no atmosphere, or if the altitude you pass in is above the max atmosphere altitude for the body.

Result is returned in Atmospheres. 1.0 Atmosphere = same as Kerbin or Earth. If you prefer to see the answer in KiloPascals, multiply the answer by Constant:AtmToKPa.

Atmosphere:HEIGHT
Type:scalar (m)
Access:Get only

The altitude at which the atmosphere is “officially” advertised as ending. (actual ending value differs, see below).

Deprecated Suffix

Atmosphere:SCALE
Type:scalar
Access:Get only

A math constant plugged into a formula to find atmosphere density.

Note

Deprecated since version 0.17.2: Removed to account for significant changes to planetary atmosphere mechanics introduced in KSP 1.0

Atmospheric Math

Note

[Section deleted]

This documentation used to contain a description of how the math for Kerbal Space Program’s default stock atmospheric model works, but everything that was mentioned here became utterly false when KSP 1.0 was released with a brand new atmospheric model that invalided pretty much everything that was said here. Rather than teach people incorrect information, it was deemed that no documentation is better than misleading documentation, so this section below this point has been removed.