Skip to main content

Module era5

Module era5 

Source
Expand description

ERA5 pressure-level files: the atmosphere over a launch site at launch time, as a SoundingProfile.

ERA5 is ECMWF’s global reanalysis, hourly on a 0.25° grid, distributed by the Copernicus Climate Data Store (Hersbach et al., “The ERA5 global reanalysis”, Q. J. R. Meteorol. Soc. 146 (2020) 1999–2049). A pressure-level file holds, on each pressure level p, the geopotential z (m² s⁻²), temperature t (K) and the wind’s east and north components u and v (m s⁻¹), on a grid of latitude, longitude and time. This module reads such a file in the netCDF classic formats (crate::netcdf); a netCDF-4 file from the current Climate Data Store is converted first (crate::netcdf::CONVERSION).

At the site, each value on each level is interpolated bilinearly in latitude and longitude (in degrees) between the four grid points around the site, as RocketPy 1.13 does (rocketpy/tools.py, bilinear_interpolation, MIT):

f = [f₁₁ (x₂ − x)(y₂ − y) + f₂₁ (x − x₁)(y₂ − y) + f₁₂ (x₂ − x)(y − y₁) + f₂₂ (x − x₁)(y − y₁)]
    / ((x₂ − x₁)(y₂ − y₁))

with x the latitude and y the longitude.

At launch time, the two hourly fields around it are weighted linearly in time; a launch on the hour takes that hour’s field alone. RocketPy takes the nearest hour instead.

Heights. ERA5’s geopotential height is Z = z/g₀, with g₀ = 9.80665 m s⁻² fixed in ECMWF’s model. “Geometric height is not represented in ERA5”, and ECMWF suggests h = R Z/(R − Z), “neglecting horizontal variations in the Earth’s gravitational acceleration” (ECMWF Knowledge Base, “ERA5: compute pressure and geopotential on model levels, geopotential height and geometric height”, captured 2026-09-26). RocketPy does that. hpr instead reads Z as a WMO geopotential height, as for any sounding, and takes the geometric height by WMO-No. 8 eqs. 12.15–12.16 at the site’s latitude (geometric_from_wmo_geopotential_m), the relation SoundingProfile inverts.

Both are approximations. Suppose the model’s ground lies at true height h_s with geopotential g₀ h_s, as reading surface geopotential over g₀ as the ground’s height takes it (ECMWF does not say how the model builds it, so this is an assumption), and gravity above it falls off as WMO’s formula has it. To first order hpr’s reading is then off by h_s (g₀/γ_s − 1) + h_s²/R, the same at every height, and ECMWF’s by h_s²/R − (h − h_s)(g₀/γ_s − 1), which grows with the height above the model’s ground (plus h²(1/R_e − 1/R) when ECMWF’s radius R_e is not WMO’s R). Neither is always the smaller. Exactly, with RocketPy’s R_e (the WGS 84 ellipsoid’s distance from the center at the site): for a model ground at 407 m at 47.2° N hpr’s is −0.04 m. For one 1400 m up at 33° N hpr’s is 1.88 m, and ECMWF’s is 0.31 m at the ground and −3.07 m 3 km above it; ECMWF’s is the smaller up to 1.95 km above that ground. hpr keeps WMO’s because it is the rule SoundingProfile uses for every sounding, so a level’s geopotential round-trips. The two readings differ by g₀/γ_s(φ) − 1 of the height, −1.58e-4 at 47.21° N and +3.43e-4 at 41.78° N (−0.69 m at 4.4 km and +1.45 m at 4.2 km on the tests’ files).

What it leaves out. Humidity is not read, so the air is dry: at 20 °C and 50% relative humidity dry air is about 0.4% denser than the real air. Between and beyond the levels the profile is SoundingProfile’s: hydrostatic between levels and the offset standard atmosphere above the highest level, where RocketPy holds every value at the end level’s.

Structs§

Era5Level
One pressure level at the site and time.
Era5Profile
The atmosphere over a site at a time, read from an ERA5 pressure-level file.
Era5Request
Where and when to read the atmosphere.
UtcTime
An instant in Coordinated Universal Time, as seconds since 1970-01-01T00:00:00Z (leap seconds not counted, as in POSIX time).

Enums§

Era5Error
Why an ERA5 profile could not be read.

Constants§

ERA5_GRAVITY_M_S2
ERA5’s g₀, which divides geopotential into geopotential height, m s⁻².

Functions§

direction_from_rad
The direction a wind of east and north components u and v blows from, clockwise from true north, in [0, 2π); 0 for a calm.