CoreData¶
petrophys.model.CoreData
Also available as petrophys.interpretation.core_analysis.CoreData
- class CoreData(
- depth,
- porosity=None,
- permeability=None,
- grain_density=None,
- sw=None,
- so=None,
- lithology=None,
- metadata=<factory>,
Container for core laboratory measurements.
- Parameters:
depth (np.ndarray) – Measured depth of each core plug (same unit as well logs).
porosity (np.ndarray, optional) – Helium porosity (fraction, 0-1).
permeability (np.ndarray, optional) – Air/Klinkenberg permeability (mD).
grain_density (np.ndarray, optional) – Grain density from pycnometer (g/cm3).
sw (np.ndarray, optional) – Water saturation from Dean-Stark (fraction, 0-1).
so (np.ndarray, optional) – Oil saturation from Dean-Stark (fraction, 0-1).
lithology (np.ndarray, optional) – Lithology description per plug (string array).
metadata (dict) – Additional columns or information.
Examples
>>> core = CoreData.from_csv("core_data.csv", depth_col="DEPTH", ... porosity_col="CPOR", perm_col="CPERM", gd_col="CGD") >>> print(f"{core.n_plugs} plugs, depth {core.top:.1f}-{core.bottom:.1f}")
Attributes
Deepest core depth.
Number of core plugs.
Shallowest core depth.
Methods
Return a new CoreData filtered to a depth range.
Load CoreData from a CSV file.
Create CoreData from a pandas DataFrame.
Load CoreData from an Excel file.
Export core data to a pandas DataFrame.
- classmethod from_dataframe(
- df,
- depth_col='DEPTH',
- porosity_col='CPOR',
- perm_col='CPERM',
- gd_col='CGD',
- sw_col=None,
- so_col=None,
- lithology_col=None,
- porosity_unit=None,
- saturation_unit=None,
Create CoreData from a pandas DataFrame.
Porosity and saturations are stored as fractions (v/v). Without a stated unit, a column whose values are mostly above 1 with a median of at least 2 is read as percent and divided by 100, with a warning; values outside 0-1 after that are masked with a warning (
core_saturation_to_fraction()).- Parameters:
df (pd.DataFrame) – DataFrame with core measurements.
depth_col (str) – Column name for depth.
porosity_col (str, optional) – Column name for porosity (fraction).
perm_col (str, optional) – Column name for permeability (mD).
gd_col (str, optional) – Column name for grain density (g/cm3).
sw_col (str, optional) – Column name for water saturation.
so_col (str, optional) – Column name for oil saturation.
lithology_col (str, optional) – Column name for lithology.
porosity_unit (str, optional) –
"%"or"v/v"(also"pu","frac"…) to state the scale of the porosity or saturation columns instead of inferring it.saturation_unit (str, optional) –
"%"or"v/v"(also"pu","frac"…) to state the scale of the porosity or saturation columns instead of inferring it.
- Return type:
- to_dataframe()[source]¶
Export core data to a pandas DataFrame.
Per-plug
metadatacolumns (arrays with one value per plug, such as the extra columns kept byfrom_dataframe()) are exported after the named fields; other metadata is not.- Return type: