Project

General

Profile

setgrid produces non-unique lat values

Added by Andreas Hilboll over 11 years ago

Hi,

I have a .nc file with the following grid:

$ cdo griddes processed_europe.nc 
#
# gridID 25
#
gridtype  = lonlat
gridsize  = 4060
xname     = lon
xlongname = longitude in rotated pole grid
xunits    = degrees_east
yname     = lat
ylongname = latitude in rotated pole grid
yunits    = degrees_north
xsize     = 70
ysize     = 58
xfirst    = -16.75
xinc      = 0.5
yfirst    = -14
yinc      = 0.5

Actually, the coordinate system is in a "rotated pole" grid, so I want to add this information using the setgrid operator:

$ cat griddef_src_europe.txt 
gridtype  = lonlat
gridsize  = 4060
xsize     = 70
ysize     = 58
xnpole    = -167.5
ynpole    = 43.5
xfirst    = -16.75
xinc      = 0.5
yfirst    = -14.0
yinc      = 0.5
$ cdo setgrid,griddef_src_europe.txt processed_europe.nc processed_corrgrid_europe.nc 
cdo setgrid: Processed 125860 values from 1 variable over 31 timesteps ( 0.01s )

However, the new file has a strange grid with multiple non-unique lat values:

$ cdo griddes processed_corrgrid_europe.nc 
#
# gridID 15
#
gridtype  = lonlat
gridsize  = 4060
xname     = lon
xlongname = longitude
xunits    = degrees_east
yname     = lat
ylongname = latitude
yunits    = degrees_north
xsize     = 70
ysize     = 58
xnpole    = -167.5
ynpole    = 43.5
xfirst    = -16.75
xinc      = 0.242754
yvals     = -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 
            -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 
            -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 -14 
            -14 -14 -14 -14

Any help is greatly appreciated!

Cheers, Andreas.


Replies (2)

RE: setgrid produces non-unique lat values - Added by Uwe Schulzweida over 11 years ago

Hi Andreas,

Thanks for the information. This problem is already fixed in the new release (see Bug #2962). There was a bug in reading user defined lon/lat grids.

Cheers,
Uwe

    (1-2/2)