Skip to main content

Lower x grid not large enough

4 replies [Last post]
sauidrift
Offline
Joined: 05/26/2014
I'm getting this erro message after Move was upgraded to 2.0.0
 
What does it say and how can it be addressed?
 
UD_ving13 <- llply(split(ving13mb), function(x) brownian.bridge.dyn(x, location.error = 20, raster=20,  ext=.25, windowSize=24, timeStep=60, margin=3), .parallel = T)
 
 
Error in do.ply(i) : task 2 failed - "Lower x grid not large enough"
 
Best,
 
Nicolai
bart
Offline
Joined: 01/19/2009

Hi Nicolai,

This probably relates to changes in the move package that significantly increase speed (the input raster extent is now mostly irrelevant). It is solved by enlarging the ext argument.

Best

Bart

sauidrift
Offline
Joined: 05/26/2014

Hi Bart.

 

Thanks for info.

Importing multiple animals into a movestack works fine. But I found a strange thing when plotting and adding lines:

 

https://www.dropbox.com/sh/mgcppedd5kvb268/AABmFCXaG39IEV4hV_q2QchPa?dl=0

 

Seems like something happens to the extent (?)

 

Nicolai

Edit:

Could it be that when you spTransform and center on a movestack that it is done one the stack as a whole and not for the individual items in the stack and that causes errors when creating a dBBMMStack?

 

bart
Offline
Joined: 01/19/2009

Hi Nicolai,

I'm not sure I do understand the question fully but if you transform the stack as a whole with center is true the center is set one single center/ projection for the whole group to allow more easy comparison.

Best

Bart

sauidrift
Offline
Joined: 05/26/2014

Hi Bart.

Yes. The stack centering did the trick.

I'm working on the method developed by Bret Collier (http://www.rnr.lsu.edu/bret/) used in http://onlinelibrary.wiley.com/doi/10.1111/1365-2656.12205/abstract

Looks very promising.

 

I can prob make the code more efficient, but so far which seems to work:

library(move)

set.seed(1234)

nost14 <- move("z:/Data/Nordosterdalen/nost/nost14_60.csv")

nost14 <- spTransform(nost14, center=TRUE)

UD_nost14 <- brownian.bridge.dyn(object = nost14, location.error = 20, raster = 40, margin = 3, timeStep = 60)

plot(UD_nost14)

crs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0"

for(i in 1:length(split(UD_nost14))){

  tt <- split(UD_nost14)[[i]]

move.forud(tt, range.subset = 4:(length(tt@DBMvar)-3), ts=1,ras=20,lev=c(.50,.95), le=20,

           crs=crs, name=paste(tt@DBMvar@idData$individual.local.identifier,"",sep = "_"),

           ID=paste(tt@DBMvar@idData$individual.local.identifier,"",sep = "_"), path="C:/temp/UDtest") } 

 

 

update:

I have found that when you center (sptransform) prior to creating the dbbmmstack your resulting UDStack acts wierd in terms of extent, when you e.g. do lines(dbbmmstack[[1]]) in some UDs in the stack

Not doing the centering does not make the above code fail.

Is the centering obligatory?

Nicolai

timbean
Offline
Joined: 09/21/2016

I had a similar error message, and changing the extent or dimension did not help. I only succeeded in changing the error message to "Upper x grid not large enough" or "Lower y grid not large enough" or "Upper y grid not large enough." Bart Kranstauber was very helpful, immediately catching that my data had a long delay between two locations (over 40 days); here's his response to my e-mail, including the solution:

 

The breaking down of the code most likely relates to changes in the move package, calculations can now be done much quicker for much larger rasters due to some optimizations. I took some time to investigate the problem relates to the fact that you have a large data gap (80 days, more than half the tracking period) for which a large movement variance was estimated because of fast movements before and after. This means that for a long period the location is very uncertain. This segment should probably be omited from the calculation this can be done like this: 

bursted<-move::burst(porc.move.ae, c('normal','long')[1+(timeLag(porc.move.ae, units='days')>40)])


porc_dbbmm <- brownian.bridge.dyn(bursted, burstType='normal', dimSize=1500, location.error=20, 
                                  ext=1.4, time.step=10, margin=13)
porc_dbbmm<-new(".UD",calc(porc_dbbmm, sum))
plot(porc_dbbmm)