XRFData¶
petrophys.interpretation.geochemistry.XRFData
- class XRFData(depth, elements, units=<factory>, errors=<factory>, metadata=<factory>)[source]¶
XRF geochemistry measurements along a core depth.
- Parameters:
depth (np.ndarray) – Measured depth of each sample (m or ft).
elements (dict) – Mapping of element symbol → concentration array (% or ppm).
units (dict) – Mapping of element symbol → unit string (e.g. “%”, “ppm”).
errors (dict, optional) – Mapping of element symbol → measurement error array.
metadata (dict) – Additional header information from the LAS file.
Examples
>>> xrf = XRFData.from_las("core_xrf.las") >>> ratios = xrf.elemental_ratios() >>> proxies = xrf.mineral_proxies()
Attributes
Deepest depth.
List of available element names.
Number of depth samples.
Shallowest depth.
Methods
Compute standard geochemical ratios used in mineral discrimination.
Return a new XRFData filtered to [top, bottom].
Create XRFData from a pandas DataFrame.
Load XRF data from a LAS file.
Return concentration array for an element, or None if not present.
Derive normalized mineral proxy indices (0–1) from elemental data.
Export to a pandas DataFrame with depth + all elements.
- classmethod from_las(filepath, error_suffix='_ERR', null_value=-999.25)[source]¶
Load XRF data from a LAS file.
Depth is read via
lasio’slas.indexproperty (always the first column, regardless of mnemonic name). Element curves are any curve whose mnemonic does not end witherror_suffix.
- classmethod from_dataframe(
- df,
- depth_col='DEPTH',
- element_cols=None,
- error_cols=None,
- unit_map=None,
- null_value=-999.25,
Create XRFData from a pandas DataFrame.
- Parameters:
df (pd.DataFrame)
depth_col (str)
element_cols (list, optional) – Columns to treat as element concentrations. Defaults to all numeric columns except depth_col.
error_cols (dict, optional) – Mapping of element name → error column name.
unit_map (dict, optional) – Mapping of element name → unit string.
null_value (float) – Value to replace with NaN (default: -999.25).
- Return type:
- get(element)[source]¶
Return concentration array for an element, or None if not present.
Lookup is case-insensitive so both chemical-symbol keys (“Si”) and upper-cased LAS mnemonics (“SI”) resolve to the same element.
- elemental_ratios()[source]¶
Compute standard geochemical ratios used in mineral discrimination.
- Returns:
Ratio name → array. Every ratio is returned; it is all NaN when either element is absent.
- Return type:
Notes
Ratios and their petrophysical meaning:
Ratio
Interpretation
Si_Al
Quartz/clay ratio — high = clean sand
Ca_Al
Carbonate index — high = limestone/dolomite
Fe_Al
Iron enrichment — pyrite, siderite, chlorite
K_Al
Illite/feldspar proxy
Mg_Ca
Dolomite vs calcite — high = dolomite
Mg_Al
Chlorite proxy
S_Fe
Pyrite indicator — FeS₂ has S/Fe ≈ 1.15 by weight
Rb_K
Rb substitutes for K in illite, micas and K-feldspar
Mn_Fe
Mn enrichment relative to Fe (carbonates, redox)
Ca_Ca_Mg
Calcite fraction in carbonate (Ca/(Ca+Mg))
Al_Al_Si
Clay fraction (Al/(Al+Si))
- mineral_proxies()[source]¶
Derive normalized mineral proxy indices (0–1) from elemental data.
These are quick lithology discriminators, not quantitative volumes. Use the multi-mineral solver for quantitative mineral fractions.
- Returns:
Proxy name → array (0-1 scale where possible).
- Return type: