Skip to content

Index

subsurfaceio.interpolate

Interpolation API.

Interpolate a 1-D series onto new abscissas:

from subsurfaceio.interpolate import Interpolate

Interpolate(data=known, new=query).calculate()

Classes:

Name Description
Data

Interpolation sample data.

DataNew

Target x coordinate for interpolation.

Interpolate

1D interpolation from known samples to new x coordinates.

InterpolateMetadata

Interpolation method selection.

InterpolateResults

Interpolated (x, y) samples.

Data pydantic-model

Bases: BaseModel

Interpolation sample data.

Fields:

x pydantic-field

x: NullableFloat = None

y pydantic-field

y: NullableFloat = None

DataNew pydantic-model

Bases: BaseModel

Target x coordinate for interpolation.

Fields:

x pydantic-field

x: NullableFloat = None

Interpolate pydantic-model

Bases: Model

1D interpolation from known samples to new x coordinates.

References
  • 2020SciPy-NMeth

Fields:

data pydantic-field

data: list[Data]

metadata pydantic-field

metadata: InterpolateMetadata

new pydantic-field

new: list[DataNew]

results pydantic-field

results: InterpolateResults | None = None

calculate

calculate() -> Self

Run the calculation and store results.

Returns:

Type Description
Self

self with results populated.

get_results_figure

get_results_figure() -> plotly.graph_objects.Figure

Plot original and interpolated series.

Returns:

Type Description
Figure

Plotted Plotly figure.

Raises:

Type Description
ValueError

If results have not been calculated.

InterpolateMetadata pydantic-model

Bases: BaseModel

Interpolation method selection.

Fields:

  • kind (Literal['linear', 'nearest', 'nearest-up', 'zero', 'slinear', 'quadratic', 'cubic', 'previous', 'next'])

kind pydantic-field

kind: Literal[
    "linear",
    "nearest",
    "nearest-up",
    "zero",
    "slinear",
    "quadratic",
    "cubic",
    "previous",
    "next",
] = "linear"

InterpolateResults pydantic-model

Bases: BaseModel

Interpolated (x, y) samples.

Fields:

data pydantic-field

data: list[Data]