FaciesResult

petrophys.interpretation.core_analysis.FaciesResult

class FaciesResult(
depth,
facies,
n_facies,
feature_names,
weights,
cluster_centers,
inertia=0.0,
)[source]

Result of a digital core facies classification.

Parameters:
  • depth (np.ndarray) – Depth of each sample.

  • facies (np.ndarray of int) – Facies class label per sample (1-based).

  • n_facies (int) – Number of distinct facies.

  • feature_names (list of str) – Names of the input features used for clustering.

  • weights (np.ndarray) – Feature weights used during clustering.

  • cluster_centers (np.ndarray) – Shape (n_facies, n_features) — cluster centroids in original (un-scaled) feature space.

  • inertia (float) – K-means inertia (within-cluster sum of squares).

Attributes

Methods

filter_by_depth

Return the samples within a depth interval.

proportions

Return the fractional occurrence (0–1) of each facies.

statistics

Compute P13, P50, P87 of each feature per facies class.

to_dataframe

Export depth + facies label to a DataFrame.

depth: ndarray
facies: ndarray
n_facies: int
feature_names: List[str]
weights: ndarray
cluster_centers: ndarray
inertia: float = 0.0
property n_samples: int
proportions()[source]

Return the fractional occurrence (0–1) of each facies.

Return type:

Dict[int, float]

statistics(data)[source]

Compute P13, P50, P87 of each feature per facies class.

Parameters:

data (dict) – Feature name → depth array (same length as self.depth).

Returns:

One row per facies (index facies) with count, proportion_pct and <feature>_P13, _P50, _P87 columns.

Return type:

pd.DataFrame

to_dataframe()[source]

Export depth + facies label to a DataFrame.

Return type:

DataFrame

filter_by_depth(top, bottom)[source]

Return the samples within a depth interval.

Parameters:
  • top (float) – Top and bottom of the interval, in the unit of depth; samples at the limits are kept.

  • bottom (float) – Top and bottom of the interval, in the unit of depth; samples at the limits are kept.

Returns:

Result holding the depths and facies labels inside the interval, with the same number of facies, features, weights, cluster centres and inertia.

Return type:

FaciesResult