Project

General

Profile

sellonlatbox removes first and last longitude

Added by Aurore Dupre almost 3 years ago

Hi all,

I have a nc file in which the grid is:

Grid coordinates :
1 : lonlat : points=1507311 (1521x991)
longitude : -5.2 to 10 by 0.01 degrees_east
latitude : 51.2 to 41.3 by -0.01 degrees_north

I want to extract a small grid with sellonlatbox : cdo -f nc -sellonlatbox,1.13,2.39,47.7,48.96 nc_ref.nc nc_cut.nc

Here is the grid of the extracted file:

Grid coordinates :
1 : lonlat : points=15875 (125x127)
longitude : 1.14 to 2.38 by 0.01 degrees_east
latitude : 48.96 to 47.7 by -0.009999987 degrees_north

The first and last longitude are missing..

NB: if I try to extract from 1.12 to 2.4, the resulting grid is 1.12 to 2.39

Many thanks in advance


Replies (2)

RE: sellonlatbox removes first and last longitude - Added by Karin Meier-Fleischer almost 3 years ago

Hi Aurore,

if this happens you have to choose a slightly smaller minimum and a slightly greater maximum longitude value. CDO selects the next grid cell in which the choosen value is inside.

-Karin

RE: sellonlatbox removes first and last longitude - Added by Aurore Dupre almost 3 years ago

Hi Karin,

Thanks a lot for your answer! It works perfectly when I add +/-1e-6.

Aurore

    (1-2/2)