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_coords1that are insidegrid_coords2.This function finds the indices of points in
grid_coords1that are also present ingrid_coords2.- Parameters:
- grid_coords1
numpy.ndarray A 2D array of shape
(n_grid1, 3)representing the points to check.- grid_coords2
numpy.ndarray A 2D array of shape
(n_grid2, 3)representing the reference points.
- grid_coords1
- Returns:
- indices
numpy.ndarray An array of indices corresponding to the points in
grid_coords1that are found ingrid_coords2.
- indices
- Raises:
- ValueError
If
grid_coords1orgrid_coords2does 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])