IMOS-AnimalTracking / remora

Rapid Extraction of Marine Observations for Roving Animals
https://imos-animaltracking.github.io/remora
GNU General Public License v3.0
13 stars 5 forks source link

getDistance function doesn't account for different names in coordinates #4

Open fmaron opened 3 years ago

fmaron commented 3 years ago

@RossDwyer, is it possible to modify the getDistance() function so that users can analyse any data with coordinates instead of just data with receiver_deployment_longitude and receiver_deployment_latitude?

@ianjonsen and @vinayudyawer adapted their code so that the functions run with any type of data that presents longitude and latitude. Maybe we can do the same with the moorings function.

@fjaine

fjaine commented 2 years ago

I agree.

Labelling this as high priority as this will greatly increase the scope of the package - currently only acoustic telemetry data work with the function, if change this could work with any spatio-temporal dataset (eg. sat tracking, sightings records, fisheries data, etc.)

fjaine commented 2 years ago

@RossDwyer any chance we can action these edits before the meeting this week as we'll be officially announcing the package and a few users might try those functions?

RossDwyer commented 2 years ago

I believe I've now fixed this issue and have uploaded the edits to the dev branch. The function getDistance() now allows you to select your own X, Y and datetime column names. getDistance <- function(trackingData, moorLocations, X, Y, datetime). I used the same terminology as @vinayudyawer 's extractEnv() function, but the defaults of getDistance() are set to X="receiver_deployment_longitude", Y="receiver_deployment_latitude", datetime="detection_datetime", rather than X = "longitude", Y = "latitude", datetime = "detection_timestamp"

fjaine commented 2 years ago

Awesome! Thanks @RossDwyer !

fjaine commented 2 years ago

@ianjonsen it looks like this one might need to go past you as well