pynetdesign.modelling.utils.get_slice_coordinates#

pynetdesign.modelling.utils.get_slice_coordinates(grid_points, slice_dimension, slice_coordinate)[source]#

From the array of grid point coordinates of size (nx*ny*nz,3) retrieve coordinates of the slice plane at a given slice coordinate in a given slice dimension.

Parameters:
grid_pointsnumpy.ndarray

2D grid coordinates array

dimensionint

integer defining the desired slice dimension (0,1 or 2)

slice_coordinatenumpy.ndarray

coordinate of the slice to extract in the desired dimension

Returns:
plane_pointsnumpy.ndarray

2D slice plane coordinates array

indicesnumpy.ndarray

Indices of plane_points in grid_points

Raises:
ValueError

when slice_dimension is not 0, 1 or 2

RuntimeError

when slice can’t be extracted (slice coordinate does not coincide with the grid)