Code documentation

Configuration

class MagmaPandas.configuration.configuration[source]

Class for configuring global settings in MagmaPandas.

dQFM

Log units shift of the QFM fO2 buffer. Default value: 1

Type:

int, float

Kd_model

Olivine-melt Fe-Mg partitioning model.

Type:

str

Fe3Fe2_model

Melt Fe3+/Fe2+ model.

Type:

str

melt_thermometer

Melt-only thermometer.

Type:

str

volatily_solubility

CO2-H2O solubility model.

Type:

str

volatile_species

Fluid phase species. Options: ‘h2o’, ‘co2’ or ‘mixed’. Default value: ‘mixed’

Type:

str

classmethod available_models()[source]

Show available models for all parameters

classmethod reset()[source]

Reset to default values

MagmaFrames

Module with MagmaFrame classes and subclasses.

class MagmaPandas.MagmaFrames.MagmaFrame(data=None, *args, units: None | str = None, datatype: None | str = None, weights: Series = None, **kwargs)[source]

Generic MagmaPandas DataFrame class for geochemical data.

Parameters:
  • data (ndarray (structured or homogeneous), Iterable, dict, or DataFrame) – geochemical data with elements or oxides in columns

  • units (None, str) – data units, either “mol fraction”, “wt. %” or “ppm”

  • datatype (None, str) – datatype either “cation” or “oxide”

  • weights (None, pandas Series) – atomic weights of elements or oxides in the MagmaFrame

cations(normalise=True, norm_to=1, mol_fractions=True) Self[source]

Data converted to cation mol fraction

convert_ppm_wtPercent() Self[source]

ppm converted to wt. % and vice versa

mineral_formula(O: int | None = None) Self[source]

Calculate mineral formulas by normalising to oxygen per formula unit

Parameters:

O (int) – Amount of oxygen to normalise to.

Returns:

mineral formulas

Return type:

MagmaFrame

moles(normalise=True) Self[source]

Data converted to mol fraction.

normalise(to=None) Self[source]

Normalise compositions.

Parameters:

to (float, int) – normalisation value

Returns:

normalised data

Return type:

MagmaFrame

oxides(normalise=True, oxidation_state: Dict[str, int] = {}) Self[source]

Data converted to oxides

random_sample(errors) Self[source]

Randomly resample compositions within errors.

Sampling distribution is assumed normal with measured values as means and errors as standard deviations.

Parameters:

errors (float, array-like) – standard deviation of the normal distributions. Use int for a fixed value for all elements or an array for specific values for all elements in elements

Returns:

resampled data – Randomly resampled compositions

Return type:

MagmaFrame

recalculate(inplace=False) Self[source]

Recalculate element masses and total weight.

wt_pc(normalise=True) Self[source]

Data converted to wt. %.

property elements: List[str]

Names of all elements in the MagmaFrame.

property oxygen: Series

oxygen per 1 mole of cations

property ppm: Self

Data converted to ppm.

property units: str

Datatype and units.

property weights: Series

Atomic weights of all elements in the MagmaFrame.

class MagmaPandas.MagmaFrames.Melt(data=None, *args, units: None | str = None, datatype: None | str = None, weights: Series = None, **kwargs)[source]

Subclass of MagmaFrame extended with melt specific methods.

Fe3Fe2(T_K: float | Series, P_bar: float | Series, fO2_logshift: None | int = None, inplace=False, **kwargs) Series[source]

Calculate melt Fe3+/Fe2+ ratios at the set fO2 buffer. Model choice is set in the global configuration class.

Parameters:
  • T_K (float, pd.Series-like) – temperatures in Kelvin

  • Pbar (float, pd.Series-like) – Pressure in bars

  • logshift (int, pd.Series-like) – fO2 buffer shift in log units.

  • inplace (bool)

Returns:

melt Fe3+/Fe2+ ratios

Return type:

pandas Series

FeO_Fe2O3_calc(Fe3Fe2: float | Series, total_Fe: str = 'FeO', inplace: bool = False, wtpc=True) Self[source]

Calculate melt FeO and Fe2O3 based on total Fe.

Parameters:
  • Fe3Fe2 (pandas Series) – melt Fe3+/Fe2+ ratios

  • total_Fe (str) – columname in Melt frame with total Fe

  • inplace (bool)

Returns:

Melt – melt compositions inclusding FeO and Fe2O3

Return type:

Self

Kd_olivine_FeMg_eq(*args, **kwargs)[source]

Calulate equilibrium Fe-Mg partitioning coefficients between olivine and melt as:

(Fe2+ / Mg)ol / (Fe2+ / Mg)melt

Model choice is set in the global configuration class.

Parameters:
  • forsterite (pandas Series) – initial olivine forsterite contents

  • T_K (pandas Series) – temperatures in Kelvin

  • kwargs

    Potential extra keyword arguments:

    1. ’T_K’, temperature in Kelvin

    2. ’P_bar’, pressure in bar

    3. ’Fe3Fe2’, melt Fe3+ /Fe2+ ratios

    4. ’forsterite_initial’, olivine forsterite content.

    Which extra keyword arguments are needed depends on the configured Kd model.

Returns:

Kds – Fe-Mg partitioning coefficients

Return type:

pandas Series

NBO()[source]

Non-bridging oxygen in the melt Formulation according to Mysen [1983]

Returns:

NBO per 1 mole cations

Return type:

pd.Series

NBO_T()[source]

NBO/T The ratio of non-bridging oxygen and tetrahedral cations according to Mysen [1983]

Returns:

NBO/T

Return type:

pd.Series

density(T_K: float | Series, P_bar: float | Series, fO2_logshift: None | int = None) Series[source]

Calculate silicate melts densities with the Iacovino and Till [2019] model

Parameters:
  • T_K (float, pandas Series) – temperatures in Kelvin

  • P_bar (float, pandas Series) – pressures in bar

  • fO2_logshift (None, int) – fO2 buffer shift in log units. If set to None, the value set in the global configuration is used.

Returns:

densities – densities in kg/m3

Return type:

pd.Series

temperature(P_bar: float | Series | None = None, **kwargs) Series[source]

Calculate melt liquidus temperatures. Model choice is set in the global configuration class.

Parameters:

P_bar (float, pandas Series) – pressure in bar

Returns:

temperatures – Liquidus temperatures in Kelvin

Return type:

pd.Series

tetrahedral_cations() Series[source]

Calculate tetrahedral cations based on Mysen [1983]

Si, Ti, Al and P are assumed to be in tetrahedral coordination and Fe3+ is not taken into account

Returns:

tetrahedral cations – summed tertrahedral cations per 1 mole cations

Return type:

pd.Series

viscosity(T_K)[source]

Calculate melts viscosity with the Giordano et al. [2008] model

Parameters:

T_K (float, pandas Series) – temperatures in Kelvin

Returns:

viscosities – viscosity in log10(Pa.s)

Return type:

pd.Series

volatile_saturation_pressure(T_K: float | Series, inplace: bool = False, **kwargs)[source]

Calculate melt volatile (CO2 and/or H2O) saturation pressures.

Model choice is set in the global configuration class.

Parameters:
  • T_K (float, pandas Series) – temperatures in Kelvin

  • inplace (bool)

Returns:

P_bar – Saturation pressures in bar

Return type:

pd.Series

class MagmaPandas.MagmaFrames.Olivine(data=None, *args, units: None | str = None, datatype: None | str = None, weights: Series = None, **kwargs)[source]

Subclass of MagmaFrame extended with olivine specific methods.

calculate_FeMg_Kd(melt_wtpc: Melt | MagmaSeries, T_K, P_bar=1, **kwargs) Series[source]

Calculate Fe-Mg exchange coefficients (Kd) based on measured olivine and melt compositions as (Fe2+/Mg)olivine / (Fe2+/Mg)liquid

property formula: Self

Mineral formulas normalised to 4 O p.f.u.

property forsterite: Series

Forsterite contents

class MagmaPandas.MagmaFrames.Clinopyroxene(data=None, *args, units: None | str = None, datatype: None | str = None, weights: Series = None, **kwargs)[source]

Subclass of MagmaFrame extended with clinopyroxene specific methods.

property endmembers: DataFrame

endmember components

property formula: Self

Mineral formulas normalised to 6 O p.f.u.

property mg_no: Series

Mg numbers

class MagmaPandas.MagmaFrames.Plagioclase(data=None, *args, units: None | str = None, datatype: None | str = None, weights: Series = None, **kwargs)[source]

Subclass of MagmaFrame extended with plagioclase specific methods.

property anorthite: Series

Anorthite contents.

property endmembers: DataFrame

endmember componenents

property formula: Self

Mineral formulas normalised to 8 O p.f.u.

class MagmaPandas.MagmaFrames.Magnetite(data=None, *args, units: None | str = None, datatype: None | str = None, weights: Series = None, **kwargs)[source]

Subclass of MagmaFrame extended with magnetite specific methods.

Fe_speciation() Self[source]

Calculations according to Lindsley, as implemented in QUILF

endmembers()[source]

Calculations according to Lindsley, as implemented in QUILF

class MagmaPandas.MagmaFrames.Ilmenite(data=None, *args, units: None | str = None, datatype: None | str = None, weights: Series = None, **kwargs)[source]

Subclass of MagmaFrame extended with ilmenite specific methods.

Fe_speciation(normalise=False) Self[source]

Calculations according to Andersen et al. (1993), as implemented in QUILF

endmembers()[source]

Calculations according to Andersen et al. (1993), as implemented in QUILF

MagmaSeries

Module with MagmaSeries classes

class MagmaPandas.MagmaSeries.MagmaSeries(data=None, *args, units: str = None, datatype: str = None, weights: Series = None, **kwargs)[source]

Generic MagmaSeries class for chemical data.

Parameters:
  • data (array-like, Iterable, dict, or scalar value) – geochemical data with elements or oxides as index

  • units (None, str) – data units, either “mol fraction”, “wt. %” or “ppm”

  • datatype (None, str) – datatype either “cation” or “oxide”

  • weights (None, pandas Series) – atomic weights of elements or oxides in the MagmaSeries

FeO_Fe2O3_calc(Fe3Fe2: float, total_Fe: str = 'FeO', inplace: bool = False, wtpc=True) Self[source]

Calculate melt FeO and Fe2O3 based on total Fe.

Parameters:
  • Fe3Fe2 (pandas Series) – melt Fe3+/Fe2+ ratios

  • total_Fe (str) – columname in Melt frame with total Fe

  • inplace (bool)

Returns:

Melt – melt compositions inclusding FeO and Fe2O3

Return type:

Self

cations(normalise=True, norm_to=1, mol_fractions=True) Self[source]

Data converted to cation mol fractions

convert_ppm_wtPercent() Self[source]

ppm converted to wt. % and vice versa

mineral_formula(O: int | None = None) Self[source]

Calculate mineral formulas by normalising to oxygen per formula unit

Parameters:

O (int) – Amount of oxygen to normalise to.

Returns:

mineral formulas

Return type:

MagmaSeries

moles(normalise=True) Self[source]

Data converted to mol fractions.

normalise(to=None) Self[source]

Normalise compositions.

Parameters:

to (float, int) – normalisation value

Returns:

normalised data

Return type:

MagmaSeries

oxides(normalise=True, oxidation_state: Dict[str, int] = {}) Self[source]

Data converted to oxides

random_sample(errors) Self[source]

Randomly resample compositions within errors.

Sampling distribution is assumed normal with measured values as means and errors as standard deviations.

Parameters:

errors (float, array-like) – standard deviation of the normal distributions. Use int for a fixed value for all elements or an array for specific values for all elements in elements

Returns:

resampled data – Randomly resampled compositions

Return type:

MagmaSeries

recalculate(inplace=False) Self[source]

Recalculate element masses and total weight.

temperature(*args, **kwargs) float[source]

Calculate melt liquidus temperature. Thermometer models are selected in the global configuration.

Parameters:

P_bar (float, pandas Series) – pressure in bar

Returns:

temperatures – Liquidus temperature in Kelvin

Return type:

float

wt_pc(normalise=True) Self[source]

Data converted to wt. %.

property elements: List[str]

Names of all elements in the MagmaSeries

property units: str

Datatype and units.

property weights: Series

Atomic weights of all elements in the MagmaSeries.

melt Fe3+/Fe2+

MagmaPandas.Fe_redox.Fe3Fe2_calculate.calculate_Fe3Fe2(mol_fractions, T_K, P_bar, fO2=None, **kwargs)[source]

Calculate melt Fe3+/Fe2+ with the configured fO2 buffer and Fe3+/Fe2+ model.

Model choices are set in the global configuration class.

Parameters:
  • mol_fractions (Pandas DataFrame) – Melt composition in oxide mol_fractions

  • T_K (float, pd.Series-like) – temperature in Kelvin

  • P_bar (float, pd.Series-like) – Pressure in bars

  • logshift (int, pd.Series-like) – log units shift of QFM buffer

  • model (string) – Fe3Fe2 model from available_models().

Return type:

melt Fe3+/Fe2+ ratio

class MagmaPandas.Fe_redox.Fe3Fe2_models.armstrong2019[source]

Armstrong et al. [2019]

Calibrated with one andesitic and one MORB compositions + data from O'Neill et al. [2006] and Zhang et al. [2017]

classmethod calculate_Fe3Fe2(melt_mol_fractions, T_K, P_bar, fO2, Fe3Fe2_init=0.3, total_Fe='FeO', *args, **kwargs)[source]

Calculate melt Fe3+/Fe2+ ratios.

Parameters:
  • melt_mol_fractions (Pandas DataFrame) – Melt composition in oxide mol fractions

  • T_K (float, array-like) – temperature in Kelvin

  • P_bar (float, array-like) – pressure in bar

  • fO2 (float, array-like) – Oxygen fugacity

Returns:

melt Fe3+/Fe2+ ratio

Return type:

float, array-like

classmethod get_error(Fe3Fe2, pressure: Series | None = None, *args, **kwargs)[source]

Returns one standard deviation error on Fe3+/Fe2+ ratios, calculated from a compiled validation dataset.

Parameters:
  • Fe3Fe2 (array-like) – melt Fe3+/Fe2+ ratios

  • pressure (array-like, optional) – pressures of each element in Fe3Fe2. If this term is not included, errors will be calculated strictly at 1 bar.

Returns:

Fe3+/Fe2+ error

Return type:

float, array-like

class MagmaPandas.Fe_redox.Fe3Fe2_models.borisov2018[source]

Calculate melt Fe3+/Fe2+ ratios according to equation 4 from Borisov et al. [2018].

classmethod calculate_Fe3Fe2(melt_mol_fractions: DataFrame, T_K, fO2, *args, **kwargs)[source]

Calculate melt Fe3+/Fe2+ ratios.

Parameters:
  • mol_fractions (Pandas DataFrame) – Melt composition in oxide mol fractions

  • T_K (float, array-like) – temperature in Kelvin

  • fO2 (float, array-like) – Oxygen fugacity

Returns:

melt Fe3+/Fe2+ ratio

Return type:

float, array-like

classmethod get_error(Fe3Fe2, pressure: Series | None = None, *args, **kwargs)[source]

Returns one standard deviation error on Fe3+/Fe2+ ratios, calculated from a compiled validation dataset.

Parameters:
  • Fe3Fe2 (array-like) – melt Fe3+/Fe2+ ratios

  • pressure (array-like, optional) – pressures of each element in Fe3Fe2. If this term is not included, errors will be calculated strictly at 1 bar.

Returns:

Fe3+/Fe2+ error

Return type:

float, array-like

class MagmaPandas.Fe_redox.Fe3Fe2_models.deng2020[source]

Deng et al. [2020]

classmethod calculate_Fe3Fe2(melt_mol_fractions, T_K: float | ndarray, P_bar: float | ndarray, fO2: float | ndarray, melt_Fe: str = '12.5molpc', Fe3Fe2_init=0.3, total_Fe='FeO', params_paper=False, **kwargs)[source]

Calculate melt Fe3+/Fe2+ ratios

Parameters:
  • melt_mol_fractions (Pandas DataFrame) – Melt composition in oxide mol fractions

  • T_K (float, array-like) – temperature in Kelvin

  • fO2 (float, array-like) – Oxygen fugacity

Returns:

melt Fe3+/Fe2+ ratio

Return type:

float, array-like

classmethod get_error(Fe3Fe2, pressure: Series | None = None, *args, **kwargs)[source]

Returns one standard deviation error on Fe3+/Fe2+ ratios, calculated from a compiled validation dataset.

Parameters:
  • Fe3Fe2 (array-like) – melt Fe3+/Fe2+ ratios

  • pressure (array-like, optional) – pressures of each element in Fe3Fe2. If this term is not included, errors will be calculated strictly at 1 bar.

Returns:

Fe3+/Fe2+ error

Return type:

float, array-like

class MagmaPandas.Fe_redox.Fe3Fe2_models.fixed[source]

Get fixed Fe3+/Fe2+ ratios. Values and errors need to be set via configuration

classmethod calculate_Fe3Fe2(*args, **kwargs)[source]

Get fixed Fe3+/Fe2+ ratios.

Returns:

melt Fe3+/Fe2+ ratio

Return type:

float, array-like

classmethod get_error(*args, **kwargs)[source]

Returns one standard deviation error on Fe3+/Fe2+ ratios, calculated from a compiled validation dataset.

Parameters:
  • Fe3Fe2 (array-like) – melt Fe3+/Fe2+ ratios

  • pressure (array-like, optional) – pressures of each element in Fe3Fe2. If this term is not included, errors will be calculated strictly at 1 bar.

Returns:

Fe3+/Fe2+ error

Return type:

float, array-like

class MagmaPandas.Fe_redox.Fe3Fe2_models.hirschmann2022[source]

Hirschmann [2022]

classmethod calculate_Fe3Fe2(melt_mol_fractions, T_K, P_bar, fO2, dVdP_method='armstrong2019', *args, **kwargs)[source]

Calculate melt Fe3+/Fe2+ ratios with equation 21.

Parameters:
  • melt_mol_fractions (Pandas DataFrame) – Melt composition in oxide mol fractions

  • T_K (float, array-like) – temperature in Kelvin

  • P_bar (float, array-like) – pressure in bar

  • fO2 (float, array-like) – Oxygen fugacity

Returns:

melt Fe3+/Fe2+ ratio

Return type:

float, array-like

classmethod get_error(Fe3Fe2, pressure: Series | None = None, *args, **kwargs)[source]

Returns one standard deviation error on Fe3+/Fe2+ ratios, calculated from a compiled validation dataset.

Parameters:
  • Fe3Fe2 (array-like) – melt Fe3+/Fe2+ ratios

  • pressure (array-like, optional) – pressures of each element in Fe3Fe2. If this term is not included, errors will be calculated strictly at 1 bar.

Returns:

Fe3+/Fe2+ error

Return type:

float, array-like

class MagmaPandas.Fe_redox.Fe3Fe2_models.jayasuriya2004[source]

Jayasuriya et al. [2004] equation 12.

classmethod calculate_Fe3Fe2(melt_mol_fractions, T_K, fO2, *args, **kwargs) float | ndarray[source]

Calculate melt Fe3+/Fe2+ ratios

Parameters:
  • melt_mol_fractions (Pandas DataFrame) – Melt composition in oxide mol fractions

  • T_K (float, array-like) – temperature in Kelvin

  • fO2 (float, array-like) – Oxygen fugacity

Returns:

melt Fe3+/Fe2+ ratio

Return type:

float, array-like

classmethod get_error(Fe3Fe2, pressure: Series | None = None, *args, **kwargs)[source]

Returns one standard deviation error on Fe3+/Fe2+ ratios, calculated from a compiled validation dataset.

Parameters:
  • Fe3Fe2 (array-like) – melt Fe3+/Fe2+ ratios

  • pressure (array-like, optional) – pressures of each element in Fe3Fe2. If this term is not included, errors will be calculated strictly at 1 bar.

Returns:

Fe3+/Fe2+ error

Return type:

float, array-like

class MagmaPandas.Fe_redox.Fe3Fe2_models.kress_carmichael1991[source]

Calculate melt Fe3+/Fe2+ ratios according to equation 7 from Kress and Carmichael [1991].

classmethod calculate_Fe3Fe2(melt_mol_fractions, T_K, fO2, P_bar)[source]

Calculate melt Fe3+/Fe2+ ratios.

Parameters:
  • mol_fractions (Pandas DataFrame) – melt composition in oxide mol fractions

  • T_K (float, array-like) – temperature in Kelvin

  • fO2 (float, array-like) – Oxygen fugacity

  • P_bar (float, array-like) – Pressure in bar

Returns:

melt Fe3+/Fe2+ ratio

Return type:

float, array-like

classmethod get_error(Fe3Fe2, pressure: Series | None = None, *args, **kwargs)[source]

Returns one standard deviation error on Fe3+/Fe2+ ratios, calculated from a compiled validation dataset.

Parameters:
  • Fe3Fe2 (array-like) – melt Fe3+/Fe2+ ratios

  • pressure (array-like, optional) – pressures of each element in Fe3Fe2. If this term is not included, errors will be calculated strictly at 1 bar.

Returns:

Fe3+/Fe2+ error

Return type:

float, array-like

class MagmaPandas.Fe_redox.Fe3Fe2_models.oneill2006[source]

O'Neill et al. [2006]

classmethod calculate_Fe3Fe2(melt_mol_fractions, P_bar, T_K, fO2, Fe3Fe2_init=0.3, total_Fe='FeO', *args, **kwargs)[source]

Calculate melt Fe3+/Fe2+ ratios with equation 10.

Parameters:
  • melt_mol_fractions (Pandas DataFrame) – Melt composition in oxide mol fractions

  • P_bar (float, array-like) – pressure in bar

  • T_K (float, array-like) – temperature in Kelvin

  • fO2 (float, array-like) – Oxygen fugacity

Returns:

melt Fe3+/Fe2+ ratio

Return type:

float, array-like

classmethod get_error(Fe3Fe2, pressure: Series | None = None, *args, **kwargs)[source]

Returns one standard deviation error on Fe3+/Fe2+ ratios, calculated from a compiled validation dataset.

Parameters:
  • Fe3Fe2 (array-like) – melt Fe3+/Fe2+ ratios

  • pressure (array-like, optional) – pressures of each element in Fe3Fe2. If this term is not included, errors will be calculated strictly at 1 bar.

Returns:

Fe3+/Fe2+ error

Return type:

float, array-like

class MagmaPandas.Fe_redox.Fe3Fe2_models.oneill2018[source]

O'Neill et al. [2018]

classmethod calculate_Fe3Fe2(melt_mol_fractions, T_K, fO2, *args, **kwargs)[source]

Calculate melt Fe3+/Fe2+ ratios with equation 9a.

Parameters:
  • melt_mol_fractions (Pandas DataFrame) – Melt composition in oxide mol fractions

  • T_K (float, array-like) – temperature in Kelvin

  • fO2 (float, array-like) – Oxygen fugacity in bar

Returns:

melt Fe3+/Fe2+ ratio

Return type:

float, array-like

classmethod get_error(Fe3Fe2, pressure: Series | None = None, *args, **kwargs)[source]

Returns one standard deviation error on Fe3+/Fe2+ ratios, calculated from a compiled validation dataset.

Parameters:
  • Fe3Fe2 (array-like) – melt Fe3+/Fe2+ ratios

  • pressure (array-like, optional) – pressures of each element in Fe3Fe2. If this term is not included, errors will be calculated strictly at 1 bar.

Returns:

Fe3+/Fe2+ error

Return type:

float, array-like

class MagmaPandas.Fe_redox.Fe3Fe2_models.putirka2016_6b[source]

Putirka [2016] equation 6b.

classmethod calculate_Fe3Fe2(melt_mol_fractions, T_K, fO2, *args, **kwargs) float | ndarray[source]

Calculate melt Fe3+/Fe2+ ratios

Parameters:
  • melt_mol_fractions (Pandas DataFrame) – Melt composition in oxide mol fractions

  • T_K (float, array-like) – temperature in Kelvin

  • fO2 (float, array-like) – Oxygen fugacity

Returns:

melt Fe3+/Fe2+ ratio

Return type:

float, array-like

classmethod get_error(Fe3Fe2, pressure: Series | None = None, *args, **kwargs)[source]

Returns one standard deviation error on Fe3+/Fe2+ ratios, calculated from a compiled validation dataset.

Parameters:
  • Fe3Fe2 (array-like) – melt Fe3+/Fe2+ ratios

  • pressure (array-like, optional) – pressures of each element in Fe3Fe2. If this term is not included, errors will be calculated strictly at 1 bar.

Returns:

Fe3+/Fe2+ error

Return type:

float, array-like

class MagmaPandas.Fe_redox.Fe3Fe2_models.putirka2016_6c[source]

Putirka [2016] equation 6c.

classmethod calculate_Fe3Fe2(melt_mol_fractions, T_K, fO2, *args, **kwargs) float | ndarray[source]

Calculate melt Fe3+/Fe2+ ratios

Parameters:
  • melt_mol_fractions (Pandas DataFrame) – Melt composition in oxide mol fractions

  • T_K (float, array-like) – temperature in Kelvin

  • fO2 (float, array-like) – Oxygen fugacity

Returns:

melt Fe3+/Fe2+ ratio

Return type:

float, array-like

classmethod get_error(Fe3Fe2, pressure: Series | None = None, *args, **kwargs)[source]

Returns one standard deviation error on Fe3+/Fe2+ ratios, calculated from a compiled validation dataset.

Parameters:
  • Fe3Fe2 (array-like) – melt Fe3+/Fe2+ ratios

  • pressure (array-like, optional) – pressures of each element in Fe3Fe2. If this term is not included, errors will be calculated strictly at 1 bar.

Returns:

Fe3+/Fe2+ error

Return type:

float, array-like

class MagmaPandas.Fe_redox.Fe3Fe2_models.sun2024[source]

Sun and Yao [2024]

classmethod calculate_Fe3Fe2(melt_mol_fractions, T_K, P_bar, fO2, dV='deng', *args, **kwargs)[source]

Calculate melt Fe3+/Fe2+ ratios with equation 9.

Parameters:
  • melt_mol_fractions (Pandas DataFrame) – Melt composition in oxide mol fractions

  • T_K (float, array-like) – temperature in Kelvin

  • P_bar (float, array-like) – pressure in bar

  • fO2 (float, array-like) – Oxygen fugacity

  • Fe3Fe2 (float, array-like) – melt Fe3+/Fe2+ ratios

Returns:

melt Fe3+/Fe2+ ratio

Return type:

float, array-like

classmethod get_error(Fe3Fe2, pressure: Series | None = None, *args, **kwargs)[source]

Returns one standard deviation error on Fe3+/Fe2+ ratios, calculated from a compiled validation dataset.

Parameters:
  • Fe3Fe2 (array-like) – melt Fe3+/Fe2+ ratios

  • pressure (array-like, optional) – pressures of each element in Fe3Fe2. If this term is not included, errors will be calculated strictly at 1 bar.

Returns:

Fe3+/Fe2+ error

Return type:

float, array-like

class MagmaPandas.Fe_redox.Fe3Fe2_models.zhang2017[source]

Zhang et al. [2017]

Only calibrated with an andesitic melt composition

classmethod calculate_Fe3Fe2(melt_mol_fractions, T_K, P_bar, fO2, parameters='LC', *args, **kwargs)[source]

Calculate melt Fe3+/Fe2+ ratios with equation 11.

Parameters:
  • melt_mol_fractions (Pandas DataFrame) – Melt composition in oxide mol fractions

  • T_K (float, array-like) – temperature in Kelvin

  • P_bar (float, array-like) – pressure in bar

  • fO2 (float, array-like) – Oxygen fugacity

Returns:

melt Fe3+/Fe2+ ratio

Return type:

float, array-like

classmethod get_error(Fe3Fe2, pressure: Series | None = None, *args, **kwargs)[source]

Returns one standard deviation error on Fe3+/Fe2+ ratios, calculated from a compiled validation dataset.

Parameters:
  • Fe3Fe2 (array-like) – melt Fe3+/Fe2+ ratios

  • pressure (array-like, optional) – pressures of each element in Fe3Fe2. If this term is not included, errors will be calculated strictly at 1 bar.

Returns:

Fe3+/Fe2+ error

Return type:

float, array-like

fO2

MagmaPandas.fO2.QFM.calculate_fO2(logshift: int | float, T_K: float | ndarray, P_bar: float | ndarray) float | ndarray[source]

Calculate fO2 at the QFM buffer.

1 bar components is calculated according to O'Neill [1987] and pressure contributions according to Holland and Powell [2011], with Landau theory from Holland and Powell [1990] and Holland and Powell [1998], and thermal Tait equations of state parameters from Holland and Powell [2011], updated by Jennings and Holland [2015]

Parameters:
  • logshift (int, float) – fO2 buffer shift in log units of QFM.

  • T_K (float, array-like) – temperatures in Kelvin

  • P_bar (float, array-like) – pressure in bar

Returns:

fO2fO2 in bar

Return type:

float, array-like

MagmaPandas.fO2.IW.calculate_fO2(logshift: float, T_K, P_bar, full_output=False, suppress_Fe_liquid=False)[source]

Calculate oxygen fugacity at the Iron-Wustite buffer according to Hirschmann [2021]

Parameters:
  • logshift (int, float) – log units shift of fO2

  • T_K (float, array-like) – temperature in Kelvin

  • P_bar (float, aray-like) – pressure in bar

  • full_output (boolean) – ouputs fO2 only if False. fO2, stable Fe phase and Fe(1-y)O if True

  • suppress_Fe_liquid (boolean) – ignore Fe liquid if True

Returns:

fO2 – oxygen fugacity

Return type:

float

Olivine-melt Fe-Mg Kd

MagmaPandas.Kd.Ol_melt.FeMg.Kd_calculate.calculate_FeMg_Kd(melt_mol_fractions: Series | DataFrame, T_K: float | Series, *args, **kwargs) Series[source]

Calculate equilibrium Kds for given melt compositions.

Kd models are set in the global configuration

Parameters:
  • melt_mol_fractions (pandas Series, pandas Dataframe) – melt composition in oxide mol fractions

  • forsterite_initial (float, pandas Series) – initial forsterite contents. Forsterite values are iteratively adjusted and initial values are not necessarily in Fe-Mg equilibrium with melts.

  • T_K (float, pandas Series) – temperatures in Kelvin

  • Fe3Fe2 (float, pandas Series) – melt Fe3+/Fe2+ ratios

Returns:

Kds

Return type:

pandas Series

MagmaPandas.Kd.Ol_melt.FeMg.Kd_calculate.observed_FeMg_Kd(melt: Magma, forsterite: Series, P_bar, T_K: None | float | Series = None, **kwargs) Series[source]

Calulate observed Kds based on given melt and olivine compositions.

Parameters:
  • melt (MagmaFrame) – melt composition in oxide wt. %

  • forsterite (float, pandas Series) – olivine forsterite content

  • P_bar (float, pandas Series) – pressures in bar

  • T_K (None, float, pandas Series) – temperatures in Kelvin. If set to None, temperatures are calculated according to the melt thermometer set in the global configuration.

Returns:

Kds

Return type:

pandas Series

class MagmaPandas.Kd.Ol_melt.FeMg.Kd_models.blundy2020[source]

Calculate equilibrium Fe-Mg partition coefficients between olivine and melt according to equation 8 from Blundy et al. [2020].

classmethod calculate_Kd(melt_mol_fractions: Series | DataFrame, T_K: float | Series, P_bar: float | Series, fO2: float | int, forsterite_initial: float | Series = 0.85, *args, **kwargs) float | Series[source]

Calculate Kds for given melt compositions and equilibriutm forsterite content.

Parameters:
  • melt_mol_fractions (pandas Dataframe) – melt compositions in oxide mol fractions

  • forsterite_initial (float, array-like) – initial olivine forsterite contents. Forsterite values are iteratively adjusted until equilibrium with the melt is reached.

  • T_K (float, array-like) – temperatures in Kelvin

  • P_bar (float, array-like) – pressures in bar

Returns:

Kds – Fe-Mg partition coefficients

Return type:

array-like

classmethod get_error(melt_composition: DataFrame, *args, **kwargs) float | Series[source]

Calculate one standard deviation errors on Kds

Parameters:

melt_composition (pandas Dataframe) – melt composition in oxide wt. %

Returns:

error – one standard deviation error

Return type:

float, array-like

classmethod get_offset(melt_composition, offset_parameters, *args, **kwargs)[source]

Calculate random samples of partition coefficient errors

Parameters:

offset_parameters (float, array-like) – random samples of a standard normal distribution.

class MagmaPandas.Kd.Ol_melt.FeMg.Kd_models.fixed[source]

Get fixed Kd ratios. Values and errors need to be set via configuration

classmethod calculate_Kd(*args, **kwargs)[source]

Get fixed Kd ratios.

Returns:

melt Kd ratio

Return type:

float, array-like

class MagmaPandas.Kd.Ol_melt.FeMg.Kd_models.putirka2016_8a[source]

Calculate equilibrium Fe-Mg partition coefficients between olivine and melt according to equation 8a from Putirka [2016].

static calculate_Kd(melt_mol_fractions, *args, **kwargs) float[source]

Calculate mineral-melt partition coefficients

Returns:

mineral-melt partition coefficients

Return type:

float

class MagmaPandas.Kd.Ol_melt.FeMg.Kd_models.putirka2016_8b[source]

Calculate equilibrium Fe-Mg partition coefficients between olivine and melt according to equation 8b from Putirka [2016].

For P > 1 GPa

classmethod calculate_Kd(melt_mol_fractions, P_bar, *args, **kwargs) float | ndarray[source]

Calculate mineral-melt partition coefficients

Parameters:
  • melt_mol_fractions (Pandas DataFrame) – Melt composition in oxide mol fractions

  • P_bar (float, array-like) – pressure in bar

Returns:

mineral-melt partition coefficients

Return type:

float, array-like

class MagmaPandas.Kd.Ol_melt.FeMg.Kd_models.putirka2016_8c[source]

Calculate equilibrium Fe-Mg partition coefficients between olivine and melt according to equation 8c from Putirka [2016].

