Skip to content

StratInterpolator API Reference

geoloop.geoloopcore.strat_interpolator.StratInterpolator

class to manage interpolation of soil properties to averaged segment properties.

__init__

__init__(
    zcoord: ArrayLike,
    zval: ArrayLike,
    nz: int = 10000,
    stepvalue: bool = True,
) -> None

Parameters:

Name Type Description Default
zcoord array_like

Depth coordinates (m) defining the property profile.

required
zval array_like

Property values corresponding to zcoord.

required
nz int

Number of points for the internal fine-resolution discretization.

10000
stepvalue bool

If True: Interpret zval as piecewise-constant over intervals (stepwise profile). If False: Use linear interpolation between points.

True

init_indices

init_indices() -> None

For the high resolution array self.zp get indices on the courser intervalled zcoord array. The indices are determined by searchsorted of np, giving the lower index when on interval zlith[0] to zlith[1]. This is only used if stepvalue=True.

interp

interp(zstart: ndarray, zend: ndarray) -> np.ndarray

Interpolate for zstart, zend arrays of the segments, the average value of zval. Compute average property value for each depth segment.

Parameters:

Name Type Description Default
zstart ndarray

Segment start depths (m).

required
zend ndarray

Segment end depths (m).

required

Returns:

Type Description
ndarray

Average property value per segment.

interp_plot

interp_plot(zstart: ndarray, zend: ndarray) -> np.ndarray

Generate a high-resolution vector of interpolated property values.

Parameters:

Name Type Description Default
zstart ndarray

Segment start depths (m).

required
zend ndarray

Segment end depths (m).

required

Returns:

Type Description
ndarray

Interpolated property values along internal grid zp.