RectGrid.stride

property RectGrid.stride

Step per axis between neighboring points of a uniform grid.

If the grid contains axes that are not uniform, stride has a NaN entry.

For degenerate (length 1) axes, stride has value 0.0.

Returns:
stridenumpy.array

Array of dtype float and length ndim.

Examples

>>> rg = uniform_grid([-1.5, -1], [-0.5, 3], (2, 3))
>>> rg.stride
array([ 1.,  2.])

NaN returned for non-uniform dimension:

>>> g = RectGrid([0, 1, 2], [0, 1, 4])
>>> g.stride
array([ 1.,  nan])

0.0 returned for degenerate dimension:

>>> g = RectGrid([0, 1, 2], [0])
>>> g.stride
array([ 1.,  0.])