Question about sellonlatbox on rotated grib
Added by Umberto Pellegrini almost 10 years ago
Hi all!
My first newbie question on CDO.
I'm use sellonlatbox on rotated grib from LAM.
All goes ok, but something strange in xinc and yinc of cropped grib.
The griddes of original grib (test.grib) is:
# gridID 1 # gridtype = lonlat gridsize = 92961 xname = rlon xlongname = longitude in rotated pole grid xunits = degrees yname = rlat ylongname = latitude in rotated pole grid yunits = degrees xsize = 297 ysize = 313 xnpole = -170 ynpole = 32.5 xfirst = -8.5 xinc = 0.0625 yfirst = -25 yinc = 0.0625
The cropping with CDO:
cdo sellonlatbox,-3,3.26,-8,-14.25 test.grib test_crop.grib
This is the griddes of new grib test_crop.grib:
# gridID 1 # gridtype = lonlat gridsize = 10201 xname = rlon xlongname = longitude in rotated pole grid xunits = degrees yname = rlat ylongname = latitude in rotated pole grid yunits = degrees xsize = 101 ysize = 101 xnpole = -170 ynpole = 32.5 xfirst = -3 xinc = 0.0625 yfirst = -14.25 yinc = 0.0625
But if I use, for example, grib_ls from ECMWF, or wgrib, to analyze the new file, the xinc and yinc is not 0.0625 but 0.063:
grib_ls -p jDirectionIncrementInDegrees,iDirectionIncrementInDegrees test_crop.grib
jDirectionIncrementInDegrees iDirectionIncrementInDegrees 0.063 0.063
and in the original one:
grib_ls -p jDirectionIncrementInDegrees,iDirectionIncrementInDegrees test.grib
jDirectionIncrementInDegrees iDirectionIncrementInDegrees 0.0625 0.0625
Where I'm wrong?
Many thanks for any response!
:-)
Umberto
Replies (3)
RE: Question about sellonlatbox on rotated grib - Added by Brendan DeTracey almost 10 years ago
I believe Grib 1 only has millidegree resolution for lat and lon, so I am perplexed how your initial grib 1 file could have otherwise. Convert your initial file to grib 2 and then crop.
$ cdo -f grb2 copy test.grib test.grib2 cdo copy: Processed 92961 values from 1 variable over 1 timestep ( 0.06s ) $ cdo sellonlatbox,-3,3.26,-8,-14.25 test.grib2 test_crop.grib2 cdo sellonlatbox: Processed 92961 values from 1 variable over 1 timestep ( 0.15s ) $ cdo griddes test_crop.grib2 # # gridID 1 # gridtype = lonlat gridsize = 10201 xname = rlon xlongname = longitude in rotated pole grid xunits = degrees yname = rlat ylongname = latitude in rotated pole grid yunits = degrees xsize = 101 ysize = 101 xnpole = -170 ynpole = 32.5 xfirst = -3 xinc = 0.0625 yfirst = -14.25 yinc = 0.0625 cdo griddes: Processed 1 variable ( 0.16s )
RE: Question about sellonlatbox on rotated grib - Added by Brendan DeTracey almost 10 years ago
$ /usr/local/grib_api/bin/grib_ls -p jDirectionIncrementInDegrees,iDirectionIncrementInDegrees test_crop.grib2 test_crop.grib2 jDirectionIncrementInDegrees iDirectionIncrementInDegrees 0.0625 0.0625 1 of 1 grib messages in test_crop.grib2 1 of 1 total grib messages in 1 files
RE: Question about sellonlatbox on rotated grib - Added by Umberto Pellegrini almost 10 years ago
Many thanks Brendan for your quick and clear reply! :-)
I did not know this detail about grib1 resolution: I will investigate how those grib files are generated.
Byez!
Umberto