First, FlightR rocks and thank you Eldar for your tireless work on this package. What an awesome leap forward for geolocator analysis. I have been systematically working through the coding options in FlightR to better understand the underlying model, but I seem to be observing some behavior that I canβt understand in regards to onshore/offshore locations and the spatial mask. I am analyzing geolocator data from East Coast US Grasshopper Sparrows: a North American landbird that migrates to Florida and some of the Caribbean Islands. So I want to allow flights over water, but stationary periods over water are not possible.
However, when I export my results to ArcGIS and look at the movements, I am getting stationary periods over water >50 km from land. I understand that the spatial grid is 50x50 km, so a stationary period just offshore (in nearshore waters) is reasonable given the coarseness of the spatial grid.
Attempt 1: Do not allow stationary periods over water
Grid<-make.grid(left=-115, bottom=-10, right=-60, top=52,
distance.from.land.allowed.to.use=c(-Inf, 1500),probability.of.staying = 0,
distance.from.land.allowed.to.stay=c(-Inf, 0))
all.in<-make.prerun.object(Proc.data, Grid,start=c(-76.4181, 38.2942),end = NA,
Direction=180,)
Result.U337_NoWaterStay<-run.particle.filter(all.in,nParticles=1e6,known.last=FALSE,
check.outliers=T, b=750)
The blue box surrounds some of the points >50 km from land; these points represent 30 consecutive days).
When I check the spatial grid, I can confirm that there is a zero probability of staying there.
all.in$Spatial$Grid[5972,]
lon lat Stay
-81.63934 23.85000 0.00000
all.in$Spatial$Grid[5972,3]==0
Stay
TRUE
Plotting the grid (via make.grid(β¦..) also confirms that the mask βlooksβ right. A bird shouldnβt be able to hang out there for a month, I think.
Attempt 2: A more extreme example, do not allow ANY flight over water (>50 km from shore)
Grid<-make.grid(left=-115, bottom=-10, right=-60, top=52,
distance.from.land.allowed.to.use=c(-Inf, 0),probability.of.staying = 0,
distance.from.land.allowed.to.stay=c(-Inf, 0))
I understand that in this case the make.grid function resets the maximum distance.from.land.allowed.to.stay to 25 km,
head(getAnywhere(make.grid()))
β¦
if (distance.from.land.allowed.to.stay[2] < 25)
distance.from.land.allowed.to.stay[2] <- 25
β¦
But, I am still getting flights over water (>100 km offshore Florida) and short stationary periods over water. In this photo thereβs a 4-day period of flight over water far from shore.
Perhaps I'm misunderstanding the "distance.from.land.allowed.to.stay" command. My understanding is that an animal cannot remain in that 50x50 km square for multiple twilight periods if I set probability.of.staying to zero for that square. Thanks for your help Eldar.