DigitalCoreFacies¶
petrophys.interpretation.core_analysis.DigitalCoreFacies
- class DigitalCoreFacies(n_facies=12, n_init=20, max_iter=300, random_state=42)[source]¶
K-means facies classifier for multi-parameter core data.
Combines mechanical, geochemical, and textural measurements into discrete facies classes using standardized, weighted features.
- Parameters:
Examples
>>> clf = DigitalCoreFacies(n_facies=12) >>> result = clf.fit( ... depth=depth, ... data={ ... "D50_um": grain_size_d50, ... "UCS_MPa": ucs, ... "Al_pct": xrf.get("Al"), ... "Ca_pct": xrf.get("Ca"), ... }, ... weights={"D50_um": 4, "Al_pct": 2}, # rest default to 1 ... ) >>> stats = result.statistics(data)
Methods
Fit K-means on depth-aligned core measurements and return facies labels.
Load a pre-computed facies log from a LAS file.
Assign facies labels to new samples using the fitted model.
- fit(depth, data, weights=None)[source]¶
Fit K-means on depth-aligned core measurements and return facies labels.
Samples where any feature is NaN are excluded from fitting and assigned facies label 0 (unknown) in the output.
- Parameters:
depth (np.ndarray) – Depth array (same length as all arrays in
data).data (dict) – Feature name → depth-aligned array. All arrays must have the same length as
depth.weights (dict, optional) – Feature name → relative weight (positive float). Features not listed default to weight 1. Weights are applied by scaling each feature’s values by sqrt(weight) before clustering, so a weight of 4 gives a feature twice the influence of weight 1.
- Return type:
- classmethod from_las(
- filepath,
- facies_mnemonic='FACIES',
- null_value=-999.25,
- **kwargs,
Load a pre-computed facies log from a LAS file.
Depth is read via
lasio’slas.indexproperty. Use this when the facies were computed externally (e.g. by EpsLog) and you want to load them for analysis or plotting.- Returns:
A minimal FaciesResult with depth and facies arrays.
- Return type:
- Parameters: