theophilusx.netcdf.ranges

Manipulate ucar.ma2.Range objects.

-range->map

(-range->map range)

Converts a Netcdf Range object into a map with the following keys

Key Description
:name For named ranges, the name of the range. Nil for unnamed
ranges.
:first Index of first element in range.
:last Index of last element in the range.
:length Total length of the range.
:stride Array stride (step) size
:obj Contains the original Java Range object

-range-first

(-range-first range)

Return index of first element in the range.

-range-last

(-range-last range)

Returns index of last element in the range.

-range-length

(-range-length range)

Returns length of the range.

-range-name

(-range-name range)

Returns the name of a range for named ranges. Un-named ranges return nil.

-range-stride

(-range-stride range)

Returns stride (step size) of the range.

-ranges->vector

(-ranges->vector range-list)

Takes a list of Range objects and converts them to a vector of range maps

make-named-range

(make-named-range name start end)(make-named-range name start end stride)

Create a named Range object. Returns a range map with the Range object in the :obj key.

make-range

(make-range len)(make-range start end)(make-range start end stride)

Creates a new Range object. Returns a range map with the Range object in the :obj key of the map.

range->string

(range->string r-map)(range->string r-map indent)

Converts a range map to a string suitable for display.