Whales movements

Day 5 of 30DayMapChallenge. Journey
R
spatial
datavisualization
30DayMapChallenge
ecology
Author

Michaël

Published

2024-11-05

Modified

2024-11-22

A photo of a Blue Whale

Blue Whale – CC-BY-NC-ND by Tom Benson

Day 5 of 30DayMapChallenge: « A Journey » (previously).

Thirteen Blue whales (Balaenoptera musculus L.) were satellite tagged in 2015 in Australia (). We’ll follow their summer in the Great Southern Australian Coastal Upwelling System (GSACUS).

Data is available from the Australian Antarctic Data Centre (), directly as a R RDS file.

library(dplyr)
library(readr)
library(sf)
library(leaflet)
library(glue)

unzip("AAS_4101_pygmy_blue_whale_SSSM.zip", 
      files = "bw_3h_ssm.RDS")
bm <- read_rds("bw_3h_ssm.RDS")
# str(bm)

journeys <- bm$summary |> 
  st_as_sf(coords = c("lon", "lat"), crs = "EPSG:4326") |> 
  group_by(id) |> 
  arrange(date) |> 
  summarise(do_union = FALSE,
            d_min = min(date),
            d_max = max(date)) %>%
  st_cast("LINESTRING") |> 
  group_by(indiv = as.factor(parse_number(as.character(id)))) |> 
  summarise(d_min = as.Date(min(d_min)),
            d_max = as.Date(max(d_max)))

After joining GPS points as lines and lines from the same whale as multilines, we can use {leaflet} for an interactive map.

pal <- colorFactor("viridis", sort(unique(journeys$indiv)))

journeys |> 
  leaflet() |> 
  addTiles() |> 
  addPolylines(color = ~ pal(indiv),
               popup = ~ glue("<b>{indiv}</b><br />
                              from {d_min} to {d_max}")) |> 
  addLegend(pal = pal,
            title = "Whales ID",
            values = sort(unique(journeys$indiv)))
Whales ID
123227
123229
123230
123233
123234
123235
131122
131123
131124
131125
131139
131174
131177
Figure 1: Movements of blue whales satellite tagged in an Australian upwelling system

References

Andrews-Goff, Virginia, Mike Double, Luciana Möller, Catherine Attard, Kerstin Bilgmann, Ian Jonsen, and Dave Paton. 2020. “Switching State Space Model for Pygmy Blue Whale Satellite Tag Derived Locations.” Australian Antarctic Data Centre. https://doi.org/10.26179/5E671120E52B4.
Mӧller, Luciana M., Catherine R. M. Attard, Kerstin Bilgmann, Virginia Andrews-Goff, Ian Jonsen, David Paton, and Michael C. Double. 2020. “Movements and Behaviour of Blue Whales Satellite Tagged in an Australian Upwelling System.” Scientific Reports 10 (1): 21165. https://doi.org/10.1038/s41598-020-78143-2.