Jump to content
Ornithology Exchange (brought to you by the Ornithological Council)

FLightR-only one calibration period


Recommended Posts

Hi there!

The orignal code is designed as 

Calibration.periods<-data.frame(calibration.start = as.POSIXct(c(NA, "2014-05-05")),   
                                calibration.stop = as.POSIXct(c("2013-08-23", NA)),
                                lon = CapLocs[1], 
                                lat = CapLocs[2]) 

but my tags died before the birds returned so I can only calibrate from the deploy time/location. I want to calibrate from a couple days after my deploy date of July 6, 2014 until August 1, 2014 so I tried removing calibration.start :

Calibration.periods<-data.frame(calibration.stop = as.POSIXct(c("2014-08-01", NA)),
                                lon = CapLocs[1], 
                                lat = CapLocs[2])

but got this error:

Error in as.POSIXct.numeric(Calibration.periods[, 2], tz = "gmt") : 
  'origin' must be supplied

How should I edit my text to reflect just one calibration window? Many thanks. Nubie here. Plain English appreciated! :)

 

Link to comment
Share on other sites

Try format:

Calibration.periods <- data.frame(calibration.start = as.POSIXct("2014-05-05"),   

                                calibration.stop = as.POSIXct("2013-08-23"),
                                lon = CapLocs[1], 
                                lat = CapLocs[2]) 

 

Stop date should not be before start date though.

Link to comment
Share on other sites

Depending on why you only have one calibration period (e.g. the tag died half way through, but you still recaptured the bird and retrieved the tag), you have to make some additional changes to the FlightR script: in the run.particle.filter function you may need to change  "known.last=TRUE" to "known.last=FALSE"  (because you won't know where the tag has died) and when you only have one calibration period, you also have to remove the model aging part in the make.calibration function: Calibration<-make.calibration(Proc.data, Calibration.periods, model.ageing = TRUE)

I had the same issue as you did - don't have my note book with me here, but I have the correct script for you if the above doesn't work I can send it to you when I'm back in the office on Monday.

Link to comment
Share on other sites


Thanks to both of you. I'm still working through the rest of the code so no results yet, but at least I haven't gotten an error message! Louise, I think I found you on line so I will email you and you can send me your script.

Link to comment
Share on other sites

Hey!

Thanks again! Used the suggested changes and took LdeRaad's suggestion about changing model.ageing to TRUE. Output was as below but got Warning message below. 
Thoughts? Also please see notes below re map.

#CALIBRATION 
Calibration.periods <- data.frame(calibration.start = as.POSIXct("2014-07-06"),   
                                calibration.stop = as.POSIXct("2014-08-01"),
                                lon = CapLocs[1], 
                                lat = CapLocs[2]) 

#View results
    Calibration.periods

#create a calibration object 
    Calibration<-make.calibration(Proc.data = Light.Data, 
                              Calibration.periods = Calibration.periods,
                              model.ageing = TRUE,
                              plot.each = FALSE, 
                              plot.final = FALSE)


checking dawn 1  checking dawn 2  checking dawn 3  checking dawn 4  checking dawn 5  checking dawn 6  checking dawn 7  checking dawn 8  checking dawn 9  checking dawn 10  checking dawn 11  checking dawn 12  checking dawn 13  checking dawn 14 

#(etc, etc, I trimmed this)
calibration method used: parametric.slope 
likelihood correction switched to TRUE
 simulation:  0%  simulation:  1%  simulation:  1%  simulation:  1%  simulation:  2%  simulation:  2%  simulation:  2%  simulation:  3%  simulation:  
#(etc etc, I trimmed this)

Warning message:
In get.calibration.parameters(Calibration.periods, Proc.data, model.ageing = model.ageing,  :
  you have only one calibration period ageing estimation is unreliable and should be turned ot F!!!

#re MAP
Also, when I tried to plot a simple map 


#Plot a simple map
map.FLightR.ggmap(Result)

got this error:
Error in f(...) : could not find function "viewport"

Looked this up at http://stat.ethz.ch/R-manual/R-devel/library/grid/html/viewport.html
but really wasn't sure what to do here. Any suggestions anyone?

Thanks gang!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...