for P < 1 GPa

classmethod calculate_Kd(melt_mol_fractions, *args, **kwargs) float | ndarray[source]

Calculate mineral-melt partition coefficients

Parameters:

melt_mol_fractions (Pandas DataFrame) – Melt composition in oxide mol fractions

Returns:

mineral-melt partition coefficients

Return type:

float, array-like

class MagmaPandas.Kd.Ol_melt.FeMg.Kd_models.putirka2016_8d[source]

Calculate equilibrium Fe-Mg partition coefficients between olivine and melt according to equation 8d from Putirka [2016].

For liquid compositions with <45 wt.% SiO2 and > 8 wt.% Na2O + K2O

classmethod calculate_Kd(melt_mol_fractions, T_K, P_bar, *args, **kwargs) float | ndarray[source]

Calculate mineral-melt partition coefficients

Parameters:
  • melt_mol_fractions (Pandas DataFrame) – Melt composition in oxide mol fractions

  • P_bar (float, array-like) – pressure in bar

Returns:

mineral-melt partition coefficients

Return type:

float, array-like

class MagmaPandas.Kd.Ol_melt.FeMg.Kd_models.saper2022[source]

Calculate equilibrium Fe-Mg partition coefficients between olivine and melt according to equation 10 from Saper et al. [2022].

Calibrated for low fO2 conditions (IW +-0.5), with close to 0 Fe3+

classmethod calculate_Kd(melt_mol_fractions: Series | DataFrame, Fe3Fe2: float | Series, T_K: float | Series, forsterite_initial: float | Series = 0.85, *args, **kwargs) float | Series[source]

Calculate Kds for given melt compositions and equilibriutm forsterite content.

Parameters:
  • melt_mol_fractions (pandas Dataframe) – melt compositions in oxide mol fractions

  • forsterite_initial (float, array-like) – initial olivine forsterite contents. Forsterite values are iteratively adjusted until equilibrium with the melt is reached.

  • Fe3Fe2 (float, array-like) – melt Fe3+/Fe2+ ratios

  • T_K (float, array-like) – temperatures in Kelvin

  • P_bar (float, array-like) – pressures in bar

Returns:

Kds – Fe-Mg partition coefficients

Return type:

array-like

class MagmaPandas.Kd.Ol_melt.FeMg.Kd_models.sun2020[source]

Calculate equilibrium Fe-Mg partition coefficients between olivine and melt according to equation 7 from Sun and Dasgupta [2020].

Sun, C., Dasgupta, R. (2020) Thermobarometry of CO2-rich, silica-undersaturated melts constrains cratonic lithosphere thinning through time in areas of kimberlitic magmatism. Earth and Planetary Sience Letters. 550

classmethod calculate_Kd(melt_mol_fractions, Fe3Fe2, *args, **kwargs) float | Series[source]

Calculate Kds for given melt compositions and fixed forsterite content.

Parameters:
  • melt_mol_fractions (pandas Dataframe) – melt compositions in oxide mol fractions

  • forsterite (float, array-like) – olivine forsterite contents.

  • T_K (float, array-like) – temperatures in Kelvin

  • P_bar (float, array-like) – pressures in bar

Returns:

Kds – Fe-Mg partition coefficients

Return type:

array-like

class MagmaPandas.Kd.Ol_melt.FeMg.Kd_models.toplis2005[source]

Calculate equilibrium Fe-Mg partition coefficients between olivine and melt according to equation 10 from Toplis [2005].

classmethod calculate_Kd(melt_mol_fractions: Series | DataFrame, Fe3Fe2: float | Series, T_K: float | Series, P_bar: float | Series, forsterite_initial: float | Series = 0.85, *args, **kwargs) float | Series[source]

Calculate Kds for given melt compositions and equilibriutm forsterite content.

Parameters:
  • melt_mol_fractions (pandas Dataframe) – melt compositions in oxide mol fractions

  • forsterite_initial (float, array-like) – initial olivine forsterite contents. Forsterite values are iteratively adjusted until equilibrium with the melt is reached.

  • Fe3Fe2 (float, array-like) – melt Fe3+/Fe2+ ratios

  • T_K (float, array-like) – temperatures in Kelvin

  • P_bar (float, array-like) – pressures in bar

Returns:

Kds – Fe-Mg partition coefficients

Return type:

array-like

Silicate liquid density

MagmaPandas.rheology.density.calculate_density(melt_wt_percent: Magma, T_K: float | Series, P_bar: float | Series) Series[source]

Calculate silicate liquid densities according to the model from Iacovino and Till [2019]

The model uses thermodynamic data from Lange and Carmichael [1987], Lange [1997], Kress and Carmichael [1991] and Ochs and Lange [1999]

Parameters:
  • composition (Magma) – melt composition in oxide wt. %

  • T_K (float, pandas Series) – temperatures in Kelvin

  • P_bar (float, pandas Series) – pressures in bar

Returns:

densities – densities in kg/m3

Return type:

pandas Series

MagmaPandas.rheology.viscosity.calculate_viscosity(melt_mol_fractions: DataFrame | Series, T_K: Series | float) Series[source]

Calculate melt viscosity according to equation 1 of Giordano et al. [2008].

Parameters:
  • melt_mol_fractions – melt mol fractions

  • T_K – temperature in Kelvin

Return type:

viscosity in log10(Pa.s)

Thermometers

Module with melt-only and melt-mineral thermometers

melt-only

Sub-module with melt-only thermometers

MagmaPandas.thermometers.melt.putirka2008_13(melt: Magma, offset: float = 0.0, *args, **kwargs) float | Series[source]

melt-only thermometer

Equation 13 from Putirka [2008] calculates liquidus temperatures based on melt compositions. Requires saturation in olivine.

SEE = 71 degrees

Parameters:
  • melt (Magma) – melt compositions in oxide wt. %

  • offset (float) – offset value in standard deviations. Temperatures are calculated as temnperature + offset * thermometer error (SEE).

Returns:

temperatures – liquidus temperatures in Kelvin.

Return type:

float, pandas Series

MagmaPandas.thermometers.melt.putirka2008_14(melt: Magma, warn=True, offset: float = 0.0, *args, **kwargs) float | Series[source]

melt-only thermometer

Equation 14 from Putirka [2008] calculates liquidus temperatures based on melt compositions. Requires saturation in olivine.

SEE = 58 degrees

Applicable between:

  • 0 - 14.4 GPa

  • 729 - 2000 degrees C

  • 31 - 73.64 wt. % SiO2

  • 0 - 14.3 wt. % Na2O + K2O

  • 0 - 18.6 wt. % H2O

Parameters:
  • melt (Magma) – melt compositions in oxide wt. %

  • offset (float) – offset value in standard deviations. Temperatures are calculated as temnperature + offset * thermometer error (SEE).

Returns:

temperatures – liquidus temperatures in Kelvin.

Return type:

float, pandas Series

MagmaPandas.thermometers.melt.putirka2008_15(melt: Magma, P_bar: float | Series, offset: float = 0.0, warn=True, **kwargs) float | Series[source]

