I have a raster with unusual dimensions and extent, these are global maps of ocean data.
rodd=rast(ymin=-91,ymax=91,xmin=-1,xmax=359,nrows=91,ncols=180,crs='WGS84')
and I would like to get it into this format so I can stack it with well-formatted data
r=rast(ymin=-90,ymax=90,xmin=-180,xmax=180,nrows=90,ncols=180,crs='WGS84')
I have tried different approaches but in all cases the data gets shifted or modified and my data is very sensitive to the location. For example data that was 100km from the coast is now 50km from it.
I have tried different function from terra
: first rotate
and then resample
. I also tried to remove the bottom row as it contains NA values and then crop
. But in all cases I experience this geographic shift of data that makes the data not usable. I also tried resample with "mean" but I get the following error "Error: [resample] not a valid warp method". Why is resample blurring data to adjacent cells?
Is there a way to minimize and data shift and loss of information?
How about this?
Created on 2022-12-16 with reprex v2.0.2