Curve¶
petrophys.model.Curve
- class Curve(mnemonic, data, unit='', depth=None, depth_unit='ft', metadata=None)[source]¶
Well log curve with data, units, and metadata.
A Curve object represents a single well log measurement with depth-indexed values, unit information, and associated metadata.
- Parameters:
mnemonic (str) – Curve mnemonic (e.g., “GR”, “RHOB”, “NPHI”)
data (np.ndarray) – Curve data values
unit (str) – Unit of measurement
depth (np.ndarray, optional) – Depth values for the curve
depth_unit (str, optional) – Unit for depth values (default: “ft”)
metadata (CurveMetadata, optional) – Additional metadata
Examples
>>> import numpy as np >>> depth = np.arange(1000, 2000, 0.5) >>> gr = np.random.uniform(20, 100, len(depth)) >>> curve = Curve("GR", gr, "API", depth=depth) >>> print(curve) Curve(GR, unit=API, samples=2000)
Attributes
Return curve data as numpy array.
Return depth values.
The curve's description (
metadata.description).Alias for data property.
Methods
Clip values to specified range.
Create a deep copy of the curve.
Extract curve data within depth range.
Return summary statistics.
Fill NaN values with specified value.
Create Curve from pandas Series.
Interpolate NaN values between valid samples.
Set values to NaN where condition is True.
Return maximum value (excluding NaN).
Return mean value (excluding NaN).
Return median value (excluding NaN).
Return minimum value (excluding NaN).
Return count of NaN values.
Return percentile value (excluding NaN).
Return a copy with a new mnemonic.
Return a new curve with the samples selected by a slice, mask or index array.
Return standard deviation (excluding NaN).
Convert to pandas DataFrame with depth column.
Convert to pandas Series with depth as index.
Return count of non-NaN values.
- select(index)[source]¶
Return a new curve with the samples selected by a slice, mask or index array.
- classmethod from_series(series, unit='')[source]¶
Create Curve from pandas Series.
The series name is the mnemonic (
UNKNOWNwithout one), and an index other than the default 0, 1, 2, … becomes the depth.
- mean(axis=None, dtype=None, out=None, **kwargs)[source]¶
Return mean value (excluding NaN).
- Return type:
- std(axis=None, dtype=None, out=None, ddof=0, **kwargs)[source]¶
Return standard deviation (excluding NaN).
- Return type: