| read_cats | R Documentation |
Read .csv file(s) with data from a CATS tag deployment, including associated metadata, and store the resulting data in a .nc file.
read_cats(
file_dir = NULL,
fname = NULL,
depid,
txt_fname = NULL,
nc_dir = getwd(),
nc_fname = paste(depid, "_raw.nc", sep = ""),
device_serial = NULL,
device_model_name = NULL,
device_model_version = NULL,
device_url = "https://cats.is/",
dephist_device_tzone = NULL,
animal_species_common = "unknown",
animal_species_science = "unknown"
)
file_dir |
String containing the name (including full or relative path) of the directory where the CATS csv file(s) are stored. If omitted, |
fname |
Name(s) of the CATS csv file(s) to read. If |
depid |
String containing the deployment identification code assigned
to this deployment, for example, 'mn12_186a'. If |
txt_fname |
Name of the .txt file with metadata about the CATS deployment. If not input, the function will try to construct it from file_dir and depid (like |
nc_dir |
String containing the name (including full or relative path) of the directory where the output nc file should be stored. Defaults to the current working directory. |
nc_fname |
String containing the file name to use for the output netCDF file. Defaults to "(depid)_raw.nc" - for example, "mn12_186a_raw.nc" |
device_serial |
String containing the serial number of the CATS tag. Obtained from |
device_model_name |
String containing the model of the CATS tag used for data collection, for example "CATS Cam." Obtained from |
device_model_version |
String; CATS tag version. Obtained from |
device_url |
String containing URL of tag manufacturer; defaults to "https://cats.is/" and is stored in the info structure of the output NetCDF file. |
dephist_device_tzone |
String indicating the time zone in which the tag was deployed. Obtained by default from |
animal_species_common |
Common name of species on which tag was deployed. Defaults to "unknonwn" and is stored in the info structure of the output NetCDF file. |
animal_species_science |
Scientific name of species on which tag was deployed. Defaults to "unknonwn" and is stored in the info structure of the output NetCDF file. |
A string containing the file name of the netCDF (.nc) file in which the output has been saved. This function generates a netCDF file in the current working directory containing the tag data variables, including:
A, Accelerometer data structure
M, Magnetometer data structure
temp, Temperature sensor data structure
info Information structure for the deployment
CATS loggers can produce very large csv files which are slow to process. This function is (somewhat) optimised for speed and memory use so will tolerate large files. But processing could be slow. Note also that although CATs tags use a NED axis orientation for 3D sensors, **this function converts to the NEU orientation** expected by the animaltag tool kit. To revert (if continuing analysis with CATs-specific tools outside animaltags), simply multiply all z-axis values by -1, and consider editing the metadata. Also note that according to Cade et al. 2021, not all CATs tags have the same internal orientation of the triaxial sensors – such that the first column in the data may or may not be the "x axis." Here, we assume that the three columns of data for any triaxial sensor are correctly labeled with X,Y,Z included in the column name in the CATs csv file. If not, further data-based bench calibration of the device may be needed to determine correct axis orientation.
## Not run:
nc_filename <- read_cats("my_cats_file.csv", "my_cats_deployment_name")
load_nc(nc_filename)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.