cdms2.avariable:AbstractVariable

AbstractVariable.getRegion(*specs, **keys)[source]

Read a region of data. A region is an n-dimensional rectangular region specified in coordinate space.

Parameters
sliceis an argument list, each item of which has one of the following forms:
  • x, where x is a scalar
    • Map the scalar to the index of the closest coordinate value.

  • (x, y)
    • Map the half-open coordinate interval [x,y) to index interval.

  • (x, y, ‘cc’)
    • Map the closed interval [x,y] to index interval. Other options are ‘oo’ (open), ‘oc’ (open on the left), and ‘co’ (open on the right, the default).

  • (x, y, ‘co’, cycle)
    • Map the coordinate interval with wraparound. If no cycle is specified, wraparound will occur iff axis.isCircular() is true.

EllipsisRepresents the full range of all dimensions bracketed by non-Ellipsis items.
None, colonRepresents the full range of one dimension.
Notes
Only one dimension may be wrapped.
Example
Suppose the variable domain is `(time, level, lat, lon)`. Then
>>> getRegion((10, 20), 850, Ellipsis,(-180, 180))
retrieves :
  • all times t such that 10.<=t<20.

  • level 850.

  • all values of all dimensions between level and lon (namely, lat).

  • longitudes x such that -180<=x<180. This will be wrapped unless lon.topology==’linear’.