pynetdesign.modelling.utils.find_indices_of_points#

pynetdesign.modelling.utils.find_indices_of_points(grid_coords1, grid_coords2)[source]#

Find indices of points in grid_coords1 that are inside grid_coords2.

This function finds the indices of points in grid_coords1 that are also present in grid_coords2.

Parameters:
grid_coords1numpy.ndarray

A 2D array of shape (n_grid1, 3) representing the points to check.

grid_coords2numpy.ndarray

A 2D array of shape (n_grid2, 3) representing the reference points.

Returns:
indicesnumpy.ndarray

An array of indices corresponding to the points in grid_coords1 that are found in grid_coords2.

Raises:
ValueError

If grid_coords1 or grid_coords2 does not have the required shape of (n, 3).

Examples

>>> grid_coords1 = np.array([[1, 2, 3], [4, 5, 6], [10, 11, 12]])
>>> grid_coords2 = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
>>> find_indices_of_points(grid_coords1, grid_coords2)
array([0, 1])