Rotating large netcdf files with multiple variables

58 Views Asked by At

I have 100 big nearly identical netcdf files. Each has 18 variables and ~22GB in size. The extents are not in the typical latlon rotation. The data in each file dates from 1850 to 2100.

I need to rotate the files to the normal latlon. I couldn't do this in R due to the file sizes (and number of variables), although I was able to rotate a single layer from one of the files.

This would seem like a job for CDO (or NCO) but the program could not read the files, which I suspect was due to the rotation because the extent (-1.40625, 358.5938, 89.25846, 89.25846) is unusual (see below). The same goes for NCO.

Suggestions for rotating the files in R, CDO, NCO or Python such that they can be read for further processing either in CDO or NCO would be appreciated.

>mynetcdf

class       : SpatRaster 
dimensions  : 64, 128, 602262  (nrow, ncol, nlyr)
resolution  : 2.8125, 2.789327  (x, y)
extent      : -1.40625, 358.5938, -89.25846, 89.25846  (xmin, xmax, ymin, ymax)
coord. ref. : lon/lat WGS 84 (CRS84) (OGC:CRS84) 
sources     : fwi_day_CanESM5_historical_r1i1p1f1_gn_full-outputs.nc:fwi  (60225 layers) 
              fwi_day_CanESM5_historical_r1i1p1f1_gn_full-outputs.nc:ffmc  (60225 layers) 
              fwi_day_CanESM5_historical_r1i1p1f1_gn_full-outputs.nc:dmc  (60225 layers) 
              ... and 15 more source(s)
varnames    : fwi 
              ffmc 
              dmc 
              ...
names       : fwi_1, fwi_2, fwi_3, fwi_4, fwi_5, fwi_6, ... 
unit        :     1,     1,     1,     1,     1,     1, ... ```


0

There are 0 best solutions below