
Retrieve an ERA5 pressure time series
Source:R/geopressure_timeseries.R, R/geopressure_timeseries_api.R, R/geopressure_timeseries_arco.R
geopressure_timeseries.Rdgeopressure_timeseries() retrieves an hourly ERA5 surface-pressure time series at one
location. Supply a tag pressure series to also normalise ERA5 pressure and estimate altitude.
geopressure_timeseries_arco() and geopressure_timeseries_api() are shortcuts that force the
corresponding source.
Usage
geopressure_timeseries(
lat,
lon,
pressure = NULL,
start_time = NULL,
end_time = NULL,
quiet = FALSE,
debug = FALSE,
source = c("auto", "arco", "api"),
era5_dataset = c("single-levels", "land"),
altitude_formula = c("virtual", "standard")
)
geopressure_timeseries_api(
lat,
lon,
pressure = NULL,
start_time = NULL,
end_time = NULL,
quiet = FALSE,
debug = FALSE,
era5_dataset = c("single-levels", "land"),
altitude_formula = "virtual"
)
geopressure_timeseries_arco(
lat,
lon,
pressure = NULL,
start_time = NULL,
end_time = NULL,
quiet = FALSE,
debug = FALSE,
era5_dataset = c("single-levels", "land"),
altitude_formula = "virtual"
)Arguments
- lat
Numeric scalar latitude, between -90 and 90 degrees.
- lon
Numeric scalar longitude, between -180 and 180 degrees.
- pressure
Optional data.frame with a date-time
datecolumn and numeric pressurevaluecolumn in hPa. Additional columns are retained.- start_time, end_time
Start and end of the requested interval when
pressureisNULL.- quiet
Logical to suppress progress messages.
- debug
Logical to display request details.
- source
Data source:
"auto","arco", or"api".- era5_dataset
ERA5 product:
"single-levels"(default) at 0.25 degree resolution or"land"at 0.1 degree resolution. Keep the default whenpressureis supplied, becausealtitudeis then computed; see the Choosingera5_datasetsection.- altitude_formula
Altitude formula:
"virtual"(default) uses 2 m virtual temperature and the GPT3 lapse rate (Landskron & Böhm 2018), based on the altitude validation."standard"uses 2 m temperature and -6.5 K/km to reproduce previous results.
Value
A data.frame containing date, surface_pressure, lat, and lon. With pressure,
it also retains the input columns, renames value to pressure_tag, and adds
surface_pressure_norm and altitude, as well as stap_id (1) and label ("") when
absent from pressure. The attribute provenance records the source ("arco" or "api"), the
ERA5 dataset, the altitude formula, the GeoPressureR version and, for the API, the version of
GeoPressureAPI.
Data sources
source = "arco" reads ECMWF's Analysis-Ready Cloud-Optimised (ARCO) archive directly. It is
generally faster for a long time series at one location, supports ERA5-Land and global ERA5,
and requires an ECMWF API key plus the optional Rarr and ecmwfr packages.
source = "api" asks the hosted GeoPressureAPI to prepare the data. It needs no ECMWF key or
Rarr installation, but depends on that service.
The default, source = "auto", uses ARCO when a key stored by ecmwfr::wf_set_key() is
available and GeoPressureAPI otherwise. Use geopressure_timeseries_arco() or
geopressure_timeseries_api() to select a backend explicitly.
ERA5 datasets and matching
With ARCO, era5_dataset = "single-levels" (the default) uses global ERA5 on a 0.25 degree grid
and retains locations over water. era5_dataset = "land" uses ERA5-Land on a 0.1 degree grid;
it has finer spatial resolution but is masked over oceans, so ocean locations are moved to the
closest land cell, and it must not be used when pressure is supplied because altitude is
then computed from it (see the Choosing era5_dataset section). GeoPressureAPI uses the same
dataset choice and moves ocean locations onshore only with ERA5-Land.
Without pressure, the requested interval is returned hourly. With ARCO and pressure, each tag
time is matched to its closest ERA5 hour and restored after matching; no temporal interpolation
is used. GeoPressureAPI receives the original tag timestamps and performs the matching remotely.
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.
altitude_formula = "virtual" (default) uses the virtual temperature computed from ERA5 2 m
dewpoint, and the temperature lapse rate of the GPT3 empirical troposphere model
(Landskron & Böhm 2018), a mean, annual and
semi-annual cycle on a 1° grid, downloaded once from TU Wien and cached.
altitude_formula = "standard" uses 2 m temperature and \(L_b=-0.0065\) K/m.
The constants are the 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. It is the default.
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 supported. They are appropriate for retrieving other variables
at 0.1 degree resolution. For altitude, prefer "single-levels" based on the
altitude validation.
Accuracy
The altitude validation evaluates the
conversion against weather stations, GNSS and Swiss stations with documented barometer heights,
and radiosondes, for a perfect pressure reading with era5_dataset = "single-levels" and the
default altitude_formula = "virtual":
Absolute altitude on the ground is a fixed offset per site: median 2.6 m (p90 11 m), with a temporal scatter (SD) of 3.7 m around it, growing to tens of metres in steep terrain where the 0.25° orography departs from the real one.
Altitude changes at one site are therefore more reliable than absolute altitudes.
Height above the ground in flight is nearly unbiased (−4 m at 1–1.5 km), but its scatter grows with height (RMSE 20 m at 1–1.5 km and 43 m at 2–3 km). Over the heights birds fly, the mean absolute error is 13.1 m, against 16.4 m with
"standard", which places birds too low by 1–1.5% of their height.
The tag's own sensor adds to these: altitude is computed from the raw tag pressure, so an
absolute sensor offset of 1 hPa shifts it by about 8 m near the ground.
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.
Pressure normalisation
ERA5 surface pressure is also shifted to the mean tag-pressure level within each elevation-label
group. Flight observations (fractional stap_id, or stap_id == 0 for older tags) and observations labelled "discard" are excluded
from the group means. The adjusted series is returned as surface_pressure_norm.
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:
plot_pressurepath(),
pressurepath_check(),
pressurepath_create(),
pressurepath_variable_available()
Examples
geopressure_timeseries(
lat = 46,
lon = 6,
start_time = "2020-01-01",
end_time = "2020-01-02",
quiet = TRUE
)
#> date surface_pressure lat lon
#> 1 2020-01-01 00:00:00 948.8362 46 6
#> 2 2020-01-01 01:00:00 948.6438 46 6
#> 3 2020-01-01 02:00:00 948.7123 46 6
#> 4 2020-01-01 03:00:00 948.2784 46 6
#> 5 2020-01-01 04:00:00 948.1731 46 6
#> 6 2020-01-01 05:00:00 948.2301 46 6
#> 7 2020-01-01 06:00:00 948.2494 46 6
#> 8 2020-01-01 07:00:00 948.3524 46 6
#> 9 2020-01-01 08:00:00 948.6702 46 6
#> 10 2020-01-01 09:00:00 948.8083 46 6
#> 11 2020-01-01 10:00:00 949.7413 46 6
#> 12 2020-01-01 11:00:00 949.4380 46 6
#> 13 2020-01-01 12:00:00 948.9264 46 6
#> 14 2020-01-01 13:00:00 948.6097 46 6
#> 15 2020-01-01 14:00:00 948.2928 46 6
#> 16 2020-01-01 15:00:00 948.2722 46 6
#> 17 2020-01-01 16:00:00 948.4698 46 6
#> 18 2020-01-01 17:00:00 948.5252 46 6
#> 19 2020-01-01 18:00:00 948.6693 46 6
#> 20 2020-01-01 19:00:00 948.5830 46 6
#> 21 2020-01-01 20:00:00 948.3839 46 6
#> 22 2020-01-01 21:00:00 948.3473 46 6
#> 23 2020-01-01 22:00:00 948.7467 46 6
#> 24 2020-01-01 23:00:00 948.6584 46 6
#> 25 2020-01-02 00:00:00 947.9513 46 6