Data and code from: Integrating multiple observation data sources to facilitate movement modelling of killer whale pods
Data files
May 01, 2026 version files 5.37 MB
-
crawl_kf_ouf1s_robust_20250409.R
22.81 KB
-
data_in.csv
5.31 MB
-
fit_model.R
4.27 KB
-
helper_functions.R
27.57 KB
-
lifespans_J.csv
4.88 KB
-
README.md
4 KB
Abstract
Data and code used to run the OUFS model detailed in the study titled "Integrating multiple observation data sources to facilitate movement modelling of killer whale pods". The primary data used here represent locations and times corresponding to sightings of Southern Resident killer whales in the Salish Sea, off the coast of British Columbia, Canada and Washington, USA. Locations are spatially jittered by a constant factor so exact coordinates are difficult to obtain; this does not affect model outputs.
The code included here allows users to read the movement data, reformat and process data in preparation for model fitting, and fit the models. Note that when using the entire dataset, models can be relatively slow (a few hours) and may require high-performance computing, but it is easy to subset the input data and fit the models more quickly if users desire.
Dataset DOI: 10.5061/dryad.gf1vhhn2f
Description of the data and file structure
Files and variables
File: data_in.csv
Description: This file contains southern resident killer whale observation data from our study period and region.
Variables
- x_km: UTM Easting in km (coordinate reference system EPSG:3857). All values have been randomly shifted by a single constant value to obscure the true locations of the whales. This does not affect the results.
- y_km: UTM Northing in km (coordinate reference system EPSG:3857). All values have been randomly shifted by a single constant value to obscure the true locations of the whales. This does not affect the results.
- DateTime: The "raw" date and time associated with each observation, in UTC and YYYY-MM-DD HH:MM:SS format. All values have been randomly shifted by a single constant value to obscure the true locations of the whales. This does not affect the results.
- ID: The individual ID for each whale. Some of these are inferred for sightings that indicated the presence of an entire matriline or pod. NA values indicate observations where not all individuals could be identified.
- sighting_id: The "raw" unique identifier for each observation. Rows of this data table with the same sighting ID represent individual whales that were counted together as part of the same observation. The prefix for each entry in this column indicates the original dataset each observation belongs to.
- drone: a Boolean variable that is TRUE for observations collected via drone imagery.
- acoustic: a Boolean variable that is TRUE for observations collected via passive acoustic monitoring (as determined by observer comments).
- robust: a Boolean variable that is TRUE if the observation is to be considered eligible for robust Kalman filtering (set to FALSE for drone, theodolite, and PWWA observations)
- theodolite: a Boolean variable that is TRUE for observations collected by expert theodolite trackers.
- DateTimeRounded: DateTime, but rounded to the nearest second to avoid any data processing issues.
- DateTimeJitter: DateTimeRounded, but each observation is randomly jittered by fractions of a second to ensure that no two observations took place at the exact same time. Our model outputs were insensitive to the randomness incurred by this step.
- sid_rounded: an integer version of sighting_id
File: lifespans_J.csv
Description: This file contains birth and death dates for each whale in J Pod. Birth and death dates more accurately correspond to dates of first and last observation, respectively, in most cases, but for the purposes of our study of SRKW observation data, these are equivalent. For whales that are still alive, the "death" column is set to January 1, 2050. For whales where the exact birth or death dates are not known (birth and death years are known for all individuals), the "birth" and "death" columns reflect the most conservative possible estimates (e.g., January 1 of that year for "birth" and December 31 for "death").
Variables
- id: the individual whale
- birth: estimated date of birth, in UTC and YYYY-MM-DD HH:MM:SS format
- death: estimated date of death, in UTC and YYYY-MM-DD HH:MM:SS format
File: crawl_kf_ouf1s_robust_20250409.R
Description: script containing negative log-likelihood function for the OUFS model, which is then passed into RTMB during analysis. Also contains some helper functions used inside the likelihood function.
helper_functions.R: R script containing a multitude of "helper functions" necessary to carry out the analysis in fit_model.R. All functions are documented in this script.
fit_model.R: The primary R script necessary for this analysis. Fits the OUFS model to the SRKW J Pod movement dataset from which point the user would be able to replicate the figures and tables provided in the manuscript.
