API reference¶
The public API is re-exported from the top-level package, so the common calls are one import away:
import mescla as am
am.EMMA, am.emma # how many end-members, which species
am.mixing_ratios, am.mix_ml, am.MixML # in what proportions
am.WaterChemistry, am.EndMembers # the containers
Everything below is importable from its own module too, which is what the reference pages document.
Containers¶
Core data containers shared across Mescla. |
Preparing the data¶
Unit conversion, charge balance, standardisation, and the tools for ragged datasets.
Unit conversion for major-ion chemistry. |
|
Quality checks to run before any mixing analysis. |
|
Standardisation of water chemistry prior to eigen-analysis. |
|
Ragged datasets: reporting, and choosing what to keep. |
End-member mixing analysis¶
How many end-members the data require, which species behave as a mixture, and whether candidate end-members bound the samples.
The EMMA estimator: a scikit-learn-style wrapper over the functional pieces. |
|
Eigen-analysis of standardised water chemistry. |
|
How many components to retain -- and therefore how many end-members. |
|
Projection into and out of the mixing subspace (U-space). |
|
Goodness-of-fit diagnostics for a mixing model (Hooper, 2003). |
|
Screening candidate end-members in U-space. |
|
Archetypal analysis: data-driven candidates for end-members. |
Mixing ratios¶
Constrained least squares, the closed forms, and the maximum-likelihood method for uncertain end-members.
Constrained least squares for mixing ratios with known end-members. |
|
Closed-form mixing fractions for the small cases, and the U-space solve. |
|
MIX: maximum-likelihood mixing ratios with uncertain end-members. |
Isotopes¶
Isotopes of the water molecule mix linearly; isotope ratios of a solute do not.
Isotope tracers, and the one that breaks linear mixing. |
Uncertainty¶
Analytical error propagation for mixing fractions. |
|
Monte Carlo uncertainty for mixing ratios. |
|
Jackknife and bootstrap uncertainty for mixing ratios. |
|
Can these mixing ratios be computed at all? |
Reactions¶
Reading geochemical reactions out of mixing residuals. |
Datasets¶
Synthetic mixtures with known ground truth. |
|
Loaders for the bundled datasets and for live public data. |
Plotting¶
Requires the plotting extra.
Figures for EMMA and mixing analyses. |
|
Colours and mark specifications for Mescla figures. |