Skip to content

Commit

Permalink
merge main; resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisholbrook committed Sep 20, 2024
2 parents d952961 + 3b8988f commit a7d580f
Show file tree
Hide file tree
Showing 15 changed files with 1,177 additions and 970 deletions.
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Package: glatos
Type: Package
Title: A package for the Great Lakes Acoustic Telemetry Observation System
Description: Functions useful to members of the Great Lakes Acoustic Telemetry Observation System https://glatos.glos.us; many more broadly relevant to simulating, processing, analysing, and visualizing acoustic telemetry data.
Version: 0.8.0.9012
Date: 2024-09-17
Version: 0.8.0
Date: 2024-09-18
Depends: R (>= 3.6.0)
Imports:
av,
Expand All @@ -24,7 +24,6 @@ Suggests:
ggplot2,
gifski,
knitr,
mapview,
methods,
png,
purrr,
Expand Down
102 changes: 50 additions & 52 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
----

# glatos 0.8.0 (dev)
# glatos 0.8.9011 (2024-09-18)


## Breaking changes


- Changed `make_transition()` to use `jarasterize()` (see New Features) and
added input arg `buffer`.
- Removed dependence on gdalUtilities.
Expand All @@ -25,44 +24,23 @@ from earlier versions.
- Removed 'gganimate_handout' (pdf and html) from 'vignettes'.


### Bug fixes and minor changes

