Earth's atmosphere has five main layers, defined by how temperature changes with height: the troposphere (surface to about 6 to 20 km), the stratosphere (to about 50 km), the mesosphere (to about 85 km), the thermosphere (to about 600 km) and the exosphere (fading out by about 10,000 km). Space is conventionally said to begin at the 100 km Kármán line, inside the thermosphere, and beyond the air sit the magnetosphere, the Van Allen radiation belts and finally the edge of the Sun's heliosphere.
Below, we climb through each layer with figures from NOAA and NASA, explain why temperature falls, rises, falls and rises again, show what flies at each height, and cover how space weather disturbs GPS, radio and power grids. A hands on section pulls live space weather data from NOAA, and a short note at the end covers where software security fits.
Key takeaways
- Dry air is 78.084% nitrogen, 20.946% oxygen, 0.934% argon and about 0.042% carbon dioxide by volume, according to NOAA. Water vapour adds up to about 4% more and varies by place and day.
- Layers are named by temperature trend, not composition: falling, rising, falling, then rising again with height.
- The troposphere is about 18 to 20 km thick over the equator but only about 6 km over the poles. Almost all weather happens there.
- Most ozone sits in the stratosphere, roughly 10 to 40 km up. The WMO and UNEP 2022 assessment expects the ozone layer to return to 1980 values around 2066 over Antarctica, 2045 over the Arctic and 2040 elsewhere if current policies hold.
- The thermosphere can reach about 2,000 °C, yet would feel cold, because there are so few molecules to carry heat.
- The FAI uses 100 km as the boundary for astronautics. A 2018 paper in Acta Astronautica argues for 80 km instead, close to the 50 statute mile line the US Air Force used for astronaut wings from the late 1950s.
- The ISS orbits in the thermosphere at about 370 to 460 km, GPS satellites at about 20,200 km and geostationary weather satellites at 22,236 miles (about 35,786 km).
- Space weather lives in the upper layers. NOAA says severe storms can push single frequency GPS errors from about a metre to tens of metres, black out HF radio and drive currents into power grids.
What is the air we breathe made of?
The atmosphere is a layer of gas held by gravity that thins out with height without a sharp top. NASA's Earth fact sheet puts its total mass at about 5.1 × 10^18 kg, surface pressure at 1014 millibars and the mean surface temperature at 288 K (15 °C).
NOAA's JetStream school gives the composition of dry air as follows. The top four gases make up 99.998% of it.
| Gas | Share of dry air by volume | Why it matters |
|---|---|---|
| Nitrogen (N2) | 78.084% | Dilutes oxygen so things do not burn too fast; living things need it to make proteins |
| Oxygen (O2) | 20.946% | Respiration and combustion; the raw material for stratospheric ozone |
| Argon (Ar) | 0.934% | Inert noble gas; used in light bulbs and double pane windows |
| Carbon dioxide (CO2) | about 0.042% | Small share, large effect; traps outgoing heat |
| Everything else | trace | Neon, helium, methane, krypton, hydrogen, ozone and others |
These shares are for perfectly dry air. NOAA notes that real air almost always carries water vapour, up to about 4% of the volume, which pushes the other shares down slightly: with 1% water vapour, nitrogen drops to about 77.30% and oxygen to about 20.70%.
The layers at a glance
The table below uses NOAA JetStream for altitudes and temperatures unless noted. Boundaries move with latitude, season and solar activity, so treat every number as typical rather than fixed.
| Layer | Altitude range | Temperature trend | What happens there | What flies there |
|---|---|---|---|---|
| Troposphere | Surface to about 6 km (poles), 9 km (50° latitude), 18 to 20 km (equator) | Falls with height, from an average of about 17 °C to about minus 51 °C | Almost all weather, clouds and storms; most of the atmosphere's mass and nearly all its water vapour | Birds, helicopters, light aircraft, jet airliners (US Class A airspace runs from 18,000 ft to FL 600), weather balloons on their way up |
| Tropopause | Top of the troposphere | Temperature stops falling | Acts as a lid on convection; thunderstorm anvils spread out here | Jets at cruise can be near it, and above it at high latitudes |
| Stratosphere | From 6 to 20 km up to about 50 km | Rises with height, from about minus 51 °C to about minus 15 °C | Ozone layer absorbs ultraviolet light and heats the layer; very little water vapour; holds about 19% of the atmosphere's gases | Scientific balloons (NASA's float near 122,000 ft, about 37 km); the upper limit of US Class A airspace (FL 600, about 18 km) |
| Stratopause | About 50 km | Temperature peaks | Boundary between stratosphere and mesosphere | None routinely |
| Mesosphere | About 50 km to 85 km | Falls with height to the coldest air in the atmosphere | Meteors burn up here; lowest part of the ionosphere (D region) starts around 80 km | Sounding rockets pass through; too high for balloons and aircraft, too low for satellites to stay up |
| Mesopause | About 85 km | Coldest point, as low as about minus 120 °C | Boundary into the thermosphere; the 80 km "edge of space" proposal sits near it | Suborbital crewed flights cross it |
| Thermosphere | About 85 km to 600 km | Rises with height, up to about 2,000 °C | Absorbs solar X rays and extreme ultraviolet; most of the ionosphere; aurora (80 to 500 km per NOAA SWPC); the 100 km Kármán line | International Space Station (370 to 460 km), many low Earth orbit satellites |
| Exosphere | About 600 km to 10,000 km | Very hot in molecular terms but near vacuum | Atoms and molecules can escape to space; the atmosphere fades into the solar wind | Many satellites; the inner Van Allen belt begins about 1,000 miles up |
| Beyond the air | Magnetosphere: 6 to 10 Earth radii on the dayside, a tail hundreds of Earth radii long | Not meaningful as air temperature | Earth's magnetic field holds off the solar wind; radiation belts trap energetic particles | GPS (about 20,200 km), geostationary satellites (22,236 miles), and far beyond, Voyager 1 and 2 outside the heliosphere |
Why does temperature go down, up, down and up again?
If you only remember one idea from this post, make it this one: the layers are defined by where the air gets its heat.
- Troposphere: heated from below. Sunlight passes through the air and warms the ground and oceans, which then warm the air touching them. The further you climb from that heat source, the colder it gets, and the thinner air holds less heat. NOAA gives a drop from an average of about 17 °C at the surface to about minus 51 °C at the tropopause.
- Stratosphere: heated from inside by ozone. Ozone absorbs ultraviolet light, and NASA's Earth Observatory explains that this "ozone oxygen cycle" continuously converts harmful ultraviolet radiation into heat. The higher you go in the stratosphere, the more ultraviolet is available, so temperature rises to about minus 15 °C at the stratopause.
- Mesosphere: little heating, so it cools again. There is too little ozone left to absorb much energy, and the air is too thin to hold heat from below. Temperature falls to the coldest values in the whole atmosphere at the mesopause.
- Thermosphere: heated from above by the Sun's hardest light. The few molecules up here absorb high energy X rays and extreme ultraviolet radiation. NOAA says temperatures rise from as low as about minus 120 °C at the bottom to as high as about 2,000 °C near the top.
The trend also controls how air moves. Where temperature falls with height, warm air below rises, driving convection and storms. Where it rises with height, warm air already sits on top and mixing is suppressed, which is why the stratosphere is calm and dry, and why NOAA points to the anvil tops of thunderstorms as a marker of the tropopause.
The troposphere: where weather and almost everyone lives
The troposphere starts at your feet. Its depth depends strongly on latitude: NOAA puts it at 18 to 20 km over the equator, about 9 km at 50° north and south, and just under 6 km over the poles. Warm tropical air expands and convects higher, so the lid sits higher.
Clouds, rain, fronts, hurricanes and tornadoes all form here, and almost all water vapour stays here. Ozone near the ground is a pollutant: NASA's Earth Observatory notes that tropospheric ozone damages lung tissue and plants, while the same molecule higher up protects life.
What flies here: everything that needs air to fly. Birds, drones, helicopters and propeller aircraft stay low. In the United States, the FAA's Aeronautical Information Manual defines Class A airspace as generally from 18,000 feet above mean sea level up to and including flight level 600, which is where jets on instrument flight plans operate. Jet airliners cruise in the upper troposphere, and at higher latitudes, where the tropopause can be as low as about 9 km, they can cruise in the lowest stratosphere.
The tropopause: a lid, not a wall
The tropopause is where temperature stops falling with height. It is not a surface, and its height changes with latitude and season. Below it, air overturns easily; above it, air is stratified and slow to mix, and there is no rain to wash out what gets lofted there.
The stratosphere and the ozone layer
NOAA describes the stratosphere as running from 6 to 20 km up to about 50 km. It holds about 19% of the atmosphere's gases but very little water vapour, and its temperature increases with height, from an average of about minus 51 °C at the tropopause to about minus 15 °C at the top.
How the ozone layer works
NASA's Earth Observatory places most ozone in the stratosphere, between about 10 and 40 km. The chemistry is a balance:
- High energy ultraviolet light splits an ordinary oxygen molecule (O2) into two oxygen atoms.
- A free oxygen atom joins another O2 to form ozone (O3).
- Ozone absorbs lower energy ultraviolet light and splits back into O2 and a free oxygen atom, which quickly makes ozone again.
That loop turns ultraviolet radiation into heat and shields the surface. NASA notes that a weaker shield would raise risks of skin cancer, cataracts and immune damage.
Why the ozone hole formed, and how it is recovering
From the early 1970s, scientists found evidence that human made chlorine compounds were upsetting the balance. NASA's Earth Observatory explains that chlorofluorocarbons (CFCs) are stable enough to drift intact into the stratosphere, where ultraviolet light breaks them apart. Each freed chlorine atom acts as a catalyst, destroying many ozone molecules before it is bound into hydrogen chloride and rained out, which is why stopping emissions allows recovery.
The Montreal Protocol phased out these substances. The 2022 WMO/UNEP Scientific Assessment of Ozone Depletion, coordinated with NOAA's Chemical Sciences Laboratory and NASA scientists, concluded that if current policies remain in place, the ozone layer should recover to 1980 values around 2066 over the Antarctic, 2045 over the Arctic and 2040 for the rest of the world. The WMO adds that the Antarctic ozone hole has been slowly improving in area and depth since 2000, with year to year swings, such as those between 2019 and 2021, driven largely by weather.
What flies in the stratosphere
Large scientific balloons. NASA's Antarctic campaign launched its first balloon of the season on 22 December 2024, and it reached a float altitude of around 122,000 feet (about 37 km). NASA says its zero pressure balloons can lift up to 8,000 pounds of payload to altitudes above 99.8% of Earth's atmosphere, and its super pressure balloons are designed for flights of 100 days or more. The upper edge of US Class A airspace, FL 600, is about 18 km, so only specialised aircraft operate well into the stratosphere.
The mesosphere: the layer we know least about
The mesosphere runs from about 50 km to 85 km. NOAA notes that its gases are still thick enough to slow meteors, which is where they burn up and leave the trails we see at night. Together, the stratosphere and mesosphere are called the middle atmosphere.
It is hard to study directly: too high for aircraft and balloons, too low and draggy for satellites. Sounding rockets cross it in minutes, and satellites observe it from above.
At the top sits the mesopause, the coldest air in the atmosphere. NOAA gives temperatures as low as about minus 120 °C at the bottom of the thermosphere, just above it. As we will see, the traditional height of the mesopause, around 80 km, is also at the centre of the debate about where space begins.
The thermosphere: hot, thin and full of satellites
Between about 85 km and 600 km lies the thermosphere. It is extremely thin, but its molecules absorb the Sun's X rays and extreme ultraviolet light, so temperature climbs steeply with height. NOAA gives a range from as low as about minus 120 °C at the bottom to as high as about 2,000 °C near the top.
Why 2,000 °C would feel cold
Temperature measures how energetic the molecules are, not how much heat they can deliver. NOAA notes there are too few molecules here to warm your skin.
Drag: the thermosphere slowly pulls satellites down
The thermosphere is thin, but not empty. NASA's ISS reference says the station orbits between 370 and 460 km, "falls towards Earth continually due to atmospheric friction" and needs periodic rocket firings to boost its orbit. Solar activity heats and expands the thermosphere, raising density at a given height and increasing drag. NOAA's Space Weather Prediction Center notes that the extreme ultraviolet and X ray output that powers this layer varies by nearly a factor of ten over the 11 year solar cycle.
NASA says the ISS travels at about five miles per second and makes 16 orbits a day, and plans to keep it operating until at least 2030.
The aurora
NOAA SWPC explains that auroras form when electrons, accelerated in the magnetosphere's night side tail, follow magnetic field lines down to the polar regions and collide with oxygen and nitrogen. The excited atoms and molecules release light as they relax, much like a neon sign. The aurora typically forms 80 to 500 km above the surface, in two ovals around the magnetic poles. During major geomagnetic storms those ovals expand toward the equator, so the aurora can be seen over most of the United States.
The ionosphere: a radio mirror inside the upper atmosphere
The ionosphere is not a separate temperature layer. It is the electrically charged part of the upper atmosphere that overlaps the mesosphere and thermosphere. NOAA SWPC places it between about 80 and 600 km, where extreme ultraviolet and X ray radiation from the Sun knock electrons off atoms and molecules.
SWPC describes three main regions, the D, E and F layers, created by differences in solar radiation and in the gases present at each height. Because sunlight drives most of the ionisation, the night side of Earth and the winter pole have much less of it than the day side.
Why it matters:
- It bends and reflects radio waves. SWPC notes that the ionosphere "reflects and modifies radio waves used for communication and navigation". High frequency (HF) radio uses it to reach over the horizon.
- It delays satellite navigation signals. Every GPS signal crosses the ionosphere on its way to the ground, and the charged plasma bends it like a lens.
- It responds to the Sun within minutes. A solar flare's X rays reach the bottom of the ionosphere, around 80 km, and strengthen the D layer, which can absorb HF radio on the sunlit side of Earth.
The exosphere: where the atmosphere fades into space
NOAA describes the exosphere as the outermost layer, extending from about 600 km (375 miles) to about 10,000 km (6,200 miles). At its base is a transition called the thermopause. Up here, molecules are so far apart that they rarely collide. A fast moving atom can follow a ballistic arc and fall back, or, if it is light and quick enough, escape Earth altogether. NOAA notes that this is a region where "satellites orbit the earth" and atoms and molecules escape into space.
There is no clean top; the exosphere thins until it blends into the solar wind, so different sources give different upper limits.
Where does space begin? The Kármán line and the 80 km debate
There is no physical surface where air ends, so "space begins here" is a definition. Two definitions dominate.
The 100 km Kármán line (FAI)
The Fédération Aéronautique Internationale (FAI), which keeps aeronautics and astronautics records, uses 100 km as the boundary for astronautics. An essay on the FAI's site traces the number to Theodore von Kármán's discussions with scientists in the 1950s. An aircraft flying higher needs ever more speed to get lift from thinner air, until that speed approaches orbital speed; a satellite flying lower meets denser air and cannot stay up without thrust. Calculations put the crossover near 100 km, von Kármán proposed the round number, and the FAI wrote it into Chapter 8 of its Sporting Code. The essay adds that nothing is magic about exactly 100 km, only that "about that altitude, things change".
The 80 km proposal (and the US 50 mile wings)
In 2018, astrophysicist Jonathan McDowell published "The edge of space: Revisiting the Karman Line" in Acta Astronautica (volume 151, pages 668 to 677). He argues that 80 km is a more appropriate boundary than 100 km, based on the orbits and suborbital trajectories real vehicles have flown. In the paper he notes that in the late 1950s the US Air Force decided to award astronaut wings to pilots who flew above 50 statute miles, that the traditional height of the mesopause, 80 km, is within 500 metres of that 50 mile line, and he suggests adopting exactly 80 km as the formal boundary.
Both are conventions. Whether a flight "reached space" can depend on which line you use, and orbit is the harder threshold: reaching 100 km on a straight up hop is far easier than going sideways fast enough to stay up.
Beyond the air: magnetosphere, Van Allen belts and the heliosphere
The magnetosphere
NASA defines a magnetosphere as the region around a planet dominated by its magnetic field. Earth's field is generated by the convective motion of molten iron in the outer core, and it creates a vast comet shaped bubble. The solar wind compresses the sun facing side to about six to 10 Earth radii, while the night side stretches into a magnetotail that can be hundreds of Earth radii long, far past the Moon's orbit at about 60 Earth radii. NASA notes that the magnetosphere shields Earth from solar and cosmic particle radiation and from erosion of the atmosphere by the solar wind.
ESA's three satellite Swarm mission, launched on 22 November 2013, measures this field and the currents in and around Earth.
The Van Allen radiation belts
Inside the magnetosphere are two donut shaped regions where high energy electrons and ions are trapped by the magnetic field. NASA gives the inner belt as extending from about 1,000 to 8,000 miles above the equator, and the outer belt from about 12,000 to 25,000 miles. GPS.gov puts GPS satellites at about 12,550 miles, so the GPS constellation orbits within the range NASA gives for the outer belt, one reason its satellites are built to tolerate radiation. NASA describes this trapped radiation as a kind of space weather that can affect the performance and reliability of technology and pose a threat to astronauts and spacecraft.
The heliosphere and its boundary
Zoom out much further and the Sun has its own bubble. NASA describes the heliosphere as a protective bubble created by the Sun's magnetic field and the outward flow of the solar wind. At the termination shock, the solar wind drops from supersonic to subsonic speed as it pushes against the interstellar medium. The outer edge is the heliopause. Voyager 1 crossed into interstellar space in 2012 and Voyager 2 in 2018; NASA notes they are the only spacecraft to have operated outside the heliosphere.
What flies where: a height ladder
This ladder puts specific objects in order, using the figure each source gives.
| Object or boundary | Typical height | Region |
|---|---|---|
| Upper limit of US Class A airspace (FL 600) | about 18 km | Stratosphere |
| NASA scientific balloon float (December 2024) | about 37 km | Stratosphere |
| Meteors burning up | 50 to 85 km | Mesosphere |
| Proposed 80 km boundary, USAF 50 mile wings | 80 km | Near the mesopause |
| Kármán line | 100 km | Thermosphere |
| International Space Station | 370 to 460 km | Thermosphere |
| Inner Van Allen belt | about 1,000 to 8,000 miles | Magnetosphere |
| GPS satellites | about 20,200 km (12,550 miles) | Medium Earth orbit |
| Geostationary weather satellites (GOES) | 22,236 miles, about 35,786 km | Geostationary orbit |
| Heliopause | crossed by Voyager 1 (2012) and Voyager 2 (2018) | Edge of the heliosphere |
GPS.gov says the US Space Force maintains at least 24 operational GPS satellites 95% of the time in six orbital planes, with 31 operational as of 3 July 2023, each circling Earth twice a day. NOAA's GOES satellites orbit above the equator at the rate Earth turns, so each watches one region continuously.
How thin does the air get? A worked example
NASA's fact sheet gives two numbers that let you estimate pressure at any height: surface pressure of 1014 millibars and a scale height of 8.5 km. In the simplest model, which assumes a single constant temperature, pressure falls exponentially:
P(h) = P0 * exp(-h / H)
P0 = 1014 mb (surface pressure, NASA Earth fact sheet)
H = 8.5 km (scale height, NASA Earth fact sheet)
Worked numbers:
| Height | h / H | exp(-h / H) | Estimated pressure | Share of the atmosphere above you |
|---|---|---|---|---|
| 5.5 km | 0.65 | 0.52 | about 531 mb | about half |
| 10 km | 1.18 | 0.31 | about 313 mb | about 31% |
| 18.3 km (FL 600) | 2.15 | 0.12 | about 118 mb | about 12% |
| 37 km (balloon float) | 4.38 | 0.013 | about 13 mb | about 1.3% |
| 100 km (Kármán line) | 11.8 | 0.0000078 | about 0.008 mb | about a millionth |
Two lessons come out of this.
First, half of the atmosphere by mass lies below about 5.5 km in this model, which is why a short climb changes breathing so much and why most of the atmosphere's mass, and its weather, is packed into the troposphere.
Second, the model is rough. It leaves about 1.3% of the atmosphere above a 37 km balloon, while NASA says its zero pressure balloons fly above 99.8% of it. The real atmosphere is colder aloft than at the surface, and colder air has a smaller scale height, so pressure falls faster than one number predicts; NASA's balloons can also float higher than the flight quoted here. Use the formula for intuition and a standard atmosphere table for precision.
Here is the same calculation in a few lines of Python, with no third party packages:
import math
P0_MB = 1014.0 # NASA Earth fact sheet
H_KM = 8.5 # NASA Earth fact sheet
for h_km in (5.5, 10, 18.3, 37, 100):
p = P0_MB * math.exp(-h_km / H_KM)
print(f"{h_km:6.1f} km ~{p:10.4f} mb ({p / P0_MB:.2%} of surface pressure)")
Space weather: how the upper layers affect GPS, radio and power grids
Space weather means changes in the Sun, solar wind, magnetosphere and upper atmosphere that affect technology. NOAA's Space Weather Prediction Center (SWPC) is the US forecast office for it. For a deeper look at IT impacts, see our earlier explainers on space weather and IT and GPS interference sources.
NOAA's three scales
SWPC rates events on three five step scales: R for radio blackouts (driven by solar flare X rays), S for solar radiation storms (energetic protons) and G for geomagnetic storms (disturbances of the magnetosphere). For geomagnetic storms the scale is tied to the Kp index, a 0 to 9 measure of global magnetic disturbance.
| G level | Kp | Approximate frequency per 11 year cycle (NOAA) |
|---|---|---|
| G5 Extreme | 9 | about 4 per cycle (4 days per cycle) |
| G4 Severe | 8, including 9 minus | about 100 per cycle (60 days per cycle) |
| G3 Strong | 7 | about 200 per cycle |
On 10 May 2024, SWPC announced that G5 conditions were first observed at Earth at 6:54 p.m. EDT, one of the rare top level storms on its scale.
GPS and other satellite navigation
SWPC explains that receivers correct for a typical "quiet" ionosphere with a model, and a storm breaks that model.
- In calm conditions, single frequency GPS can give position to about a metre or better. During a severe storm, SWPC says errors can grow to tens of metres or more.
- Dual frequency receivers compare two signals to remove the ionosphere's effect and can reach a few centimetres, but can lose lock when it is highly disturbed.
- Geomagnetic storms raise the total electron content (TEC) of the ionosphere, mostly at high latitudes, though major storms can do it at mid latitudes.
- Near the magnetic equator, small bubbles in the ionosphere cause scintillation, rapid flickering of the signal, most severe just after sunset. SWPC stresses that scintillation is part of the normal day night cycle there and is not tied to storms.
If your systems depend on GPS time, not just position, this matters too; see GPS timing as a hidden dependency.
HF radio
SWPC describes a typical sequence. A flare's X rays reach about 80 km and strengthen the D layer, absorbing HF radio on the sunlit side of Earth. A radiation storm follows when energetic protons, steered by the magnetic field, hit the upper atmosphere near the poles and block HF at high latitudes. Auroral electrons then disturb other layers on the night side of the polar regions.
Power grids
A changing magnetic field induces current in a conductor, and long power lines are such conductors. SWPC explains that during a geomagnetic storm, quasi DC geomagnetically induced currents flow through the grid and saturate transformer cores. A saturated transformer can overheat, distort the waveform enough to trip protective equipment, and load a grid that is already near peak demand.
SWPC lists historical effects: the first reports after the 24 March 1940 storm, a blackout in 1958, equipment tripping on 4 August 1972, a nine hour blackout in Canada with a transformer loss on 13 March 1989, and a blackout in Sweden during the October 2003 storm. For the insurance and planning side, see our post on Carrington class solar storms, and for satellites, our 2026 update on space weather and satellites.
Step by step: check the upper atmosphere's status from NOAA's live feeds
You do not need special software to see what the ionosphere and magnetosphere are doing. SWPC publishes machine readable feeds. The commands below only read public data; they change nothing on your system.
1. Read today's NOAA scale levels
curl -s https://services.swpc.noaa.gov/products/noaa-scales.json | jq '."0"'
Entry "0" is the current status, with R, S and G levels. When we checked on 23 October 2026, all three scales read 0 ("none"), and the forecast entry listed a 20% chance of minor and 5% chance of major radio blackouts. Later entries are the forecast for the coming days.
2. Read the most recent planetary Kp index
curl -s https://services.swpc.noaa.gov/products/noaa-planetary-k-index.json | jq '.[-1]'
Each entry has a time_tag and a Kp value for a three hour period. Kp 5 corresponds to G1; Kp 9 to G5. SWPC also publishes a one minute estimate at https://services.swpc.noaa.gov/json/planetary_k_index_1m.json.
Feed formats change, so parse by field name rather than position.
3. Turn it into a small alert script with no third party dependencies
import json
import urllib.request
URL = "https://services.swpc.noaa.gov/products/noaa-planetary-k-index.json"
with urllib.request.urlopen(URL, timeout=20) as resp:
rows = json.load(resp)
latest = rows[-1]
kp = float(latest["Kp"])
level = "none" if kp < 5 else f"G{min(int(kp) - 4, 5)}"
print(f"{latest['time_tag']} UTC Kp={kp:.2f} storm level: {level}")
if kp >= 7:
print("Strong storm: expect degraded single frequency GPS and HF radio at high latitudes.")
Using only the Python standard library keeps the script's own supply chain small. If you add packages, for example a plotting library, pin exact versions and hashes so the script you audited is the script that runs:
python -m venv .venv && . .venv/bin/activate
# requirements.txt lists exact versions with --hash entries
pip install --require-hashes -r requirements.txt
4. Scan what you built
Monitoring scripts and dashboards are often written quickly and left running for years. Before you schedule one, scan it for known vulnerable dependencies:
safeguard scan --dir .
safeguard scan --image my-spaceweather-dashboard:latest
Results land as JSON under ./output, so a cron job or CI step can fail on new findings.
Where Safeguard fits, honestly
Safeguard does not do atmospheric science, forecast space weather, operate satellites or scan spacecraft firmware. Nothing in this post is a Safeguard capability.
The overlap is narrower and practical. The tools that read NOAA's feeds, process balloon and satellite data, run ground station dashboards or schedule around GPS accuracy are software, usually built from open source packages and shipped in container images. Safeguard scans repositories, container images and SBOM files, including SBOMs a supplier hands you, matches their components against vulnerability databases, uses reachability analysis to rank the vulnerable code your application actually calls, and shows which of your projects contain a given component and version. Policies and gates can stop a build that brings a known vulnerable version back. The Safeguard CLI's assistant can also edit code and run commands, asking for your approval according to the /permissions mode you choose. Treat that as one layer in your defence, the way the atmosphere has several: it helps with the software you build, not with the satellite or the sky.
Common mistakes
- "The layers are defined by what gas they contain." They are defined by the temperature trend with height. The well mixed composition of the lower atmosphere stays close to the same ratios through the troposphere, stratosphere and mesosphere.
- "It gets steadily colder all the way up to space." Temperature falls, rises, falls and rises again. The stratosphere warms because of ozone, and the thermosphere can reach about 2,000 °C.
- "The thermosphere would burn you." Its molecules are energetic, but there are too few of them to carry much heat. NOAA notes it would still feel very cold to skin.
- "The ozone hole is a hole in the sky that lets air escape." It is a seasonal thinning of stratospheric ozone over Antarctica, caused mainly by chlorine and bromine from human made chemicals. It does not let air out, and the WMO says it has been slowly improving since 2000.
- "Space starts at a sharp edge." There is no surface. The 100 km Kármán line and the 80 km proposal are conventions, and air keeps thinning for thousands of kilometres.
- "The ISS is beyond the atmosphere." It orbits in the thermosphere and feels enough drag that NASA has to reboost it periodically.
- "There is no gravity in orbit." Astronauts float because they are in continuous free fall, the orbiting cannonball idea the FAI essay credits to Newton.
- "Space weather only matters to astronauts." SWPC documents effects on GPS accuracy, HF radio and power grids on the ground, including the 1989 Canadian blackout.
FAQ
What are the 5 layers of the atmosphere in order?
From the ground up: troposphere, stratosphere, mesosphere, thermosphere and exosphere. Between them are the boundaries tropopause, stratopause, mesopause and thermopause. The ionosphere is an electrically charged region that overlaps the mesosphere and thermosphere rather than a sixth temperature layer.
Which layer of the atmosphere do we live in?
The troposphere. It starts at the surface and holds almost all weather and nearly all water vapour. NOAA puts its top at about 6 km over the poles and 18 to 20 km over the equator.
Which layer contains the ozone layer?
The stratosphere. NASA's Earth Observatory places most ozone between about 10 and 40 km. Absorbing ultraviolet light there is what makes the stratosphere warm with height.
What is the hottest layer of the atmosphere?
The thermosphere, where NOAA says temperatures can reach about 2,000 °C near the top. The coldest air is at the mesopause, at the bottom of the thermosphere, as low as about minus 120 °C.
At what altitude does space begin?
By the FAI's convention, at 100 km, known as the Kármán line. Some researchers, including Jonathan McDowell in a 2018 Acta Astronautica paper, argue for 80 km, close to the 50 statute mile line the US Air Force used for astronaut wings.
Which layer does the International Space Station orbit in?
The thermosphere. NASA gives its altitude as 370 to 460 km. It still feels atmospheric drag and needs periodic reboosts.
Which layer do airplanes fly in?
Mostly the troposphere. US Class A airspace, used by jets on instrument flight plans, runs from 18,000 feet to FL 600 (about 18 km). Over high latitudes, where the tropopause is lower, airliners can cruise in the lowest part of the stratosphere.
Where are the Van Allen belts?
Inside the magnetosphere, above the atmosphere's densest layers. NASA gives the inner belt as about 1,000 to 8,000 miles above the equator and the outer belt as about 12,000 to 25,000 miles.
How does space weather affect GPS?
A disturbed ionosphere bends GPS signals in ways receivers cannot model. NOAA SWPC says single frequency errors can grow from about a metre to tens of metres in a severe storm, and dual frequency receivers can lose lock.
Fix it without waiting for upstream
The sky itself is not a software problem, but almost everything we use to measure and work with it is: balloon and satellite data pipelines, space weather alert scripts, GNSS and timing services, and ground station dashboards are built from open source packages and container images. Those components need the same patch discipline as any application, which is where the rest of this section applies.
Whatever the vulnerability, most of the risk sits in two gaps. The first is the time between a fix being published and that fix actually running in your production builds. The second, and worse, is the time before any fix exists at all, while a maintainer works out a patch and a release schedule. Waiting through both gaps is a habit, not a requirement. Safeguard gives teams three ways to close them.
1. Autonomous remediation: pull requests, not tickets
When a fixed version exists, Safeguard's Griffin models open a tested, policy gated pull request that moves the affected dependency to the safe version. You can run it on one repository or in bulk across every project that carries the vulnerable version. Remediation covers eight categories, including dependencies, licenses, security posture and findings. Reachability analysis ranks the vulnerable code paths your application actually calls first, so the first pull requests you merge are the ones that matter most. Autonomous remediation ships switched off, with every category set to Manual, so your team decides how much runs on its own and what still needs a human approval.
2. Gold Open Source: the safe version in seconds, free
gold.safeguard.sh is free and needs no login. Search any CVE or package to see affected and fixed versions, CVSS, EPSS, CISA KEV status and a recommended safe version, or use the "Am I affected?" checker. The same data is available through a free read API, README status badges and RSS threat feeds. The safeguard-sh/gold-scan-action GitHub Action can fail a build on a known exploited vulnerability, on any known vulnerability, or never, so a version you have just removed cannot quietly come back in next week's merge.
3. Gold Registry: start from components that are already fixed
registry.safeguard.sh provides hardened, drop in replacements for upstream packages and container images. Every Gold artifact is held continuously to zero exploitable critical or high CVEs, zero malware and a completed license check, with SLSA L3 or higher provenance, a Sigstore signature and a public evidence page you can hand to an auditor. An artifact loses its Gold badge if it regresses. Teams can point their own package directory at the registry so hardened equivalents resolve without changing how developers install anything.
When upstream has no fix yet, or will not ship one, Safeguard first works to get the fix accepted upstream. If the issue is severe or upstream will not move, Safeguard builds a fork, fixes the vulnerability there and publishes a hardened Gold build, so you are not stuck on a maintainer's release schedule. You can also request a hardened, compatibility tested build of a specific package. This fork and patch flow is in early access today, so ask which packages it covers before you plan around it.
| Your situation | What to use |
|---|---|
| A fixed version exists | Autonomous remediation opens the upgrade pull request; Gold Open Source confirms the safe version |
| You need to know today whether you are affected | Gold Open Source lookup and "Am I affected?" checker, free and without login |
| You want vulnerable versions to stop shipping | The Gold scan GitHub Action in CI, plus Safeguard policies and gates |
| Upstream has no fix yet, or will not ship one | A custom Gold request; fork and patch (early access) |
| You want to start clean on new projects | Pull hardened components and images from Gold Registry |
One honest limit: when the vulnerable code lives in a vendor appliance, a hosted service or an operating system runtime you do not build yourself, the fix still has to come from that vendor or distribution. The steps above apply to the open source dependencies and container images you build and ship, which is where most teams carry the largest and least tracked share of their exposure.
See how Safeguard would help
None of these demos involves the atmosphere. Each shows how the software around atmospheric data can be checked and fixed with a person approving each step.
The first demo is a real Safeguard CLI session: asked to fix a lodash CVE, it reads the finding and the advisory, asks before each command, edits package.json to lodash 4.17.21, runs npm install and npm test with approval, prints a summary and pushes nothing. It ends with /permissions, /model and /scan. The same flow applies to a space weather dashboard or a GNSS monitoring service that has drifted onto an old dependency.
Click through it at your own pace, or open it full screen.
The second demo sets up the Safeguard runner on your own machine, approves it with its device code and then scans from the terminal. For a lab or ground station that keeps its code and data on its own hardware, this is a way to inventory dependencies without moving the repository anywhere.
Click through it at your own pace, or open it full screen.
The third demo connects Claude to the Safeguard MCP server with OAuth and lets you choose which tools Claude can use. If you already use an assistant to write data processing code, this lets it ask Safeguard which of your projects carry a given package version, while you decide what it can touch.
Click through it at your own pace, or open it full screen.
To try it on your own code, download Safeguard and follow the CLI documentation.
Quick check
Why does the stratosphere get warmer with height when the troposphere gets colder?
The troposphere is heated from below by the ground, so it cools as you move away from the surface. The stratosphere is heated from within by ozone absorbing ultraviolet light, and more ultraviolet is available higher up, so temperature rises with height until the stratopause near 50 km.
Is the International Space Station above the atmosphere?
No. NASA gives its orbit as 370 to 460 km, inside the thermosphere, which NOAA places between about 85 and 600 km. The thin air there still causes drag, so the station needs periodic reboosts.
Sources
- NOAA JetStream: Layers of the atmosphere
- NOAA JetStream: The atmosphere (composition of air)
- NASA NSSDC: Earth fact sheet
- FAI: 100km altitude boundary for astronautics (archived copy)
- McDowell, J. C. (2018), The edge of space: Revisiting the Karman Line, Acta Astronautica 151, arXiv:1807.07894
- NOAA SWPC: Ionosphere
- NOAA SWPC: Aurora
- NOAA SWPC: Space weather and GPS systems
- NOAA SWPC: HF radio communications
- NOAA SWPC: Electric power transmission
- NOAA SWPC: NOAA space weather scales
- NOAA SWPC: G5 conditions observed (10 May 2024)
- NOAA SWPC: Solar cycle
- NOAA SWPC data feed: NOAA scales JSON
- NOAA SWPC data feed: Planetary K index JSON
- NASA Earth Observatory: Ozone
- WMO: Ozone layer recovery is on track (2022 assessment press release)
- NOAA Chemical Sciences Laboratory: Scientific Assessment of Ozone Depletion 2022
- FAA Aeronautical Information Manual, Chapter 3 Section 2: Controlled airspace
- NASA: Scientific balloon flights lift off from Antarctica (December 2024)
- NASA: Super pressure balloons return to New Zealand for test flights
- NASA Columbia Scientific Balloon Facility: Balloons
- NASA: International Space Station reference
- NASA: Space station facts and figures
- GPS.gov: Space segment
- NOAA NESDIS: Geostationary satellites
- NASA: Radiation belts with satellites
- NASA Science: Magnetospheres
- ESA: Swarm
- NASA Science: Voyager interstellar mission
Last reviewed: 23 October 2026.