melt-only thermometer

Equation 15 from Putirka [2008] calculates liquidus temperatures based on melt compositions. Requires saturation in olivine.

SEE = 46 degrees

Applicable between:

  • 0 - 14.4 GPa

  • 729 - 2000 degrees C

  • 31 - 73.64 wt. % SiO2

  • 0 - 14.3 wt. % Na2O + K2O

  • 0 - 18.6 wt. % H2O

Parameters:
  • melt (Magma) – melt compositions in oxide wt. %

  • P_bar (float, pandas Series) – pressures in bar.

  • offset (float) – offset value in standard deviations. Temperatures are calculated as temnperature + offset * thermometer error (SEE).

Returns:

temperatures – liquidus temperatures in Kelvin.

Return type:

float, pandas Series

MagmaPandas.thermometers.melt.putirka2008_16(melt: Magma, P_bar: float | Series, offset: float = 0.0, **kwargs) float | Series[source]

melt-only thermometer

Equation 16 from Putirka [2008] calculates liquiqdus temperatures based on melt compositions. Requires equilibrium with olivine + plagioclase + clinopyroxene and saturation with additional phases drastically increases the standard error of estimate.

SEE = 26 degrees (saturation in olivine + plagioclase + clinopyroxene)

= 60 degrees (saturation with additional phases)

Parameters:
  • melt (Magma) – melt compositions in oxide wt. %

  • P_bar (float, pandas Series) – pressures in bar

  • offset (float) – offset value in standard deviations. Temperatures are calculated as temnperature + offset * thermometer error (SEE).

Returns:

temperatures – liquidus temperatures in Kelvin.

Return type:

float, pandas Series

MagmaPandas.thermometers.melt.putirka2008_22(melt: Magma, P_bar: float | Series, offset: float = 0.0, **kwargs) float | Series[source]

melt-only thermometer

Equation 22 from Putirka [2008], combined with equation 12 from Beattie (1993) calculates liquidus temperatures based on melt compositions. #TODO add reference link

Parameters:
  • melt (Magma) – melt compositions in oxide wt. %

  • P_bar (float, pandas Series) – pressures in bar.

  • offset (float) – offset value in standard deviations. Temperatures are calculated as temnperature + offset * thermometer error (SEE).

Returns:

temperatures – liquidus temperatures in Kelvin.

Return type:

float, pandas Series

MagmaPandas.thermometers.melt.shea2022(melt, offset: float = 0.0, **kwargs)[source]

Equation 1 from Shea et al. [2022]

Calibrated at: 1 bar 1060 - 1500 degrees C

SEE: 13 degrees C (on calibration dataset, not validated)

Parameters:
  • melt (Magma) – melt compositions in oxide wt. %

  • offset (float) – offset value in standard deviations. Temperatures are calculated as temnperature + offset * thermometer error (SEE).

Returns:

temperatures – liquidus temperatures in Kelvin.

Return type:

float, pandas Series

MagmaPandas.thermometers.melt.sugawara2000_3(melt, P_bar: float | Series, offset: float = 0.0, **kwargs)[source]

Equation 3 from Sugawara [2000] with olivine-liquid parameters and corrected for H2O according to equation 7a.

Calibrated at: <= 3.5 GPa 1266 - 1873 C

SEE: 33 degrees C

Parameters:
  • melt (Magma) – melt compositions in oxide wt. %

  • P_bar – pressures in bar

  • offset (float) – offset value in standard deviations. Temperatures are calculated as temnperature + offset * thermometer error (SEE).

Returns:

temperatures – liquidus temperatures in Kelvin.

Return type:

float, pandas Series

MagmaPandas.thermometers.melt.sugawara2000_6a(melt, P_bar: float | Series, offset: float = 0.0, **kwargs)[source]

Equation 6a corrected for H2O according to equation 7a from Sugawara [2000] Calibrated at: <= 3.5 GPa 1266 - 1873 C

SEE: 30 degrees C

Parameters:
  • melt (Magma) – melt compositions in oxide wt. %

  • P_bar – pressures in bar

  • offset (float) – offset value in standard deviations. Temperatures are calculated as temnperature + offset * thermometer error (SEE).

Returns:

temperatures – liquidus temperatures in Kelvin.

Return type:

float, pandas Series

MagmaPandas.thermometers.melt.sun2020(melt, P_bar: float | Series, offset: float = 0.0, **kwargs)[source]

Equation 6 from:

Sun and Dasgupta [2020]

Calibrated at: ~ 2 - 10 GPa ~ 950 - 1600 degrees C

SEE: 49 degrees C

Parameters:
  • melt (Magma) – melt compositions in oxide wt. %

  • P_bar – pressures in bar

  • offset (float) – offset value in standard deviations. Temperatures are calculated as temnperature + offset * thermometer error (SEE).

Returns:

temperatures – liquidus temperatures in Kelvin.

Return type:

float, pandas Series

Olivine-melt

Sub-module with olivine-melt thermometers

MagmaPandas.thermometers.ol_melt.putirka2007_4(liquid: Magma, olivine: Magma, P_bar: float | Series, offset: float = 0.0, **kwargs) Series[source]

Olivine-liquid thermometer

Equation 4 from Putirka et al. [2007] calculates liquidus temperatures based on olivine-melt pairs. Identical to equation 22 from Putirka [2008].

SEE = hydrous: 29, anhydrous: 45, total: 43

Total Fe is expressed as FeO

Parameters:
  • liquid (Magma) – melt compositions in oxide wt. %

  • olivine (pandas Series, pandas Dataframe) – olivine compositions in oxide wt. %

  • P_bar (float, pandas Series) – pressures in bar

  • offset (float) – offset value in standard deviations. Temperatures are calculated as temnperature + offset * thermometer error (SEE).

Returns:

temperatures – olivine liquidus temperatures in Kelvin.

Return type:

pd.Series

CO2-H2O solubility models

Module with CO2-H2O solublity models for silicate melts

Allison 2022

class MagmaPandas.volatile_solubility.volatile_solubility_models.allison2022.co2[source]

CO2 solubility model from Allison et al. [2022]

static calculate_saturation(oxide_wtPercents: Magma, T_K: float, **kwargs) float[source]

Calculate melt CO2 saturation pressure according to equation 5.

Parameters:
  • oxide_wtPercents (MagmaSeries) – melt composition in oxide wt. %. Needs to have a ‘CO2’ column.

  • T_K (float) – temperature in Kelvin

Returns:

P_saturation – Saturation pressure in bar

Return type:

float

static calculate_solubility(oxide_wtPercents: Magma, P_bar: float, T_K: float, x_fluid: float = 0.0, **kwargs) float[source]

Calculate melt CO2 solubility according to equation 5.

Parameters:
  • oxide_wtPercents (MagmaSeries) – melt composition in oxide wt. %.

  • P_bar (float) – Pressure in bar

  • T_K (float) – temperature in Kelvin

  • x_fluid (float) – fraction of H2O in the fluid. Default value is 0.0

