ctmm-initiative / ctmmweb

Web app for analyzing animal tracking data, built upon ctmm R package
http://biology.umd.edu/movement.html
GNU General Public License v3.0
34 stars 22 forks source link

calibration data error #129

Closed xhdong-umd closed 3 years ago

xhdong-umd commented 4 years ago

@chfleming I received an error report from user about the calibration process. I forwarded the email to you so you should have copy of the data.

To reproduce the error:

  1. load movement_data
  2. load calibration data in 5.Error pane, apply to current
  3. there is error in the error plot
    Warning: Error in graphics::symbols: invalid symbol parameter
    172: graphics::symbols
    171: utils::getS3method("plot", CLASS)
    170: plot.list

What really happened is:

To reproduce above in script:

library(ctmm)

tele_list <- as.telemetry("d:/Work/R/ctmm-shiny/data/movement_data.csv")
cali_tele <- as.telemetry("d:/Work/R/ctmm-shiny/data/calibration_data.csv")
ctmmweb:::is_calibrated(cali_tele)

cali_uere <- ctmm::uere.fit(cali_tele)
uere(tele_list) <- cali_uere 

ctmm::plot(tele_list, error = 2)

So my question is:

chfleming commented 4 years ago

The error is happening because the "movement_data" are not being calibrated correctly (class mismatch), ... because they have a different format (sensor.type='gps') than the "calibration_data", ... because "calibration_data" are not MoveBank formatted, ... because "calibration_data" look like "movement_data" that have been run through ctmm and calibrated already, ... but the RMS UERE for "calibration_data" is suspiciously large (38 meters) and the same as what you get when treating "movement_data" as calibration data.

xhdong-umd commented 3 years ago

@chfleming , Adrián mentioned that the hosted web version doesn't have the error. Out of curiosity I tested and found it's related to ctmm version. By further installing different ctmm versions, I found out that after this commit there will be error.

Reproducible code if you download the data shared by Adrián

library(ctmm)
tele_list <- as.telemetry("d:/Work/R/ctmm-shiny/data/Vultures movement/Vultures position Summer 2020 MB.csv")
cali_tele <- as.telemetry("d:/Work/R/ctmm-shiny/data/Vultures movement/Calibration data CTT E-400 MB unit 12340.csv")

# ctmmweb:::is_calibrated(cali_tele)

cali_uere <- ctmm::uere.fit(cali_tele)
uere(tele_list) <- cali_uere 

ctmm::plot(tele_list,
               error = 2)

Of course I knew you mentioned before there were some problems in the data, so the error might be expected behavior since the data was not right. I just want you to know this detail.

chfleming commented 3 years ago

The error was mine this time. It should be fixed now. I didn't anticipate different fix-type columns sometimes differing and sometimes not, though I should had.

xhdong-umd commented 3 years ago

Thanks Chris!