GrainSizeData¶
petrophys.interpretation.core_analysis.GrainSizeData
- class GrainSizeData(depth, d50, d13=None, d87=None, metadata=<factory>)[source]¶
Grain size distribution measurements along a core depth.
- Parameters:
depth (np.ndarray) – Measured depth (m or ft).
d50 (np.ndarray) – Median grain diameter P50 (µm).
d13 (np.ndarray, optional) – 13th percentile grain diameter (µm).
d87 (np.ndarray, optional) – 87th percentile grain diameter (µm).
metadata (dict) – Additional header information.
Examples
>>> gs = GrainSizeData.from_las("grain_size.las", d50_mnemonic="GS_P50") >>> cls = gs.wentworth() # per-sample class names >>> k = gs.kozeny_carman_perm(porosity=0.25) # mD estimate
Attributes
Methods
Return a new GrainSizeData filtered to [top, bottom].
Create GrainSizeData from a pandas DataFrame.
Load grain size data from a LAS file.
Estimate permeability using the Kozeny-Carman equation.
Convert d50 to phi units (φ = -log₂(d_mm)).
Estimate pore throat radius from median grain size.
Grain size skewness from percentiles.
Sorting as half the spread between the 13th and 87th percentiles, in phi.
Export to a pandas DataFrame.
Return the Wentworth class name for each depth sample.
- classmethod from_las(
- filepath,
- d50_mnemonic='GS_P50',
- d13_mnemonic='GS_P13',
- d87_mnemonic='GS_P87',
- null_value=-999.25,
Load grain size data from a LAS file.
Depth is read via
lasio’slas.indexproperty (always the first column, regardless of mnemonic name).
- classmethod from_dataframe(
- df,
- depth_col='DEPTH',
- d50_col='D50',
- d13_col=None,
- d87_col=None,
Create GrainSizeData from a pandas DataFrame.
- wentworth()[source]¶
Return the Wentworth class name for each depth sample.
- Return type:
np.ndarray of str
- sorting_coefficient()[source]¶
Sorting as half the spread between the 13th and 87th percentiles, in phi.
(phi13 - phi87) / 2. Folk and Ward’s (1957) inclusive graphic standard deviation needs phi5, phi16, phi84 and phi95, which these data do not carry; for a normal distribution in phi this spread is 1.126 standard deviations, so divide by 1.126 before comparing with Folk and Ward’s classes (sigma in phi): < 0.35 very well sorted, 0.35–0.50 well sorted, 0.50–0.71 moderately well sorted, 0.71–1.00 moderately sorted, 1.00–2.00 poorly sorted, 2.00–4.00 very poorly sorted, > 4.00 extremely poorly sorted.Requires d13 and d87. Returns NaN where either is missing, with a warning when neither is loaded: other percentiles (P10/P90, P20/P80) do not substitute in these formulas.
- Returns:
Sorting in phi units.
- Return type:
np.ndarray
- skewness()[source]¶
Grain size skewness from percentiles.
(phi13 + phi87 - 2 phi50) / (phi13 - phi87). Requires d13, d50 and d87; returns NaN, with a warning, when d13 or d87 is not loaded. Positive = fine-skewed (more fines), negative = coarse-skewed.- Return type:
- kozeny_carman_perm(porosity)[source]¶
Estimate permeability using the Kozeny-Carman equation.
\[k = \frac{d_{50}^2 \cdot \phi^3}{180 \cdot (1 - \phi)^2}\]for packed spheres (Carman, 1937), with k in µm² when d₅₀ is in µm. In mD, with 1 µm² = 1013.25 mD:
\[k = 5.63 \cdot \frac{d_{50}^2 \cdot \phi^3}{(1 - \phi)^2}\]- Parameters:
porosity (float or np.ndarray) – Porosity as a fraction (0–1). Can be a scalar or a depth array matching
self.depth.- Returns:
Estimated permeability (mD) for a clean pack of equal spheres; cementation, clay and poor sorting usually make real rock less permeable. NaN where porosity is outside (0, 1) or d50 is missing; a warning says which when no sample gives a value.
- Return type:
np.ndarray
Notes
Conversion factor: 1 µm² = 1013.25 mD, so 1013.25 / 180 = 5.63.
- pore_throat_radius()[source]¶
Estimate pore throat radius from median grain size.
Uses the rule of thumb r_pt ≈ d₅₀ / 10, one fifth of the grain radius, which lies between the throat radii of rhombohedral (0.155 R) and cubic (0.414 R) packings of equal spheres. It suits well-sorted, uncemented sands only; for cemented or poorly sorted material the actual r_pt will be significantly smaller.
- Returns:
Estimated pore throat radius (µm).
- Return type:
np.ndarray