hugomflavio / actel

Standardised analysis of acoustic telemetry data from fish moving through receiver arrays
https://hugomflavio.github.io/actel-website
26 stars 6 forks source link

Actel did not recognize detection files from HR2 receivers from Innovasea/VEMCO #97

Closed IPauwels closed 1 month ago

IPauwels commented 5 months ago

@hugomflavio

Dear Hugo,

I got the following error when trying to apply actel: If your file corresponds to a hydrophone log and actel did not recognize it, please get in contact through www.github.com/hugomflavio/actel/issues/new M: 17 files were excluded from further analyses. Error: No valid detection files were found.M: The analysis errored. You can recover latest the job log (including your comments and decisions) by running recoverLog().

My detection files are raw detections from HR2 receivers of Innovasea, 180 Khz. The tags used have a depth sensor, so depth sensor values are included. The tags emmitted HR and PPM transmissions.

Here are my input files and one of the detection files that I want to analyse. HR2-180 461059 2023-04-06 162528.csv biometrics.csv deployments.csv spatial.csv

This is the script I used to run on the input files: explore(tz = 'Europe/Brussels', max.interval = 60, min.total.detections = 2, start.time = NULL, stop.time = NULL, speed.method = "last to first", speed.warning = NULL, speed.error = NULL, jump.warning = 2, jump.error = 3, inactive.warning = NULL, inactive.error = NULL, exclude.tags = NULL, override = NULL, report = TRUE, auto.open = TRUE, discard.orphans = FALSE, discard.first = NULL, save.detections = FALSE, GUI = "needed", save.tables.locally = FALSE, detections.y.axis = "stations")

I also have my entire project on github (in a private repo). Please contact me if you can help me out and I will add you to this private repo.

Many thanks in advance! Best regards, Ine Pauwels from the Research Institute of Nature and Forest CONTACT: email: ine.pauwels@inbo.be phone: 0032 475 36 40 96

hugomflavio commented 5 months ago

Hi Ine,

Thanks for bringing this up. This new innovasea format is slightly different from the old vemco formats actel is used to, which is why it is failing to recognize it. This is an easy fix though, you've already provided me with what I need to update the code. I'll try to have a working version for you to test in the next 24h (currently travelling).

IPauwels commented 5 months ago

@hugomflavio

Dear Hugo, That is really great! Very greatfull for your quick response and help!!

Good travels! Best regards, Ine

IPauwels commented 5 months ago

PS: I noticed something else with regards to these HR2 receivers and their tags from Innovasea. I can fix this for now, and it might not be something you want to adapt to actel for now, but I just give it for your interest.

With these HR2 180 kHz receivers, you can use two types of transmissions: the HR ones and PPM ones (slightly different way of encoding and transmitting the unique ID). These two types of transmissions are in one and the same tag. They each have another prefix in the full-tag ID, but the same suffix (actual tag ID).

If we have for example a tag with ID 2635, then this tag ID can be transmitted in the HR way, as well as the PPM way. The HR full ID is H170-1803-2635, where the PPM full ID is A180-1702-2635. Actel gives an error and says it found a signal that matches more than one tag, where this is in reality one and the same tag.

I guess this requires more time from you to adapt actel. Maybe something for the future.

I will now work around this by splitting my detections files in HR files and PPM files.

All the best! Ine

hugomflavio commented 5 months ago

@IPauwels I've pushed an update that should allow the new innovasea format to be properly recognized. When I tested locally, it read the file you sent properly, and indeed stopped right away once the code-spaces issue appeared. Try installing the dev version to see if it works for you too.

# If you don't have the package "remotes" installed, start with:
install.packages("remotes")

# This will install then actel's development version:
remotes::install_github("hugomflavio/actel", 
    build_opts = c("--no-resave-data", "--no-manual"), 
    build_vignettes = TRUE)

When you reload actel, it should show version 1.3.0.9006. Let me know if that version reads the files properly so I can close this one :)

Regarding the transmitter code issue you mentioned: Thanks for bringing it up, it is actually very relevant. I've moved it to a separate issue: #98

IPauwels commented 5 months ago

Hi Hugo,

It did not work so far, but I think I just did not manage to properly install the dev version of actel. I submitted your code to R, next activated actel with library(actel) (after first removing the previous version). Then actel is loaded again, but it does not appear in my library (neither system library list). When I run explore() I get the error that it cannot find the detection files.

I attache again here one of the files used, as well as the explore() settings I used.

Receiver_PPM_461059.csv

readDot(input = "spatial.txt")

explore(tz = 'Europe/Brussels', max.interval = 60, min.total.detections = 2, start.time = NULL, stop.time = NULL, speed.method = "last to first", speed.warning = NULL, speed.error = NULL, jump.warning = 2, jump.error = 3, inactive.warning = NULL, inactive.error = NULL, exclude.tags = NULL, override = NULL, report = TRUE, auto.open = TRUE, discard.orphans = FALSE, discard.first = NULL, save.detections = TRUE, GUI = "needed", save.tables.locally = FALSE, detections.y.axis = "arrays")

hugomflavio commented 5 months ago

When you run library(actel) on a new R session, does the welcome message show version 1.3.0.9006?

IPauwels commented 5 months ago

Yes, it did. So I guess it doesn't matter that it did not show up in my library list. It was the correct version that was loaded, but unfortunately it did not recognize the files?

Here is the R output after loading the actel package (installed through github):

library(actel) Welcome to actel (1.3.0.9006)! Run ?actel for starting tips.

!!! IMPORTANT NOTE: !!! !!! A silent bug was found in how migration() handles parallel !!! sections. This bug is still present, but it does not affect !!! all datasets. It can impact the number of animals reported !!! to have passed by a given section. !!! !!! Until the issue is resolved, actel will now stop if it !!! detects parallel sections. If you are unsure if your study !!! area has parallel sections, try running the analyses again !!! with version 1.3.0. !!! !!! You can read more about this issue here: !!! https://hugomflavio.github.io/actel-website/issue_79.html !!! !!! (This message will stop being displayed in 6 days)

hugomflavio commented 5 months ago

That is interesting. Could you try just with the detections file you sent me in the beginning? Without editing the code spaces, to confirm if the file reads and the analysis then stops at the code space issue, or if it won't even read that file.

I'll try to get a working version for the code spaces in the coming days as well.

hugomflavio commented 1 month ago

Closing this one as no further feedback was received. Issue #98 will remain open to address the code-spaces part of it.