dive_cycle_summary: Dive-cycle-level acoustic and tag data, for one or more tags

View source: R/dive_cycle_summary.R

dive_cycle_summaryR Documentation

Dive-cycle-level acoustic and tag data, for one or more tags

Description

Summarize SMRT (and/or Lander2) tag data from .nc files for each foraging dive cycle. There are data at two, nested time-scales: the dive cycle (a foraging dive and all the dives that follow it) and, within that, time-periods of set length in which other metrics are averaged. This function does coarse scale only. The data are intended for use in a state-switching model.

Usage

dive_cycle_summary(
  tag_id = zc_smrt_tag_list,
  nc_path = getwd(),
  ae_path = getwd(),
  bathy_path,
  ETOP01_bathy = FALSE,
  ping_log_file,
  rl_file,
  rl_model_dir,
  dive_class_file,
  acoustic_summary_file,
  email,
  save_csv = TRUE,
  save_tracks = FALSE,
  track_dir,
  csv_name = "dive_cycle_summary.csv"
)

Arguments

tag_id

Character string or vector with tag IDs (without "-cal.nc"). Default: all SMRT ziphius tags.

nc_path

Directory (quoted string) where .nc files are stored. Can be one string, or a list the same length as tag_ids. Note: to download latest versions from Google drive, try function: download_drive_nc. Default: current working directory. Note: use "/" and not "\" to avoid headaches.

ae_path

Directory (quoted string) where text files with info about acoustic events are stored. If needed, you can use download_drive_acoustic_events to get these. Default is the current working directory.

bathy_path

A directory path to the folder containing all bathymetry data. Use download_bathy if you don't have this data already. If not provided, the bathymetry data will not be included in the output dataset.

ETOP01_bathy

whether to try to fill-in bathymetry info for locations outside NEPAC dataset bounds using NOAA online ETOP01 database. Default is FALSE. This is slow and no animals have gone out-of-bounds yet as of July 2021.

ping_log_file

name (with path, if needed) of locally-stored .csv file with raw RL data. If not provided, the default is to use download_drive_rls to obtain it from the FB Google Drive.

rl_file

name (with path, if needed) of locally-stored .csv file with raw RL data. If not provided, the default is to use download_drive_rls to obtain it from the FB Google Drive.

rl_model_dir

directory where files with results of RL modeling (for non-acoustic tags) are stored locally

dive_class_file

name (with path, if needed) of locally-stored .csv file with information on machine-learning classification of dives as foraging or not. This should match perfectly with presence/absence of clicking from acoustic recordings, but is mainly for tags/dives without acoutics.

acoustic_summary_file

optional - if you have already run dive_acoustic_summary and have saved results as a csv, you can use that file to get results faster. Otherwise, this function will call dive_acoustic_summary and re-do the dive-level processing.

email

Email address (required for FB Google Drive authentication; optional if rl_file is provided). You may also be asked to sign in or verify your Google identity as this function runs.

save_csv

Logical; whether or not to save a csv file with the results. Default: TRUE (and will overwrite any existing file)

save_tracks

Logical; whether or not to save csv file with geo-referenced pseudotrack (in meters northing/easting relative to initial location)

track_dir

Directory to store tracks in (if save_tracks is TRUE). Defaults to working directory.

csv_name

File name (with path, if desired) in which to save results in csv format. Default is dive_acoustic_summary.csv.

Value

A data.frame() with one row per dive, per whale


stacyderuiter/FBtagtools documentation built on June 1, 2025, 6:26 p.m.