
Create a pressure path
Source:R/pressurepath_create.R, R/pressurepath_create_api.R, R/pressurepath_create_arco.R
pressurepath_create.Rdpressurepath_create() combines a tag pressure series with a path and retrieves matching ERA5
variables. Positions during flights are linearly interpolated between stationary periods.
pressurepath_create_arco() and pressurepath_create_api() are shortcuts that force the
corresponding source.
Usage
pressurepath_create(
tag,
path = tag2path(tag),
variable = c("altitude", "surface_pressure"),
solar_dep = 0,
era5_dataset = "both",
preprocess = FALSE,
workers = "auto",
quiet = FALSE,
debug = FALSE,
source = c("auto", "arco", "api")
)
pressurepath_create_api(
tag,
path = tag2path(tag),
variable = c("altitude", "surface_pressure"),
solar_dep = 0,
era5_dataset = "both",
preprocess = FALSE,
workers = "auto",
quiet = FALSE,
debug = FALSE
)
pressurepath_create_arco(
tag,
path = tag2path(tag),
variable = c("altitude", "surface_pressure"),
solar_dep = 0,
era5_dataset = "both",
preprocess = FALSE,
quiet = FALSE,
debug = FALSE
)Arguments
- tag
A GeoPressureR
tagobject.- path
A GeoPressureR
pathdata.frame.- variable
ERA5 variables to retrieve, named as in the ERA5 catalogue, plus the derived
"altitude". The same names work for everysource, but the available set depends on bothsourceandera5_dataset— seepressurepath_variable_available().- solar_dep
Solar depression angle used to compute sunrise and sunset, or
NULLto skip this computation.- era5_dataset
ERA5 product:
"both"(default) to use ERA5-Land over land and global ERA5 elsewhere,"land", or"single-levels". Prefer"single-levels"whenevervariableincludes"altitude"; see the Choosingera5_datasetsection.- preprocess
Whether to preprocess pressure with
geopressure_map_preprocess().- workers
Number of parallel GeoPressureAPI requests, or
"auto".- quiet
Logical to suppress progress messages.
- debug
Logical to display request details.
- source
Data source:
"auto","arco", or"api".
Value
A pressurepath data.frame containing tag pressure, coordinates, requested ERA5
variables, normalised surface pressure, and optional sunrise and sunset times.
Data sources
source = "arco" reads ECMWF's Analysis-Ready Cloud-Optimised (ARCO) archive directly. It
requires an ECMWF API key and the optional Rarr and ecmwfr packages. variable uses the
same names as the hosted API, but the archive carries fewer of them: 20 for
era5_dataset = "single-levels", 16 for "land", and the 8 they share for "both", plus the
derived "altitude". Use pressurepath_variable_available() to list them.
source = "api" uses the hosted GeoPressureAPI. It needs no ECMWF key or Rarr installation
and reaches the full Earth Engine band set: 292 variables for era5_dataset = "single-levels"
and "both", 70 for "land".
The default, source = "auto", uses ARCO when a key stored by ecmwfr::wf_set_key() is
available and GeoPressureAPI otherwise. Use pressurepath_create_arco() or
pressurepath_create_api() to select a backend explicitly.
Path and ERA5 processing
Measurements are retained only when path contains the surrounding stationary periods.
Coordinates during flights are interpolated linearly, while ERA5 values are sampled at the
nearest grid cell and hour. era5_dataset = "single-levels" uses 0.25 degree global ERA5,
"land" uses 0.1 degree ERA5-Land, and "both" selects ERA5-Land over land and global ERA5
over water.
Surface pressure is returned in hPa and normalised to the mean tag pressure within each
stationary-period and elevation-label group. Observations labelled "discard" are excluded
from those means. If solar_dep is not NULL, local sunrise and sunset are added.
Pressure-derived altitude
When altitude is produced, GeoPressureR uses the same barometric relation as GeoPressureAPI: $$z_\mathrm{tag}=z_\mathrm{ERA5}+\frac{T_\mathrm{ERA5}}{L_b}\left[\left( \frac{P_\mathrm{tag}}{P_\mathrm{ERA5}}\right)^{-R L_b/(g M)}-1\right].$$ Here, \(P_\mathrm{tag}\) is tag pressure, while \(P_\mathrm{ERA5}\), \(T_\mathrm{ERA5}\), and \(z_\mathrm{ERA5}\) are ERA5 surface pressure, 2 m temperature, and model-surface elevation. Model-surface elevation is obtained from ERA5 surface geopotential divided by standard gravity. The constants are the standard temperature lapse rate \(L_b=-0.0065\) K/m, universal gas constant \(R=8.31432\) J/(mol K), standard gravity \(g=9.80665\) m/s², and molar mass of dry air \(M=0.0289644\) kg/mol. Pressure is converted to Pa internally and altitude is returned in metres above mean sea level.
Choosing era5_dataset
Use era5_dataset = "single-levels" whenever altitude is computed.
ERA5-Land's surface_pressure is not the exact hydrostatic image of the orography ERA5-Land
publishes as geopotential — the two disagree by up to ~10 hPa in steep terrain. The
\(z_\mathrm{ERA5}\) term therefore fails to cancel from the relation above and the whole discrepancy
lands in the retrieved altitude. Measured against 41,653 hourly station-pressure observations
from 271 NOAA ISD stations (2–3576 m, Alps, July 2020), compared with surveyed station
elevation:
era5_dataset | bias | MAE | RMSE |
"single-levels" | −0.6 m | 9.0 m | 27.4 m |
"land" / "both" | +2.5 m | 55.3 m | 76.9 m |
ERA5-Land replays the land component of ERA5 and assimilates no atmospheric observations of its
own, so it carries no independent information about absolute altitude. Substituting the
orography implied by its own surface pressure removes the error exactly and reproduces
"single-levels" to 0.1 m.
"land" and "both" remain the defaults for backward compatibility. They are appropriate for
retrieving other variables at 0.1 degree resolution, and for geopressure_map(), whose
pressure mismatch is differential and unaffected.
Accuracy
With era5_dataset = "single-levels" the altitude error separates into two parts that behave
very differently. A static per-site offset (median 3.7 m, p90 15 m) reflects station metadata
and sub-grid terrain and does not vary in time, while the temporal scatter (median SD 3.1 m,
p90 7.7 m) is the actual reanalysis error. Expect roughly 3 m for relative altitude changes
at a fixed location and 10 m mean absolute error for absolute altitude, degrading to tens
of metres in steep terrain — where it is a fixed offset rather than noise. Precision is nearly
independent of flight altitude: de-biased RMSE stays 2–7 m up to 1000 m above the model surface
and about 12 m at 1000–3000 m above it.
A note on accumulated variables
total_precipitation, surface_solar_radiation_downwards and
surface_thermal_radiation_downwards do not mean the same thing across backends when
era5_dataset = "land". GeoPressureAPI serves Earth Engine's ERA5-Land collection, where these
bands are overwritten by their *_hourly counterparts and are therefore hourly increments.
ARCO serves ECMWF's own ERA5-Land fields, which accumulate from 00 UTC. For
era5_dataset = "single-levels" both are hourly and agree. Take the difference between
consecutive hours if you need increments from ARCO over land.
ECMWF API key
ARCO access and CDS downloads use the same ECMWF Personal Access Token. Create an ECMWF account, copy the token from your Climate Data Store profile, accept the dataset licence terms, and store the token once in your system keyring:
ecmwfr::wf_set_key("your-personal-access-token")Do not put the token in a script or commit it to version control. GeoPressureR retrieves the
stored token with ecmwfr::wf_get_key() for all ECMWF-backed functions, including
geopressure_timeseries(), pressurepath_create(), and tag_download_wind().
See also
Other pressurepath:
geopressure_timeseries(),
plot_pressurepath(),
pressurepath_variable_available()