iwopy.utils.RegularDiscretizationGrid.gp2i(gp, allow_outer=True, error=True)[source]

Get grid index of a grid point

Parameters

gp: numpy.ndarray

The point, shape: (n_dims,)

allow_outer: bool

Allow outermost point indices, else reduce those to lower-left cell corner

error: bool

Flag for throwing error if off-grid, else return None in that case

Returns

inds: numpy.ndarray

The lower-left grid corner point indices, shape: (n_dims,)