- Add `@srs` slot to `greatLakesTrLayer` data object and rename file
'data/greatLakesTrLayer.rda'.
- fixes [issue #213](https://github.com/ocean-tracking-network/glatos/issues/213)

- Fix bug in `read_glatos_workbook()` where timestamps during daylight savings
were shifted one hour on linux operating system (not an issue on windows or
mac).
- fixes [issue #208](https://github.com/ocean-tracking-network/glatos/issues/208)

- Omit data.table from class of object returned by `read_glatos_detections()`
and `read_glatos_receivers()`.
- fixes [issue #200](https://github.com/ocean-tracking-network/glatos/issues/200)

- Fix typo in Description to Suggest 'gifski' (not 'gifsky').
- fixes [issue #185](https://github.com/ocean-tracking-network/glatos/issues/185)


### New features

#### 2024-08-28

- New function `jarasterize()` to allow rasterization
(esp. with `all_touched = TRUE`) using only `sf` and `raster`.
Used by `make_transition()`.
- Add new function `vue_convert()` to convert VRL file to CSV file (detection
records only; receiver event log records are not supported).
- replaces `vrl2csv()` (deprecated).

- Add new function `vdat_convert()` to convert VRL or VDAT files to
Fathom/VDAT CSV.

- New function `scale_meters_to_degrees()` to inform selection of `res` argument
to `make_transition()`.

#### 2024-01-19

- In `make_frames()`, allow `terra::SpatVector` input for background map
(`bg_map` arg).
- add test for `terra::SpatVector` input


#### 2023-08-30
- Add new functions for reading data exported from VRL with VUE software.
- `read_vue_detection_csv()` to read data from detection file exported
from VUE or created using `vue_convert()` or `vrl2csv()`.
- `read_vue_event_csv()` to read data from receiver event log file exported
from VUE.

- Add new function `read_vdat_csv()` to read data exported from VRL or VDAT
using VDAT.exe (e.g., using `vdat_convert()`).

- Add new functions to create, check, and validate `glatos_animals` objects:
- `glatos_animals()` to construct a `glatos_animals` object from
Expand Down Expand Up @@ -102,22 +80,42 @@ from earlier versions.
names and classes.
- fixes [issue #126](https://github.com/ocean-tracking-network/glatos/issues/126)
- fixes [issue #78](https://github.com/ocean-tracking-network/glatos/issues/78)

- Add new function `vue_convert()` to convert VRL file to CSV file (detection
records only; receiver event log records are not supported).
- replaces `vrl2csv()` (deprecated).

- Add new function `vdat_convert()` to convert VRL or VDAT files to
Fathom/VDAT CSV.

- Add new functions for reading data exported from VRL with VUE software.
- `read_vue_detection_csv()` to read data from detection file exported
from VUE or created using `vue_convert()` or `vrl2csv()`.
- `read_vue_event_csv()` to read data from receiver event log file exported
from VUE.

- New function `jarasterize()` to allow rasterization
(esp. with `all_touched = TRUE`) using only `sf` and `raster`.
Used by `make_transition()`.

- Add new function `read_vdat_csv()` to read data exported from VRL or VDAT
using VDAT.exe (e.g., using `vdat_convert()`).
- Add new function `scale_meters_to_degrees()` to inform selection of `res`
argument to `make_transition()`.

- In `make_frames()`, allow `terra::SpatVector` input for background map
(`bg_map` arg).
- add test for `terra::SpatVector` input


### Bug fixes and minor changes

- Add `@srs` slot to `greatLakesTrLayer` data object and rename file
'data/greatLakesTrLayer.rda'.
- fixes [issue #213](https://github.com/ocean-tracking-network/glatos/issues/213)

- Fix bug in `read_glatos_workbook()` where timestamps during daylight savings
were shifted one hour on linux operating system (not an issue on windows or
mac).
- fixes [issue #208](https://github.com/ocean-tracking-network/glatos/issues/208)

- Omit data.table from class of object returned by `read_glatos_detections()`
and `read_glatos_receivers()`.
- fixes [issue #200](https://github.com/ocean-tracking-network/glatos/issues/200)

- Fix typo in Description to Suggest 'gifski' (not 'gifsky').
- fixes [issue #185](https://github.com/ocean-tracking-network/glatos/issues/185)

- Various changes to resolve R CMD check errors, warning, and notes (generally
not user-facing).


----


# glatos 0.7.3 (2024-04-09)
Expand Down
122 changes: 7 additions & 115 deletions R/package-glatos.r
Original file line number Diff line number Diff line change
@@ -1,119 +1,8 @@
#' An R package for the Great Lakes Acoustic Telemetry Observation System
#'
#' `glatos` is an R package with functions useful to members of the Great
#' Lakes Acoustic Telemetry Observation System (<https://glatos.glos.us>).
#' Functions may be generally useful for processing, analyzing, simulating, and
#' visualizing acoustic telemetry data, but are not strictly limited to acoustic
#' telemetry applications.
#'
#' @section Package status: *This package is in early development and its
#' content is evolving.* To access the package or contribute code, join the
#' project at (<https://github.com/ocean-tracking-network/glatos>). If you
#' encounter problems or have questions or suggestions, please post a new
#' issue or email <cholbrook@usgs.gov> (maintainer: Chris Holbrook).
#'
#' @section Installation: Installation instructions can be found at
#' <https://github.com/ocean-tracking-network/glatos/wiki/installation-instructions>.
#'
#'
#'
#' @section Data loading and processing: \describe{
#'
#' \item{[read_glatos_detections] and [read_otn_detections]}{ Fast
#' data loading from standard GLATOS and OTN data files to a single structure
#' that is compatible with other glatos functions.}
#'
#' \item{[read_glatos_receivers] and [read_otn_deployments]}{
#' Reads receiver location histories from standard GLATOS and OTN data files
#' to a single structure that is compatible with other glatos functions.}
#'
#' \item{[read_glatos_workbook]}{ Reads project-specific receiver history
#' and fish taggging and release data from a standard glatos workbook file.}
#'
#' \item{[read_vemco_tag_specs]}{ Reads transmitter (tag) specifications
#' and operating schedule.}
#'
#' \item{[real_sensor_values]}{ Converts 'raw' transmitter sensor (e.g.,
#' depth, temperature) to 'real'-scale values (e.g., depth in meters) using
#' transmitter specification data (e.g., from [read_vemco_tag_specs]).} }
#'
#' @section Filtering and summarizing: \describe{
#' \item{[min_lag]}{
#' Facilitates identification and removal of false positive detections by
#' calculating the minimum time interval (min_lag) between successive
#' detections.}
#'
#' \item{[false_detections]}{ Removes potential false positive detections
#' using "short interval" criteria (see [min_lag]).}
#'
#' \item{[detection_events]}{ Distills detection data down to a much
#' smaller number of discrete detection events, defined as a change in location
#' or time gap that exceeds a threshold.}
#'
#' \item{[summarize_detections]}{ Calculates number of fish detected,
#' number of detections, first and last detection timestamps, and/or mean
#' location of receivers or groups, depending on specific type of summary
#' requested.}
#'
#' \item{[residence_index]}{ calculates the relative proportion of time
#' spent at each location.}
#'
#' \item{[REI]}{ calculates the relative activity at each receiver based
#' on number of unique species and individual animals.}
#' }
#'
#' @section Visualization and data exploration: \describe{
#' \item{[abacus_plot]}{ Useful for exploring movement patterns of
#' individual tagged animals through time.}
#'
#' \item{[detection_bubble_plot]}{ Useful for exploring distribution of
#' tagged individuals among receivers.}
#'
#' \item{[interpolate_path], [make_frames], and [make_video]}{
#' Interpolate spatio-temporal movements, between detections, create video
#' frames, and stitch frames together to create animated video file using FFmpeg
#' software.}
#'
#' \item{[adjust_playback_time]}{ Modify playback speed of videos and
#' optionally convert between video file formats. Requires FFmpeg.}
#' }
#'
#' @section Simulation functions for system design and evaluation: \describe{
#' \item{[calc_collision_prob]}{ Estimates the probability of collisions
#' for pulse-position-modulation type co-located telemetry transmitters. This is
#' useful for determining the number of fish to release or tag specifications
#' (e.g., delay).}
#'
#' \item{[receiver_line_det_sim]}{ Simulates detection of acoustic-tagged
#' fish crossing a receiver line (or single receiver). This is useful for
#' determining optimal spacing of receviers in a line and tag specifications
#' (e.g., delay).}
#'
#' \item{[crw_in_polygon], [transmit_along_path], and
#' [detect_transmissions]}{ Individually simulate random fish movement paths
#' within a water body ([crw_in_polygon]: a random walk in a polygon), tag
#' signal transmissions along those paths ([transmit_along_path]: time series
#' and locations of transmissions based on tag specs), and detection of those
#' transmittions by receivers in a user-defined receiver network
#' ([detect_transmissions]: time series and locations of detections based on
#' detection range curve). Collectively, these functions can be used to explore,
#' compare, and contrast theoretical performance of a wide range of transmitter
#' and receiver network designs.}
#' }
#'
#' @section Convert glatos data objects to other package classes: \describe{
#' \item{[convert_glatos_to_att]}{ Converts glatos_detections and
#' glatos_receiver objects to ATT for compatibility with the Animal Tracking
#' Toolbox(https://github.com/vinayudyawer/ATT) and the VTrack package.}
#'
#' \item{[convert_otn_erddap_to_att]}{ Converts glatos_detections and
#' transmitter, receiver, and animal metadata from the OTN ERDDAP to ATT format
#' for compatibility with the Animal Tracking
#' Toolbox(https://github.com/vinayudyawer/ATT) and the VTrack package.}
#' }

#' ```{r child = "ReadMe.md"}
#' ```
#' @docType package
#' @name glatos
#'
#' @import data.table sp
#' @importFrom graphics abline axis box legend lines mtext par points symbols
#' text
Expand All @@ -129,10 +18,13 @@
# avoid R CMD check note
globalVariables(".")

# current nickname
nickname <- function() "very-refreshing-lemonade"

# package startup message
.onAttach <- function(libname, pkgname) {
packageStartupMessage(paste0(
"version ", utils::packageVersion("glatos"),
" ('very-refreshing-lemonade')"
" ('", nickname(), "')"
))
}
5 changes: 3 additions & 2 deletions R/util-vdat.r
Original file line number Diff line number Diff line change
Expand Up @@ -637,11 +637,12 @@ get_local_vdat_template <- function(vdat_exe_path = NULL) {

vdat_schema <- system2(vdat_cmd, vdat_call, stdout = TRUE)

# remove " BOM from start of first row if present
# remove BOM from start of first row if present
check_bom <- vdat_schema[1]
Encoding(check_bom) <- "latin1"

if (grepl("^", check_bom)) {

if (length(suppressMessages(tools::showNonASCII(check_bom))) > 0) {
Encoding(vdat_schema[1]) <- "latin1"
vdat_schema[1] <- iconv(vdat_schema[1], "latin1", "ascii", sub = "")
}
Expand Down
Loading

0 comments on commit a7d580f

Please sign in to comment.