cigvis.utils.surfaceutils module#

utils to process surface, such as create triangular mesh

cigvis.utils.surfaceutils.arbitray_line(data, points, di: float = 1)#

data : SegyNP or np.ndarray points : the points to interpolate a path di : step

cigvis.utils.surfaceutils.extract_data(data, p)#

Parameters#

segy: str

segyfile

pArrayLike

shape is (N, 2)

cigvis.utils.surfaceutils.fill_grid(points: ndarray, shape: List | Tuple, interp: bool = True, method: str = 'cubic', fill: float = -1) ndarray#

fill points in a grid in shape. If interp, interpolation, this function doesn’t extrapolate, so we fill the edge as fill.

Parameters#

pointsarray-like

shape as (N, 3), N points, each row means (x, y, z) coordinate

shapeList or Tuple

[n1, n2], the grid shape, points will be filled into a n1*n2 grid

interpbool

if True, will interpolate the grid from points, but not extrapolate, this means some edge points will be fill

methodstr

interpolation method

fillfloat

the points can not be interpolated will be filled as fill, default is -1

cigvis.utils.surfaceutils.interp_arb(p: ndarray, d: ndarray) ndarray#

Interpolates a 1d series in 3d space by linear interpolation.

Parameters#

pArrayLike

(N, 2), each row is [x, y], normalized, i.e., 0 <= x, y <= 1

dArrayLike

shape is (N, 4, n3)

cigvis.utils.surfaceutils.interp_linefirst_impl(volume: ndarray, surf: ndarray, order: int) ndarray#

interp value of linefirst volume in surf positions

Parameters#

volumearray-like

3D array, shape as (ni, nx, nt)

surfarray-like

2D array, shape as (ni, nx), each point means z pos

Returns#

valuearray-like

2D array, shape as (ni, nx), each point means value in z pos

cigvis.utils.surfaceutils.interp_surf(volume: ndarray, surf: ndarray, order: int = 1) ndarray#

interp value of volume in surf positions

Parameters#

volumearray-like

3D array

surfarray-like

2D array, each point means z/nt pos

orderint

interpolate method, 0 for nearest, 1 for linear

Returns#

valuearray-like

2D array, each point means value in z/nt pos

cigvis.utils.surfaceutils.interp_timefirst_impl(volume: ndarray, surf: ndarray, order: int) ndarray#

interp value of timefirst volume in surf positions

Parameters#

volumearray-like

3D array, shape as (nt, nx, ni)

surfarray-like

2D array, shape as (nx, ni), each point means z/nt pos

Returns#

valuearray-like

2D array, shape as (nx, ni), each point means value in z/nt pos

cigvis.utils.surfaceutils.interpolate_path(points, di=1)#

Interpolates a path from the given points with a given step size.

cigvis.utils.surfaceutils.preproc_surf_array2(surf, volume=None, value_type='depth')#

surf shape as (n1, n2)

cigvis.utils.surfaceutils.preproc_surf_array3(surf, value_type='depth')#

surf shape as (n1, n2, 2) or (n1, n2, 4) or (n1, n2, 5)

cigvis.utils.surfaceutils.preproc_surf_pos(surf, shape, volume=None, value_type='depth', interp=True, method='cubic', fill=-1)#

surf shape as (N, 3) or (N, 4) or (N, 6) or (N, 7)