Project

General

Profile

Remap nc file (from coarse to fine) for a specific grid coordinate values without a template file

Added by Abinesh Ganapathy 7 days ago

Hello,

I have a global sea surface temperature file with a 2-degree resolution, and I need to convert it to a 1-degree resolution grid. Specifically, I want the output file's grid to be centered on whole integer values (e.g., 89°, 88°, ..., -88°, -89°) instead of decimal values (e.g., 89.5°, 88.5°, ..., -88.5°, -89.5°). The input file has grid coordinates as follows: latitudes (88, 86, ..., -86, -88) and longitudes (0, 2, ..., 358).

When I use the command:
cdo remapbil,r360x180 infile.nc outfile.nc
I receive output files with decimal-based grid centers. I would appreciate your assistance in resolving this issue without using a template file.

Further I would really appreciate for any suggestion on remap method. My requirement is simple, I just want to fill the finer grid with the value from the coarse grid. Lets say in my case each coarse grid will have four fine grid inside them. I just want all the four fine grids to have the value same as coarser one. When I dig this forum a bit I found this discussion https://code.mpimet.mpg.de/boards/1/topics/11189. It seems like remapnn might be a good fit for my case, but I would appreciate your thoughts or any other recommendations.

Thanks,


Replies (2)

RE: Remap nc file (from coarse to fine) for a specific grid coordinate values without a template file - Added by Karin Meier-Fleischer 6 days ago

You can use the remapnn operator to remap the data to the higher resolution using a grid descriptor file, e.g.

gridfile.txt

gridtype  = lonlat
gridsize  = 63720
xsize     = 360
ysize     = 177
xname     = lon
xlongname = "longitude" 
xunits    = "degrees_east" 
yname     = lat
ylongname = "latitude" 
yunits    = "degrees_north" 
xfirst    = 0
xinc      = 1
yfirst    = -88
yinc      = 1
cdo -remapnn,gridfile.txt ersst.v5.194901.nc outfile.nc
    (1-2/2)