resqpy.grid_surface.find_intersections_of_trajectory_with_layer_interface(trajectory, grid, k0=0, ref_k_faces='top', heal_faults=True, quad_triangles=True)

Returns an array of column indices and an array of xyz of intersections of well trajectory with layer interface.

  • trajectory (well.Trajectory object; or list thereof) – the wellbore trajectory object(s) to find the intersections for; if a list of trajectories is provided then the return value is a corresponding list

  • grid (grid.Grid object) – the grid object from which a layer interface is to be converted to a surface

  • k0 (int) – the layer number (zero based) to be used

  • ref_k_faces (string) – either ‘top’ (the default) or ‘base’, indicating whether the top or the base interface of the layer is to be used

  • heal_faults (boolean, default True) – if True, faults will be ‘healed’ to give an untorn surface before looking for intersections; if False and the trajectory passes through a fault plane without intersecting the layer interface then no intersection will be identified; makes no difference if the grid is unfaulted

  • quad_triangles (boolean, optional, default True) – if True, 4 triangles are used to represent each cell k face, which gives a unique solution with a shared node of the 4 triangles at the mean point of the 4 corners of the face; if False, only 2 triangles are used, which gives a non-unique solution


(numpy int array of shape (N, 2), numpy float array of shape (N, 3)) – the first array is a list of (j0, i0) indices of columns containing an intersection and the second array is the corresponding list of (x, y, z) intersection points; if the trajectory argument is a list of trajectories, then a correponding list of numpy array pairs is returned


interseections are found based on straight line segments between the trajectory control points, this will result in errors where there is significant curvature between neighbouring control points; a given (j0, i0) column might appear more than once in the first returned array