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_points
numpy.ndarray 2D grid coordinates array
- dimension
int integer defining the desired slice dimension (0,1 or 2)
- slice_coordinate
numpy.ndarray coordinate of the slice to extract in the desired dimension
- grid_points
- Returns:
- plane_points
numpy.ndarray 2D slice plane coordinates array
- indices
numpy.ndarray Indices of plane_points in grid_points
- plane_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)