Project

General

Profile

Interpolate Coarse Grid to Match Fine Grid

Added by Aaron Perry almost 5 years ago

I am looking to interpolate a coarse grid to match the spatial resolution of a finer grid.

Both files are in GRIB2 format.

Fine Grid Dimensions:
* griddef=1:0:(2145 x 1377):grid_template=30:winds(grid): Lambert Conformal: (2145 x 1377) input WE:SN output WE:SN res 56 Lat1 20.191999 Lon1 238.445999 LoV 265.000000 LatD 25.000000 Latin1 25.000000 Latin2 25.000000 LatSP -90.000000 LonSP 0.000000
dtype grib2
pdef 2145 1377 lccr 20.191999 -121.554001 1 1 25.000000 25.000000 -95 2539.703000 2539.703000
xdef 2814 linear -130.103387 0.0246001009814572
ydef 1413 linear 20.196426 0.0230882090909091

x=0.0246001009814572, y=0.0230882090909091

I am unsure as to how I should set up a target grid description file for remapbil:

Grid Descript. File
cat > mygrid.txt << EOF
gridtype = lambert
xsize = 2145
ysize = 1377
xfirst = -130.103387
xinc = 0.0246001009814572
yfirst = 20.196426
yinc = 0.0230882090909091
EOF

CDO Code
cdo remapbil,mygrid.txt coarse_grid.grib2 fine_grid.grib2

Is this correct?


Replies (2)

RE: Interpolate Coarse Grid to Match Fine Grid - Added by Karin Meier-Fleischer almost 5 years ago

Hi Aaron,

your finer grid is a Lambert Conformal projection which is a curvilinear grid and xdef and ydef are not enough information for CDO, you have to set xvals and yvals, too. The easiest way is to use an existing file and use it directly to remap to the finer grid.

For example: a file containing the fine grid is called file_containing_fine_grid.grb2

cdo remapbil,file_containing_fine_grid.grb2 coarse_grid.grb2 fine_grid.grb2

Or when you want the way above save the grid description of the existing 'file_containing_fine_grid.grb2' to 'mygrid.txt' and use the CDO operator griddes.

cdo griddes file_containing_fine_grid.grb2 > mygrid.txt

-Karin

RE: Interpolate Coarse Grid to Match Fine Grid - Added by Ralf Mueller almost 5 years ago

hi Aaron!

your griddes files is not sufficient. Please have a look at the end of this paragraph.

you can always check these files with the -topo operators. without any parameter, -topo results in a half-degree lonlat topography, but you can use any griddes file instead to interpolate it to this target grid

 cdo -topo,mygrid.txt t.grb

hth
ralf

    (1-2/2)