mescla.prep.units.conversion_factors

mescla.prep.units.conversion_factors(species, to='meq/L')[source]

The factors used to convert each species, and where they come from.

Nothing here is hidden: this is the table the conversions read. Inspect it whenever a converted number surprises you, or to check that the library recognised a species under the name you gave it.

Parameters:
  • species (sequence of str, or ChemTable) – Species names, or a table whose species to describe.

  • to ({"meq/L", "mmol/L"}, default "meq/L")

Returns:

DataFrame – Indexed by the name you supplied, with the ion it matched, its molar mass and charge, the equivalent weight, the multiplicative factor, and convertible. Unrecognised or neutral species show NaN and convertible = False.

Return type:

pd.DataFrame

Examples

>>> conversion_factors(["Ca", "SO4", "EC"])["factor"].round(4).to_dict()
{'Ca': 0.0499, 'SO4': 0.0208, 'EC': nan}