Availability: ncks Short options: ‘-d dim,[min][,[max][,[stride]]]’ Long options: ‘--dimension dim,[min][,[max][,[stride]]]’, ‘--dmn dim,[min][,[max][,[stride]]]’ |
Assume the domain of the monotonically increasing longitude coordinate
lon
is 0 < lon < 360.
ncks will extract a hyperslab which crosses the Greenwich
meridian simply by specifying the westernmost longitude as min and
the easternmost longitude as max.
The following commands extract a hyperslab containing the Saharan desert:
ncks -d lon,340.,50. in.nc out.nc ncks -d lon,340.,50. -d lat,10.,35. in.nc out.nc
The first example selects data in the same longitude range as the Sahara.
The second example further constrains the data to having the same
latitude as the Sahara.
The coordinate lon
in the output-file, out.nc, will
no longer be monotonic!
The values of lon
will be, e.g., ‘340, 350, 0, 10, 20, 30,
40, 50’.
This can have serious implications should you run out.nc through
another operation which expects the lon
coordinate to be
monotonically increasing.
Fortunately, the chances of this happening are slim, since lon
has already been hyperslabbed, there should be no reason to hyperslab
lon
again.
Should you need to hyperslab lon
again, be sure to give
dimensional indices as the hyperslab arguments, rather than coordinate
values (see Hyperslabs).