resampling UDs to common grid and resolution

33 views
Skip to first unread message

Ryan Gill

unread,
Apr 12, 2024, 12:02:48 PMApr 12
to ctmm R user group
Hi everyone,

I have several thousand UDs for animals within seasons (six season per year) and years (22 years) and I'm hoping to calculate overlap() among the individuals common to a herd, season and year. However, when I calculated the akde for these animals I must have changed the grid resolution among some of those animals. I'm not sure how, but regardless, I get an error when calculating overlap:

Error in grid.intersection(UD) : Inconsistent grid resolutions.

Does ctmm have a way to resample, or force these UDs to the same resolution to calculate overlap? I could use terra::resample(), but in my case I guess I would have to select one of the UDs within each group to resample to, and I'm not sure I want to go down that path just yet.

Thanks!

Christen Fleming

unread,
Apr 23, 2024, 10:41:28 PMApr 23
to ctmm R user group
Hi Ryan,

There is no way to resample within ctmm. Assuming that the projections are the same, then you would have export the PDF rasters, resample them, and then assign their arrays back to the UD object and update the dr slot.
If the projections are different, then you would also have to re-project the fit objects that are stored inside the UD objects, which I also have not coded. That would involve some math (shift, rotation, and rescaling).

Best,
Chris
Reply all
Reply to author
Forward
0 new messages