rgdal-dev / rasterwise

Hard-won lessons! Don't lose 'em!
4 stars 0 forks source link

sea ice output on a basic grid but stored with lonlat arrays .... #20

Open mdsumner opened 8 months ago

mdsumner commented 8 months ago

The rast object doesn’t have a coord.ref, netcdf is pretty dumb like that.

These people take perfectly good information and absolutely sandblast it out of existence, and xarray has elevated the practice to world-leading expertise …. It’s so dumb.

Sigh, I don’t know how to to really advise you how to figure out how to fix this, but this fixes (it’s the same grid as the NSIDC 25km sea ice):

r <- flip(rast("CS2WFA_25km_201007.nc"), "vertical")
set.ext(r, ext(-3950000, 3950000, -3950000, 4350000))
set.crs(r, "EPSG:3031")
targetgrid <- rast(ext(-180, 180, -90, -50), res = c(0.25, 0.25), crs = "EPSG:4326")
plot(project(r, targetgrid, by_util = TRUE))

CS2WFA_25km_201007.zip