View source: R/pressurepath_create.R
pressurepath_create | R Documentation |
pressurepath
A pressurepath
is a data.frame merging path
and tag$pressure
. It can be thought as the
equivalent of the measurement of variables by sensors equipped on the bird moving along a
specific path
.
Any ERA variables can be retrieve but the functions is most notably used to retrieve ERA5 surface pressure to then be able to compare it to the pressure measured by the tag, and potentially adjust labelling tag data.
By default, We use both the ERA5 LAND and
ERA5 surface level if position over water. Available
variables can be listed with GeoPressureR:::pressurepath_variable
and details description
can be found on the parameter listings in ERA5 doc.
Note that their exact name might be be different as we query them through Google Earth Engine.
Positions during the flight are estimated by linear interpolation of the position of the stap
before and after. pressurepath_create()
does not return measurement for stationary periods
which are not provided in path
as well as the flight before and after.
also return the altitude of the bird along its trajectory. The altitude
z_{tag}
(a.s.l.) is computed from the tag pressure P_{tag}
, using the barometric
equation
z_{{tag}}(x)=z_{ERA5}(x) + \frac{T_{ERA5}(x)}{L_b} \left(
\frac{P_{tag}}{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 at
the GeoPressureAPI documentation.
To be able to compare the temporal variation of the retrieved pressure of ERA5 P_{ERA}
to
the tag pressure P_{tag}
, the function also returns the ERA pressure normalized with
the tag mean pressure measurement as surface_pressure_norm
.
P_{ERA5,0}(\boldsymbol{x})[t] = \left( P_{ERA5}(\boldsymbol{x})[t]-P_{tag}[t]\right) -
\left( \frac{1}{n}\sum_{i=1}^{n} P_{ERA5}(\boldsymbol{x})[i]-P_{tag}[i] \right).
pressurepath_create()
also computes the local sunrise and sunset times for each timestep
according to the position of the path using path2twilight()
. Sunrise and sunset are defined
by the solar depression angle solar_dep
.
pressurepath_create(
tag,
path = tag2path(tag),
variable = c("altitude", "surface_pressure"),
solar_dep = 0,
era5_dataset = "both",
preprocess = FALSE,
timeout = 60 * 10,
workers = "auto",
quiet = FALSE,
debug = FALSE
)
tag |
a GeoPressureR |
path |
a GeoPressureR |
variable |
ERA5 variable/parameters available to download.
The most commonly used variables: |
solar_dep |
a numerical value representing the solar depression angle used to compute
sunrise and sunset. If |
era5_dataset |
select the dataset to use: |
preprocess |
logical to pre-process pressure data with |
timeout |
duration before the code is interrupted both for the request on
GeoPressureAPI and on GEE (in seconds, see |
workers |
number of parallel requests on GEE. Integer between 1 and 99. |
quiet |
logical to hide messages about the progress |
debug |
logical to display additional information to debug a request |
A GeoPressureR pressurepath
data.frame with columns:
date
same as pressure$date
stap_id
same as pressure$stap_id
pressure_tag
same as pressure$value
label
same as pressure$label
j
same as path$j
lat
same as path$lat
lon
same as path$lon
include
same as path$include
known
same as path$known
altitude
altitude of the bird along the path (see detail)
surface_pressure
pressure retrieved from ERA5.
surface_pressure_norm
pressure retrieved from ERA5 normalized to the average of
pressure_tag
over the stationary period.
sunrise
datetime of the sunrise according to solar_dep
.
sunset
datetime of the sunset according to solar_dep
.
...
any other ERA5 variable requested by variable
GeoPressureManual | Pressure Map
Other pressurepath:
geopressure_timeseries()
,
plot_pressurepath()
withr::with_dir(system.file("extdata", package = "GeoPressureR"), {
tag <- tag_create("18LX", quiet = TRUE) |> tag_label(quiet = TRUE)
})
path <- data.frame(
stap_id = tag$stap$stap_id,
lat = c(48.5, 32.5, 30.5, 49.5, 41.6),
lon = c(17.5, 13.5, 16.5, 21.5, 12.7)
)
pressurepath <- pressurepath_create(tag, path = path, quiet = TRUE)
str(pressurepath)
plot_pressurepath(pressurepath)
pressurepath <- pressurepath_create(
tag,
path[c(2, 3, 4), ],
quiet = TRUE
)
plot_pressurepath(pressurepath)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.