Returns:

solublities – melt CO2 solubility in wt. %.

Return type:

float

class MagmaPandas.volatile_solubility.volatile_solubility_models.allison2022.h2o[source]

H2O solubility model from Allison et al. [2022]

static calculate_saturation(oxide_wtPercents: Magma, T_K: float, **kwargs) float[source]

Calculate melt H2O saturation pressure according to equation 8.

Parameters:
  • oxide_wtPercents (MagmaSeries) – melt composition in oxide wt. %. Needs to have an ‘H2O’ column.

  • T_K (float) – temperature in Kelvin

Returns:

P_saturation – Saturation pressure in bar

Return type:

float

static calculate_solubility(P_bar: float, T_K: float, x_fluid=1.0, **kwargs) float[source]

Calculate melt H2O solubility according to equation 8.

Parameters:
  • P_bar (float) – Pressure in bar.

  • T_K (float) – temperature in Kelvin

  • x_fluid (float) – fraction of H2O in the fluid. Default value is 1.0

Returns:

H2O – melt H2O solubility in wt.%.

Return type:

float

class MagmaPandas.volatile_solubility.volatile_solubility_models.allison2022.mixed[source]

CO2-H2O solubility models from Allison et al. [2022]

static calculate_saturation(oxide_wtPercents: Magma, T_K: float | ndarray, output: str = 'P', **kwargs) float | Tuple[float, float][source]

Calculate volatile saturation pressure for systems with mixed CO2-H2O fluids.

Parameters:
  • oxide_wtPercents (MagmaSeries) – melt composision in oxide wt. %. Needs to have ‘H2O’ and ‘CO2’ columns.

  • T_K (float) – Temperature in kelvin

  • output (str) – Output format. ‘P’ for pressure only, ‘Xfl’ for H2O fluid fraction only and ‘PXfl’ for both.

Returns:

saturation – Depending on the value of output: saturation pressure in bar, H2O fluid fraction or (saturation pressure, fluid fraction)

Return type:

float, (float, float)

static calculate_solubility(oxide_wtPercents: Magma, P_bar: float, T_K: float, x_fluid: float, output: None | str = 'both', **kwargs)[source]

Calculate volatile solubilities for systems with mixed CO2-H2O fluids.

Parameters:
  • oxide_wtPercents (MagmaSeries) – melt composision in oxide wt. %.

  • P_bar (float) – pressure in bar

  • T_K (float) – Temperature in kelvin

  • x_fluid (float) – fraction of H2O in the fluid.

  • output (str) – Output format. ‘CO2’ for CO2 only, ‘H2O’ for H2O only and ‘both’ for both.

Returns:

saturation – Solubility in wt. %. Depending on the value of output: CO2, H2O or (CO2, H2O).

Return type:

float, (float, float)

Iacono-Marziano 2012

class MagmaPandas.volatile_solubility.volatile_solubility_models.iaconomarziano2012.co2[source]

CO2 solubility model from Iacono-Marziano et al. [2012]

static calculate_saturation(oxide_wtPercents: Magma, T_K: float, **kwargs) float[source]

Calculate melt CO2 saturation pressure according to equation 12.

Parameters:
  • oxide_wtPercents (MagmaSeries) – melt composition in oxide wt. %. Needs to have a ‘CO2’ column.

  • T_K (float) – temperature in Kelvin

  • kwargs – keyword arguments passed to calculate_solubility()

Returns:

P_saturation – Saturation pressure in bar

Return type:

float

static calculate_solubility(oxide_wtPercents: Magma, P_bar: float | ndarray, T_K: float | ndarray, x_fluid: float = 0.0, **kwargs) float[source]

Calculate melt CO2 solubility according to equation 12.

Parameters:
  • oxide_wtPercents (MagmaSeries) – melt composition in oxide wt. %.

  • P_bar (float, array-like) – Pressure in bar

  • T_K (float, array-like) – temperature in Kelvin

  • x_fluid (float) – fraction of H2O in the fluid. Default value is 0.0

Returns:

solublity – melt CO2 solubility in wt. %.

Return type:

float

class MagmaPandas.volatile_solubility.volatile_solubility_models.iaconomarziano2012.h2o[source]

H2O solubility model from Iacono-Marziano et al. [2012]

static calculate_saturation(oxide_wtPercents: Magma, T_K: float, **kwargs) float[source]

Calculate melt H2O saturation pressure according to equation 13.

Parameters:
  • oxide_wtPercents (MagmaSeries) – melt composition in oxide wt. %. Needs to have an ‘H2O’ column.

  • T_K (float) – temperature in Kelvin

  • kwargs – keyword arguments passed to calculate_solubility()

Returns:

P_saturation – Saturation pressure in bar

Return type:

float

static calculate_solubility(oxide_wtPercents: Magma, P_bar: float, T_K: float, x_fluid: float = 1.0, **kwargs) float[source]

Calculate melt H2O solubility according to equation 13.

Parameters:
  • oxide_wtPercents (MagmaSeries) – melt composition in oxide wt. %.

  • P_bar (float) – Pressure in bar.

  • T_K (float) – temperature in Kelvin

  • x_fluid (float) – fraction of H2O in the fluid. Default value is 1.0

Returns:

H2O – melt H2O solubility in wt.%.

Return type:

float

class MagmaPandas.volatile_solubility.volatile_solubility_models.iaconomarziano2012.mixed[source]

CO2-H2O solubility models from Iacono-Marziano et al. [2012]

static calculate_saturation(oxide_wtPercents: Magma, T_K: float, output: str = 'P', **kwargs) float | Tuple[float, float][source]

Calculate volatile saturation pressure for systems with mixed CO2-H2O fluids.

Parameters:
  • oxide_wtPercents (MagmaSeries) – melt composision in oxide wt. %. Needs to have ‘H2O’ and ‘CO2’ columns.

  • T_K (float) – Temperature in kelvin

  • output (str) – Output format. ‘P’ for pressure only, ‘Xfl’ for H2O fluid fraction only and ‘PXfl’ for both.

Returns:

saturation – Depending on the value of output: saturation pressure in bar, H2O fluid fraction or (saturation pressure, fluid fraction)

Return type:

float, (float, float)

static calculate_solubility(oxide_wtPercents: Magma, P_bar: float, T_K: float, x_fluid: float, output: str = 'both', **kwargs) float | Tuple[float, float][source]

Calculate volatile solubilities for systems with mixed CO2-H2O fluids.

Parameters:
  • oxide_wtPercents (MagmaSeries) – melt composision in oxide wt. %.

  • P_bar (float) – pressure in bar

  • T_K (float) – Temperature in kelvin

  • x_fluid (float) – fraction of H2O in the fluid.

  • output (str) – Output format. ‘CO2’ for CO2 only, ‘H2O’ for H2O only and ‘both’ for both.

Returns:

saturation – Solubility in wt. %. Depending on the value of output: CO2, H2O or (CO2, H2O).

Return type:

float, (float, float)

Shiskina 2014