cdms2.axis

mapLinearExt(axis, bounds, interval, indicator='ccn', epsilon=None, stride=1, wrapped=0)[source]

Map coordinate interval to index interval, without wraparound. Interval has the form (x,y) where x and y are the endpoints in coordinate space. Indicator is a three-character string, where the first character is ‘c’ if the interval is closed on the left, ‘o’ if open, and the second character has the same meaning for the right-hand point. The third character indicates how the intersection of the interval and axis is treated:

‘n’ - the node is in the interval ‘b’ - the interval intersects the cell bounds ‘s’ - the cell bounds are a subset of the interval ‘e’ - same as ‘n’, plus an extra node on either side.

Returns
The corresponding index interval (i,j), where i<j, indicating the
half-open index interval [i,j), or None if the intersection is empty.