Project

General

Profile

sellonlatbox question

Added by Noelia Otero over 10 years ago

Hi everyone,

I used sellonlatbox to select differents regions, and I have a question (sorry if it's obvious, but I'm confused now).
If I select: cdo sellonlatbox,-20,40,70,30 ifile ofile, ofile contains then, negative longitude (from 20W-40E)
but if I select for instance: cdo sellonlatbox,-120,-60,60,10 ofile contains positive longitude : (240-300)..
(longitude in ifile are defined :0.0-360)

I wanted to know if I miss something ?

Many thanks in advance!

Cheers

Noelia


Replies (2)

RE: sellonlatbox question - Added by Ralf Mueller over 10 years ago

I cannot confirm this. Lets make a check

[ram@thingol:~/data/examples]cdo -f nc topo topo.nc                                                                                                                                                             [13:38:43|14-04-24]
cdo topo:  ( 0.00s )
[ram@thingol:~/data/examples]cdo griddes topo.nc                                                                                                                                                                [13:38:49|14-04-24]
#
# gridID 2
#
gridtype  = lonlat
gridsize  = 259200
xname     = lon
xlongname = longitude
xunits    = degrees_east
yname     = lat
ylongname = latitude
yunits    = degrees_north
xsize     = 720
ysize     = 360
xfirst    = -179.75
xinc      = 0.5
yfirst    = -89.75
yinc      = 0.5
cdo griddes: Processed 1 variable ( 0.00s )

topo.nc no has positive and negative lons. Let's see, what comes out of the sellonlatbox calls you mentioned
[ram@thingol:~/data/examples]cdo griddes -sellonlatbox,-20,40,70,30 topo.nc                                                                                                                                     [13:38:56|14-04-24]
cdo griddes: Started child process "sellonlatbox,-20,40,70,30 topo.nc (pipe1.1)".
#
# gridID 7
#
gridtype  = lonlat
gridsize  = 9600
xname     = lon
xlongname = longitude
xunits    = degrees_east
yname     = lat
ylongname = latitude
yunits    = degrees_north
xsize     = 120
ysize     = 80
xfirst    = -19.75
xinc      = 0.5
yfirst    = 30.25
yinc      = 0.5
cdo(2) sellonlatbox: Processed 259200 values from 1 variable over 1 timestep ( 0.00s )
cdo griddes: Processed 1 variable ( 0.00s )
[ram@thingol:~/data/examples]cdo griddes -sellonlatbox,-120,060,60,10 topo.nc                                                                                                                                   [13:39:32|14-04-24]
cdo griddes: Started child process "sellonlatbox,-120,60,60,10 topo.nc (pipe1.1)".
#
# gridID 7
#
gridtype  = lonlat
gridsize  = 36000
xname     = lon
xlongname = longitude
xunits    = degrees_east
yname     = lat
ylongname = latitude
yunits    = degrees_north
xsize     = 360
ysize     = 100
xfirst    = -119.75
xinc      = 0.5
yfirst    = 10.25
yinc      = 0.5
cdo(2) sellonlatbox: Processed 259200 values from 1 variable over 1 timestep ( 0.00s )
cdo griddes: Processed 1 variable ( 0.00s )

This down not show the behaviour you were describing. May be it only works with strictly positive lons:
[ram@thingol:~/data/examples]ncap2 -A -s 'lon=(lon+179.75)' topo.nc _t.nc                                                                                                                                       [13:43:24|14-04-24]
[ram@thingol:~/data/examples]ncap2 -A -s 'lat=(lat+89.75)' _t.nc __t.nc                                                                                                                                         [13:43:33|14-04-24]
[ram@thingol:~/data/examples]cdo griddes __t.nc                                                                                                                                                                 [13:48:02|14-04-24]
#
# gridID 2
#
gridtype  = lonlat
gridsize  = 259200
xname     = lon
xlongname = longitude
xunits    = degrees_east
yname     = lat
ylongname = latitude
yunits    = degrees_north
xsize     = 720
ysize     = 360
xfirst    = 0
xinc      = 0.5
yfirst    = 0
yinc      = 0.5
cdo griddes: Processed 1 variable ( 0.00s )

Now the results are
[ram@thingol:~/data/examples]cdo griddes -sellonlatbox,-20,40,70,30 __t.nc                                                                                                                                      [13:48:22|14-04-24]
cdo griddes: Started child process "sellonlatbox,-20,40,70,30 __t.nc (pipe1.1)".
#
# gridID 7
#
gridtype  = lonlat
gridsize  = 9801
xname     = lon
xlongname = longitude
xunits    = degrees_east
yname     = lat
ylongname = latitude
yunits    = degrees_north
xsize     = 121
ysize     = 81
xfirst    = -20
xinc      = 0.5
yfirst    = 30
yinc      = 0.5
cdo(2) sellonlatbox: Processed 259200 values from 1 variable over 1 timestep ( 0.00s )
cdo griddes: Processed 1 variable ( 0.00s )
[ram@thingol:~/data/examples]cdo griddes -sellonlatbox,-120,60,60,10 __t.nc                                                                                                                                     [13:48:54|14-04-24]
cdo griddes: Started child process "sellonlatbox,-120,60,60,10 __t.nc (pipe1.1)".
#
# gridID 7
#
gridtype  = lonlat
gridsize  = 36461
xname     = lon
xlongname = longitude
xunits    = degrees_east
yname     = lat
ylongname = latitude
yunits    = degrees_north
xsize     = 361
ysize     = 101
xfirst    = -120
xinc      = 0.5
yfirst    = 10
yinc      = 0.5
cdo(2) sellonlatbox: Processed 259200 values from 1 variable over 1 timestep ( 0.00s )
cdo griddes: Processed 1 variable ( 0.00s )


Looks like what you expected, cdo-1.6.3 was used
    (1-2/2)