target grid for regridding curvilinear netcdf
Added by Najeen Rula over 1 year ago
I have a curvilinear grid file. I am still learning how to do regridding to a rectilinear grid.
Can someone please help? I don't quite know yet how to specify parameters in the grid description file.
I don't need to change the resolution. I don't have another file that can serve as a template.
Thank you very much.
Replies (3)
RE: target grid for regridding curvilinear netcdf - Added by Karin Meier-Fleischer over 1 year ago
You can use the output of 'cdo griddes mean.nc' as base to generate the grid description file like the following one.
gridtype = lonlat gridsize = 79695 xsize = 315 ysize = 253 xname = longitude xlongname = "Longitude" xunits = "degrees_east" yname = latitude ylongname = "Latitude" yunits = "degrees_north" xfirst = 150.2223 xinc = 0.0112343 yfirst = -25.1688 yinc = 0.011875
It has the same number of grid cells in total and spans the given region:
geospatial_lat_min = -25.168796 geospatial_lat_max = -22.15316 geospatial_lon_min = 150.22234 geospatial_lon_max = 153.761098
The grid description file can be used to remap mean.nc to regular lonlat:
cdo -remapbil,gridfile.txt mean.nc outfile.nc
RE: target grid for regridding curvilinear netcdf - Added by Najeen Rula over 1 year ago
Thank you Karin. Although I have one more question, which is likely basic but I can't get a grasp on.
How do you define xinc or yinc? These parameters seem to be related to resolution. How do I obtain or define this?
I simply want to retain the original resolution.
RE: target grid for regridding curvilinear netcdf - Added by Karin Meier-Fleischer over 1 year ago
The resolution of a curvilinear grid is not the same as a regular grid with same number of grid cells. In the example above the number of grid cells are the same but for the regular grid the lat/lon increments xinc/yinc were calculated with
xinc = (geospatial_lon_max - geospatial_lon_min)/xsize yinc = (geospatial_lat_max - geospatial_lat_min)/ysize