resqpy.olio.simple_lines.nearest_rods

resqpy.olio.simple_lines.nearest_rods(line_list, projection, grid, axis, ref_slice0=0, plus_face=False)[source]

Finds rods nearest to each point on each line; returns list of lists of (k0, j0) or (k0, i0).

Parameters:
  • line_list (list of numpy arrays of floats) – set of poly-lines, the points of which are used to find the nearest rods in grid

  • projection (string) – ‘xz’ or ‘yz’

  • grid (grid.Grid object) – the grid whose cross section points are compared with the poly-line vertices

  • axis (string) – ‘I’ or ‘J’ being the axis removed during slicing

  • ref_slice0 (integer, default 0) – the reference slice in the grid to compare against the vertices; zero based

  • plus_face (boolean, default False) – which face of the reference slice to use

Returns:

a list of numpy arrays of pairs of integers, each being the (k, j) or (k, i) indices of the nearest rod to the corresponding vertex of the poly-line under projection; zero based indexing

Notes

this is a 2D search in the x, z or y, z plane; currently limited to unsplit grids without k gaps; poly-line x, y, z values must implicitly be in the same crs as the grid’s points data