Skip to content

Commit

Permalink
A few more pieces added to the detections processing bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
jackVanish committed Apr 9, 2024
1 parent 68d980e commit 74707f8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
31 changes: 20 additions & 11 deletions R/imos_to_otn_detections.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,40 @@
#' @export
#'

imos_to_otn_detections <- function(detection_dataframe) {
imos_to_otn_detections <- function(detection_dataframe, coll_code = NULL) {
det_return <- detection_dataframe %>%
dplyr::select(
detection_datetime,
receiver_name,
receiver_id,
transmitter_id,
transmitter_sensor_raw_value,
transmitter_sensor_value,
transmitter_sensor_unit,
transmitter_sensor_type,
station_name,
receiver_project_name,
receiver_deployment_latitude,
receiver_deployment_longitude
receiver_deployment_longitude,
species_scientific_name,
species_common_name,
ends_with("_QC"),
) %>%
mutate(
transmitter_name = NA,
transmitter_serial = NA,
sensorname = transmitter_id,
detectedby = receiver_project_name,
collectioncode = coll_code,
) %>%
rename(
date_ane_time = detection_datetime,
date_and_time = detection_datetime,
receiver = receiver_name,
transmitter = transmitter_id,
sensor_value = transmitter_sensor_raw_value,
sensor_unit = transmitter_sensor_unit,
tagname = transmitter_id,
sensorvalue = transmitter_sensor_value,
sensorunit = transmitter_sensor_unit,
latitude = receiver_deployment_latitude,
longitude = receiver_deployment_longitude
longitude = receiver_deployment_longitude,
scientificname = species_scientific_name,
commonname = species_common_name,
sensortype = transmitter_sensor_type,
station = station_name,
)

return(det_return)
Expand Down
2 changes: 1 addition & 1 deletion R/otn_imos_column_map.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ otn_imos_column_map <- function(det_dataframe, rcvr_dataframe = NULL, tag_datafr
transmitter_sensor_unit = NA,
transmitter_status = NA,
transmitter_estimated_battery_life = NA,
transmitter_sensor_raw_value = NA,
transmitter_sensor_value = NA,
embargo_date = NA,
transmitter_deployment_latitude = NA,
transmitter_deployment_longitude = NA,
Expand Down

0 comments on commit 74707f8

Please sign in to comment.