Request and download surface pressure timeseries at location
Source:R/geopressure.R
geopressure_ts.Rd
This function return the surface atmospheric pressure timeseries from ERA5 at a queried location.
Usage
geopressure_ts(
lon,
lat,
pressure = NULL,
end_time = NULL,
start_time = NULL,
verbose = TRUE
)
Arguments
- lon
Longitude to query (-180° to 180°).
- lat
Latitude to query (0° to 90°).
- pressure
Pressure list from PAM logger dataset list (optional).
- end_time
If
pressure
is not provided, thenend_time
define the ending time of the timeserie as POSIXlt.- start_time
If
pressure
is not provided, thenstart_time
define the starting time of the timeserie as POSIXlt.- verbose
Display (or not) the progress of the query (logical).
Value
A data.frame containing the timeserie of ERA5 pressure (date, pressure) as well as
longitude and latitude (different if over water). If pressure
is provided, the return
data.frame is the same as pressure
with altitude and pressure0.
Details
If you supply the pressure (and time) of the geolocator \(P_{gl}\), the function will additionally return the altitude of the geolocator above sea level \(z_{gl}\) using the barometric equation, $$ z_{{gl}}(x)=z_{ERA5}(x) + \frac{T_{ERA5}(x)}{L_b} \left( \frac{P_{gl}}{P_{ERA5}(x)} \right)^{\frac{RL_b}{g M}-1},$$ where \(z_{ERA}\), \(T_{ERA}\) and \(P_{ERA}\) respectively correspond to the ground level elevation, temperature at 2m and ground level pressure of ERA5, \(L_b\) is the standard temperature lapse rate, \(R\) is the universal gas constant, \(g\) is the gravity constant and \(M\) is the molar mass of air. See more information on the GeoPressureAPI documentation.
The timeseries of the response will be on the same as time if supply, otherwise, it will return
on a hourly basis between start_time
and end_time
.
If the location query is over water, the location will be moved to the closest onshore location.
To be able to compare the temporal variation of the retrieved pressure of ERA5 \(P_{ERA}\) to
the geolocator pressure \(P_{gl}\), the function also return the ERA pressure normalized with
the geolocator mean pressure measurement as pressure0
.
$$ P_{0}(\boldsymbol{x})[t] = \left( P_{ERA5}(\boldsymbol{x})[t]-P_{gl}[t]\right) -
\left( \frac{1}{n}\sum_{i=1}^{n} P_{ERA5}(\boldsymbol{x})[i]-P_{gl}[i] \right).$$
See GeoPressureManual | Probability aggregation for more information on the meaning of this value.