class iwopy.utils.RegularDiscretizationGrid[source]

A lightweight regular grid in n dimensions, without points storage.

Attributes

origin: numpy.ndarray

The origin point, shape: (n_dims,)

deltas: numpy.ndarray

The step sizes, shape: (n_dims,)

n_steps: numpy.ndarray

The number of steps, shape: (n_dims,)

interpolation: str

The interpolation method: None, nearest, linear

tol: numpy.ndarray

The tolerances for grid bounds, shape: (n_dims,), or None

digits: int

The grid point precision

Public members

INT_INF = -999999
RegularDiscretizationGrid(origin, deltas, n_steps, ...)[source]

Constructor

property n_points

The number of points in each dimension

property n_dims

The number of dimensions

property p_min

The minimal grid point values

property p_max

The maximal grid point values

print_info(spaces=0)[source]

Prints basic information

is_gridi(inds)[source]

Checks if grid indices are valid

i2gp(inds, error=True)[source]

Translates grid point indices to grid point.

find_grid_inds(inds)[source]

Finds indices that are on grid

inds2gpts(inds)[source]

Translates grid point indices to grid points.

apply_tol(p)[source]

Get tolerance corrected point

apply_tols(pts)[source]

Get tolerance corrected points

is_gridpoint(p, allow_outer=True, ret_inds=False)[source]

Checks if a point is on grid.

find_gridpoints(pts, allow_outer=True, ret_inds=False)[source]

Finds points that are on grid.

all_gridpoints(pts, allow_outer=True)[source]

Checks if all points are on grid.

in_grid(p)[source]

Checks if a point is located within the grid.

find_ingrid(pts)[source]

Finds points that are on grid.

gp2i(gp, allow_outer=True, error=True)[source]

Get grid index of a grid point

gpts2inds(gpts, allow_outer=True, error=True)[source]

Get grid indices of grid points.

get_corner(p, allow_outer=True)[source]

Get the lower-left grid corner of a point.

get_corners(pts, allow_outer=True)[source]

Get the lower-left grid corners of points.

get_cell(p)[source]

Get the grid cell that contains a point.

get_cells(pts)[source]

Get the grid cells that contain the given points, one cell per point.

interpolation_coeffs_point(p)[source]

Get the interpolation coefficients for a point.

interpolation_coeffs_points(pts, ret_pmap=False)[source]

Get the interpolation coefficients for a set of points.

deriv_coeffs_gridpoints(inds, var, order=2, orderb=1)[source]

Calculates the derivative coefficients at grid points.

deriv_coeffs(pts, var, order=2, orderb=1)[source]

Calculates the derivative coefficients at points.

grad_coeffs_gridpoints(inds, vars, order=2, orderb=1)[source]

Calculates the gradient coefficients at grid points.

grad_coeffs(pts, vars, order=2, orderb=1)[source]

Calculates the gradient coefficients at grid points.