Reproducible CIPW normative mineralogy for whole-rock geochemistry
Transform major-oxide analyses into auditable normative mineral assemblages, diagnostics and batch-ready tables from Python or the command line.
Important
A CIPW norm is an idealized calculation from whole-rock chemistry. It is not measured modal mineralogy and does not replace petrography, field relations or an appropriate classification diagram such as QAPF.
Major oxides + sample identifiers
│
▼
Schema validation and iron-speciation handling
│
▼
Dry normalization ──► sequential CIPW allocation
│
▼
Normative minerals + mass balance + saturation flags
│
▼
Python dictionary / pandas table / CSV workflow
| Area | Support |
|---|---|
| Calculation | Sequential CIPW normative mineral allocation |
| Iron | Total iron as FeOT or explicit FeO and Fe2O3 inputs |
| Diagnostics | Silica saturation, alumina state, mass-balance error and interpretive flags |
| Execution | Single-sample Python API, pandas batch processing and CLI workflows |
| Reproducibility | YAML configuration, schema inspection, templates and input validation |
| Integration | Reusable normative-feature engine for GeoNormML |
Core and accessory inputs include:
SiO2, TiO2, Al2O3, Fe2O3, FeO, FeOT, MnO, MgO, CaO,
Na2O, K2O, P2O5, ZrO2, Cr2O3, CO2, S, F, Cl and SO3.
Optional identifier columns include Sample_ID and Notes. Input chemistry
must use a consistent weight-percent basis and documented treatment of loss on
ignition, below-detection values and total iron.
python -m pip install geonormpygit clone https://github.com/jordan-zav/GeoNormPy.git
cd GeoNormPy
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -e .from geonormpy.norms.cipw import cipw
sample = {
"SiO2": 72.5,
"Al2O3": 13.5,
"FeOT": 2.5,
"MgO": 0.5,
"CaO": 1.8,
"Na2O": 3.4,
"K2O": 4.0,
}
result = cipw(sample)
print(result["minerals_wtpercent"])
print(result["flags"])geonormpy --help
geonormpy schema
geonormpy make-template
geonormpy make-config
geonormpy validate --input data/test_data.csv
geonormpy run --config config/workflow.yamlThe example batch launcher reads data/test_data.csv and writes
data/normative_results.csv:
python run_GeoNormPy.pysilica_saturationalumina_statemass_balance_errorinterpretive_flagcalc_error
Q, Cor, Or, Ab, An, Le, Ne, Kp, Ac, Di, Hd, Wo,
En, Fs, Fo, Fa, Mt, Hm, Ilm, Cm, Ru, Tn, Z, Ap,
Cc, Py, Fl, Hl, Th, ns and ks.
Downstream software should preserve both the mineral results and the diagnostic columns. Filtering only the successful rows without retaining the error reason breaks traceability.
- Normative phases are calculated end-members, not minerals observed in thin section.
- Iron-speciation assumptions can materially change normative mafic and oxide phases.
- Volatile, alteration and analytical-total problems must be reviewed before interpretation.
- TAS, QAPF, petrography and CIPW answer related but different classification questions.
- A successful mass balance does not prove that the input rock name is correct.
python -m pip install -e .
python -m pytest -qThe regression suite covers the CIPW engine, robustness cases, CLI behavior and configured workflows. See the complete method description and the audit record.
| Path | Contents |
|---|---|
geonormpy/norms |
CIPW and batch calculation engine |
geonormpy/core |
Chemistry constants, minerals and shared rules |
geonormpy/schema.py |
Supported input/output schema |
geonormpy/cli.py |
Command-line interface |
config |
Example YAML workflow configuration |
tests |
Numerical, robustness, CLI and workflow tests |
docs |
Method, theory and audit material |
Use the metadata in CITATION.cff when citing GeoNormPy in a thesis, article or technical report.
GeoNormPy is distributed under the GNU General Public License v3.0.
Jordan Zavaleta — GisGeo Dev
jordanzav@gisgeo.dev · gisgeo.dev