6  Pressurepath

In this chapter, we will see what a pressurepath object is and how to use it to compute the altitude of the bird throughout its trajectory.

Let’s load the tag from the Great Reed Warbler (18LX) created in the advanced tutorial.

load("./data/interim/18LX.Rdata")

6.1 Timeseries at a single position

Before creating a full pressurepath, we start with the basic building block of a pressurepath, which is to retrieve the pressure timeseries from ERA5 at a single location with geopressure_timeseries.

geopressure_timeseries relies on the pressure timeseries entry point of GeoPressureAPI which return the timeseries of pressure at a given latitude and longitude.

Let’s start by retrieving the pressure at the known site of equipment, querying the same date as the first stationary period.

ts <- geopressure_timeseries(
  lat = tag$stap$known_lat[1],
  lon = tag$stap$known_lon[1],
  start_time = tag$stap$start[1],
  end_time = tag$stap$end[1],
  quiet = TRUE
)

We can compare the retrieved ERA5 pressure to the pressure measured on the Great Reed Warbler:

p <- ggplot() +
  geom_line(data = ts, aes(x = date, y = surface_pressure, colour = "ERA5")) +
  geom_line(data = tag$pressure[tag$pressure$stap_id == 1, ], aes(x = date, y = value, colour = "tag")) +
  theme_bw() +
  ylab("Pressure (hPa)") +
  scale_color_manual(values = c("ERA5" = "black", "tag" = "red"))
layout(ggplotly(p), legend = list(orientation = "h"))
Eureka!

This was the figure that made me realize the potential of pressure measurement to determine birds’ position! The accuracy of the reanalysis data and the precision of the sensor were such that a timeseries of pressure had only a few possible options on the map.

6.2 Pressurepath

What is a pressurepath?

You can think of a pressurepath as the timeseries of pressure that a tag would record on a bird traveling along a specified path. To do that, pressurepath_create() calls geopressure_timeseries() for each stationary period and combines the resulting timeseries of ERA5 pressure.

The pressurepath data.frame returned also contains the original pressure pressure_tag which can be very helpful for labelling and the altitude of the bird corrected for the natural variation of pressure.

pressurepath <- pressurepath_create(
  tag,
  path = path_most_likely,
  quiet = TRUE
)

Note that if a position on the path is over water, it is automatically moved to the closest point onshore as we use ERA5 Land.

plot_pressurepath(pressurepath)

6.3 Altitude above sea level

The main benefit of creating pressurepath is the ability to retrieve ERA5 variable along the the trajectory of the bird. One of them is altitude which can be directly plot with

plot_pressurepath(pressurepath, type = "altitude")