mescla.reactions.residuals.fit_conservative¶
- mescla.reactions.residuals.fit_conservative(endmembers, samples, conservative, downweight=1000.0, sigma=None)[source]¶
Fit mixing ratios on the conservative tracers, carrying the rest along.
The correct order of operations for reaction screening: the ratios are determined by the species you trust, and every other species is then compared against the mixture those ratios predict. Non-conservative species are not dropped – they are given a standard deviation
downweighttimes larger, so they contribute essentially nothing to the fit but still receive a prediction to be judged against.- Parameters:
endmembers (array_like, DataFrame or ChemTable)
samples (array_like, DataFrame or ChemTable)
conservative (sequence of str) – The species trusted to behave conservatively in this system.
downweight (float, default 1000.0) – Factor applied to the standard deviation of every other species. Tubau et al. (2014) used factors from 100 to 10^5.
sigma (array_like, optional) – Base standard deviations. Falls back to the
sigmacarried bysamples, then to uniform.
- Returns:
MixingResult – Pass it straight to
classify_source_sink()orreaction_report().- Return type:
Examples
>>> result = fit_conservative(endmembers, samples, ["Cl", "Na", "SO4"]) >>> print(reaction_report(result, samples))