Core functions (e.g., cation fractions)
- Thermobar.core.amp_components_ferric_ferrous(sites_df, norm_cations)[source]
amp_components_ferric_ferrous calculates the Fe3+ and Fe2+ apfu values of amphibole and adjusts the generic stoichiometry such that charge balance is maintained. This is based off the “f parameters” listed in Holland and Blundy (1994). Following Mutch et al. (2016) spreadsheet.
- Parameters:
sites_df (pandas DataFrame) – output from the get_amp_sites function. you do not need to modify this at all
norm_cations (pandas DataFrame) – This is the dataframe output from calculate_23oxygens_amphibole. You should not have to modify this dataframe at all.
- Returns:
norm_cations_hb –
- amphibole apfu values for each cation, however two things are different:
FeOt is replaced by individual Fe2O3 and FeO columns
- all apfu values from the generic mineral recalculation have been
adjusted by the “f” parameter from Holland and Blundy (1994) to maintain charge balance and stoichiometry
- Return type:
pandas DataFrame
- Thermobar.core.amp_components_ferric_ferrous_mutch(sites_df, norm_cations)[source]
amp_components_ferric_ferrous calculates the Fe3+ and Fe2+ apfu values of amphibole and adjusts the generic stoichiometry such that charge balance is maintained. This is based off the “f parameters” listed in Holland and Blundy (1994), using the averaging in the spreadsheet supplied by Euan Mutch
- Parameters:
sites_df (pandas DataFrame) – output from the get_amp_sites function. you do not need to modify this at all
norm_cations (pandas DataFrame) – This is the dataframe output from calculate_23oxygens_amphibole. You should not have to modify this dataframe at all.
- Returns:
norm_cations_hb –
- amphibole apfu values for each cation, however two things are different:
FeOt is replaced by individual Fe2O3 and FeO columns
- all apfu values from the generic mineral recalculation have been
adjusted by the “f” parameter from Holland and Blundy (1994) to maintain charge balance and stoichiometry
- Return type:
pandas DataFrame
- Thermobar.core.calculate_13cations_amphibole_ridolfi(amp_comps)[source]
- Import amphibole compositions using amp_comps=My_amphiboles, returns
components calculated on basis of 13 cations following Ridolfi supporting information
- Parameters
- amp_comps: pandas.DataFrame
amphibole compositions with column headings SiO2_Amp, MgO_Amp etc.
- pandas DataFrame
cation fractions for amphiboles with column headings of the form SiO2_Amp_13_cat…
- Thermobar.core.calculate_23oxygens_amphibole(amp_comps)[source]
Import amphibole compositions using amp_comps=My_Amps, returns cations on the basis of 23 oxygens.
- Parameters
- amp_comps: pandas.DataFrame
amphibole compositions with column headings SiO2_Amp, MgO_Amp etc.
- pandas DataFrame
cations on the basis of 23 oxygens, with column headings of the form Si_Amp_cat_23ox. For simplicity, and consistency of column labelling to aid calculations, oxide names are preserved, so outputs are Na_Amp_cat_23ox rather than Na_Amp_cat_23ox.
- Thermobar.core.calculate_6oxygens_clinopyroxene(cpx_comps)[source]
Import clinopyroxene compositions using cpx_comps=My_Cpxs, returns cations on the basis of 6 oxygens.
- Parameters
- cpx_comps: pandas.DataFrame
clinopyroxene compositions with column headings SiO2_Cpx, MgO_Cpx etc.
- pandas DataFrame
cations on the basis of 6 oxygens, with column headings of the form …Cpx_cat_6ox.
- Thermobar.core.calculate_6oxygens_orthopyroxene(opx_comps)[source]
Import orthopyroxene compositions using opx_comps=My_Opxs, returns cations on the basis of 6 oxygens.
- Parameters
- opx_comps: pandas.DataFrame
Orthopyroxene compositions with column headings SiO2_Opx, MgO_Opx etc.
- pandas DataFrame
cations on the basis of 6 oxygens, with column headings of the form …Opx_cat_6ox.
- Thermobar.core.calculate_anhydrous_cat_fractions_liquid(liq_comps)[source]
Import Liq compositions using liq_comps=My_Liquids, returns anhydrous cation fractions
- Parameters
- liq_comps: pandas.DataFrame
liquid compositions with column headings SiO2_Liq, TiO2_Liq etc.
- pandas DataFrame
anhydrous cation fractions for the liquid with column headings of the form _Liq_cat_frac, as well as the initial dataframe of liquid compositions.
- Thermobar.core.calculate_anhydrous_cat_proportions_liquid(liq_comps)[source]
Import Liq compositions using liq_comps=My_Liquids, returns anhydrous cation proportions (e.g., mole proportions * no of cations)
- Parameters
- liq_comps: pandas.DataFrame
Panda DataFrame of liquid compositions with column headings SiO2_Liq, TiO2_Liq etc.
- pandas DataFrame
anhydrous cation proportions for the liquid with column headings of the form S_Liq_cat_prop
- Thermobar.core.calculate_anhydrous_mol_fractions_liquid(liq_comps)[source]
Import Liq compositions using liq_comps=My_Liquids, returns anhydrous mole fractions
- Parameters
- liq_comps: pandas.DataFrame
Panda DataFrame of liquid compositions with column headings SiO2_Liq, TiO2_Liq etc.
- pandas DataFrame
anhydrous mole fractions for the liquid with column headings of the form SiO2_Liq_mol_frac
- Thermobar.core.calculate_anhydrous_mol_fractions_liquid_Ni(liq_comps)[source]
Import Liq compositions using liq_comps=My_Liquids, returns anhydrous mole fractions
- Parameters
- liq_comps: pandas.DataFrame
liquid compositions with column headings SiO2_Liq, TiO2_Liq etc.
- pandas DataFrame
anhydrous mole fractions for the liquid with column headings of the form SiO2_Liq_mol_frac
- Thermobar.core.calculate_anhydrous_mol_proportions_liquid(liq_comps)[source]
Import Liq compositions using liq_comps=My_Liquids, returns anhydrous mole proportions
- Parameters
- liq_comps: pandas.DataFrame
Panda DataFrame of liquid compositions with column headings SiO2_Liq, TiO2_Liq etc.
- pandas DataFrame
anhydrous mole proportions for the liquid with column headings of the form SiO2_Liq_mol_prop
- Thermobar.core.calculate_anhydrous_mol_proportions_liquid_Ni(liq_comps)[source]
Import Liq compositions using liq_comps=My_Liquids, returns anhydrous mole proportions
- Parameters
- liq_comps: pandas.DataFrame
liquid compositions with column headings SiO2_Liq, TiO2_Liq etc.
- pandas DataFrame
anhydrous mole proportions for the liquid with column headings of the form SiO2_Liq_mol_prop
- Thermobar.core.calculate_cat_fractions_kspar(*, kspar_comps=None)[source]
Import AlkaliFspar compositions using kspar_comps=My_kspars, returns cation fractions
- Parameters
- kspar_comps: pandas.DataFrame
AlkaliFspar compositions with column headings SiO2_Kspar, MgO_Kspar etc.
- pandas DataFrame
cation fractions for AlkaliFspar with column headings of the form SiO2_Kspar_cat_frac. For simplicity, and consistency of column heading types, oxide names are preserved, so outputs are Na2O_Kspar_cat_frac rather than Na_Kspar_cat_frac.
- Thermobar.core.calculate_cat_fractions_olivine(ol_comps)[source]
Import Olivine compositions using ol_comps=My_Olivines, returns cation proportions
- Parameters
- ol_comps: pandas.DataFrame
olivine compositions with column headings SiO2_Ol, MgO_Ol etc.
- pandas DataFrame
cation fractions for olivine with column headings of the form SiO2_Ol_cat_frac. For simplicity, and consistency of column heading types, oxide names are preserved, so outputs are Na2O_Ol_cat_frac rather than Na_Ol_cat_frac.
- Thermobar.core.calculate_cat_fractions_plagioclase(plag_comps)[source]
Import plagioclase compositions using plag_comps=My_plagioclases, returns cation fractions
- Parameters
- plag_comps: pandas.DataFrame
plagioclase compositions with column headings SiO2_Plag, MgO_Plag etc.
- pandas DataFrame
cation fractions for plagioclase with column headings of the form …Plag_cat_frac.
- Thermobar.core.calculate_cat_proportions_amphibole(*, amp_comps=None, oxide_headers=False)[source]
Import amphibole compositions using amp_comps=My_amphiboles, returns cation proportions
- Parameters
- amp_comps: pandas.DataFrame
amphibole compositions with column headings SiO2_Amp, MgO_Amp etc.
- pandas DataFrame
cation proportions for amphibole with column headings of the form …Amp_cat_prop
- Thermobar.core.calculate_cat_proportions_amphibole_ridolfi(*, amp_comps=None)[source]
Import amphibole compositions using amp_comps=My_amphiboles, returns cation proportions
- Parameters
- amp_comps: pandas.DataFrame
amphibole compositions with column headings SiO2_Amp, MgO_Amp etc.
- pandas DataFrame
cation proportions for amphibole with column headings of the form SiO2_Amp_cat_prop For simplicity, and consistency of column heading types, oxide names are preserved, so outputs are Na2O_Amp_cat_prop rather than Na_Amp_cat_prop.
- Thermobar.core.calculate_cat_proportions_kspar(*, kspar_comps=None, oxide_headers=False)[source]
Import kspar compositions using kspar_comps=My_kspars, returns cation proportions
- Parameters
- kspar_comps: pandas.DataFrame
kspar compositions with column headings SiO2_Kspar, MgO_Kspar etc.
- oxide_headers: bool
default=False, returns as Ti_Kspar_cat_prop. =True returns Ti_Kspar_cat_prop. This is used for rapid matrix division for pre-processing of data for cation fractions etc
- pandas DataFrame
cation proportions for kspar with column headings of the form SiO2_Kspar_cat_prop For simplicity, and consistency of column heading types, oxide names are preserved, so outputs are Na2O_Kspar_cat_prop rather than Na_Kspar_cat_prop.
- Thermobar.core.calculate_cat_proportions_olivine(ol_comps)[source]
Import Olivine compositions using ol_comps=My_Olivines, returns cation proportions
- Parameters
- ol_comps: pandas.DataFrame
olivine compositions with column headings SiO2_Ol, MgO_Ol etc.
- pandas DataFrame
cation proportions for olivine with column headings of the form SiO2_Ol_cat_prop For simplicity, and consistency of column heading types, oxide names are preserved, so outputs are Na2O_Ol_cat_prop rather than Na_Ol_cat_prop.
- Thermobar.core.calculate_cat_proportions_plagioclase(*, plag_comps=None, oxide_headers=False)[source]
Import plagioclase compositions using plag_comps=My_plagioclases, returns cation proportions
- Parameters
- plag_comps: pandas.DataFrame
plagioclase compositions with column headings SiO2_Plag, MgO_Plag etc.
- oxide_headers: bool
default=False, returns as Ti_Plag_cat_prop. =True returns Ti_Plag_cat_prop. This is used for rapid matrix division for pre-processing of data for cation fractions etc
- pandas DataFrame
cation proportions for plagioclase with column headings of the form …Plag_cat_prop
- Thermobar.core.calculate_clinopyroxene_components(cpx_comps)[source]
Import clinopyroxene compositions using cpx_comps=My_Cpxs, returns clinopyroxene components along with entered Cpx compositions
- Parameters
- cpx_comps: pandas.DataFrame
clinopyroxene compositions with column headings SiO2_Cpx, MgO_Cpx etc.
- pandas DataFrame
Clinopyroxene components (column headings: Cation_Sum, CrCaTs, a_cpx_En, Mgno_Cpx, Jd, CaTs, CaTi, DiHd_1996, DiHd_2003, En_Fs), cations on bases of 6 oxygens (column headings of form Cr2O3_Cpx_cat_6ox), as well as inputted Cpx compositions (column headings of form MgO_Cpx)
- Thermobar.core.calculate_clinopyroxene_liquid_components(*, cpx_comps=None, liq_comps=None, meltmatch=None, Fe3Fet_Liq=None)[source]
- Import clinopyroxene compositions using cpx_comps=My_Cpxs and liquid compositions using liq_comps=My_Liquids,
returns clinopyroxene and liquid components.
- Parameters
- liq_comps: pandas.DataFrame
liquid compositions with column headings SiO2_Liq, MgO_Liq etc.
- AND
- cpx_comps: pandas.DataFrame
clinopyroxene compositions with column headings SiO2_Cpx, MgO_Cpx etc.
OR meltmatch: pandas.DataFrame
Panda DataFrame of merged clinopyroxene and liquid compositions used for melt matching
- Fe3Fet_Liq: opt, int, float, pandas.Series
overwrites Fe3FeT ratio inliquid input
- pandas DataFrame
Merged dataframe of inputted liquids, liquid mole fractions, liquid cation fractions, inputted cpx compositions, cpx cations on 6 oxygen basis, cpx components and cpx-liquid components.
- Thermobar.core.calculate_cpx_liq_eq_tests(*, meltmatch=None, liq_comps=None, cpx_comps=None, Fe3Fet_Liq=None, P=None, T=None, sigma=1, Kd_Err=0.03)[source]
calculates Kd Fe-Mg, EnFs, DiHd, CaTs for cpx-liquid pairs
- Parameters
- cpx_comps: pandas.DataFrame
Clinopyroxene compositions with column headings SiO2_Cpx, MgO_Cpx etc.
- liq_comps: pandas.DataFrame
Liquid compositions with column headings SiO2_Liq, MgO_Liq etc.
- meltmatch: pandas.DataFrame
Combined Cpx-Liquid compositions. Used for “melt match” functionality.
- P_kbar: int, float, pandas.Series
Pressure in kbar at which to evaluate equilibrium tests
- T: int, float, pandas.Series
Temprature in K at which to evaluate equilibrium tests
- Fe3Fet_Liq: int, float, pandas.Series (optional)
Fe3FeT ratio used to assess Kd Fe-Mg equilibrium between cpx and melt. If None, uses Fe3Fet_Liq from liq_comps. If specified, overwrites the Fe3Fet_Liq column in the liquid input.
- sigma: int or float
determines sigma level at which to consider the DiHd, EnFs and CaTs tests laid out by Neave et al. (2019)
- Kd_Err: int or float
deviation from the Kd value of Putirka (2008) for the equilibrium tests of Neave et al. (2019)
- Returns
- DataFrame
Equilibrium tests, cation fractions, and inputted liquid and cpx compositions.
- Thermobar.core.calculate_cpx_opx_eq_tests(cpx_comps, opx_comps)[source]
Import Cpx and Opx compositions, assesses degree of Fe-Mg disequilibrium. :param cpx_comps: Cpx compositions with column headings SiO2_Cpx, MgO_Cpx etc. :type cpx_comps: pandas.DataFrame :param opx_comps: Cpx compositions with column headings SiO2_Opx, MgO_Opx etc. :type opx_comps: pandas.DataFrame
- Returns:
Return all opx and cpx components, as well as values for Kd-Fe Opx-Cpx.
- Return type:
pandas DataFrame
- Thermobar.core.calculate_hydrous_cat_fractions_liquid(liq_comps, oxide_headers=False)[source]
Import Liq compositions using liq_comps=My_Liquids, returns anhydrous cation fractions
- Parameters
- liq_comps: pandas.DataFrame
liquid compositions with column headings SiO2_Liq, TiO2_Liq etc.
- oxide_headers=False
- oxide_headers: bool
default=False, returns as Ti_Liq_cat_prop. =True returns Ti_Liq_cat_prop. This is used for rapid matrix division for pre-processing of data for cation fractions etc
- pandas DataFrame
anhydrous cation fractions for the liquid with column headings of the form ..Liq_cat_frac
- Thermobar.core.calculate_hydrous_cat_proportions_liquid(liq_comps)[source]
Import Liq compositions using liq_comps=My_Liquids, returns anhydrous cation proportions (e.g., mole proportions * no of cations)
- Parameters
- liq_comps: pandas.DataFrame
liquid compositions with column headings SiO2_Liq, TiO2_Liq etc.
- pandas DataFrame
hydrous cation proportions for the liquid with column headings of the form …Liq_cat_prop_hyd
- Thermobar.core.calculate_hydrous_mol_fractions_liquid(liq_comps)[source]
Import Liq compositions using liq_comps=My_Liquids, returns anhydrous mole fractions
- Parameters
- liq_comps: pandas.DataFrame
liquid compositions with column headings SiO2_Liq, TiO2_Liq etc.
- pandas DataFrame
anhydrous mole fractions for the liquid with column headings of the form SiO2_Liq_mol_frac
- Thermobar.core.calculate_hydrous_mol_fractions_liquid_redox(liq_comps)[source]
Import Liq compositions using liq_comps=My_Liquids, returns anhydrous mole fractions
- Parameters
- liq_comps: pandas.DataFrame
liquid compositions with column headings SiO2_Liq, TiO2_Liq etc.
- pandas DataFrame
anhydrous mole fractions for the liquid with column headings of the form SiO2_Liq_mol_frac
- Thermobar.core.calculate_hydrous_mol_proportions_liquid(liq_comps)[source]
Import Liq compositions using liq_comps=My_Liquids, returns anhydrous mole proportions
- Parameters
- liq_comps: pandas.DataFrame
liquid compositions with column headings SiO2_Liq, TiO2_Liq etc.
- pandas DataFrame
anhydrous mole proportions for the liquid with column headings of the ..Liq_mol_prop
- Thermobar.core.calculate_hydrous_mol_proportions_liquid_redox(liq_comps)[source]
Import Liq compositions using liq_comps=My_Liquids, returns anhydrous mole proportions
- Parameters
- liq_comps: pandas.DataFrame
liquid compositions with column headings SiO2_Liq, TiO2_Liq etc.
- pandas DataFrame
anhydrous mole proportions for the liquid with column headings of the ..Liq_mol_prop
- Thermobar.core.calculate_liq_mgno(liq_comps, Fe3Fet_Liq=None)[source]
calculates Liquid Mg#
- Parameters
- liq_comps: pandas.DataFrame
liquid compositions with column headings SiO2_Liq, TiO2_Liq etc.
- Fe3FeT: opt, float, pandas.Series, int
Overwrites Fe3Fet_Liq column if specified
- pandas Series
Mg# of liquid
- Thermobar.core.calculate_logfo2_from_buffer_pos(*, buffer='QFM', T_K, P_kbar, fo2_offset)[source]
Calculates fo2 value for a specified buffer position
- Parameters:
buffer ('QFM' or 'FMQ', 'NNO', 'C-CO-CO2' or 'CCO', IW', 'WM' or 'MW')
fo2_offset (Offset from buffer position (in log units).)
- Thermobar.core.calculate_logfo2_series(T_K_series, buffer_series, P_kbar_series, fo2_offset_series)[source]
Wrapper function to handle pandas Series or single values for logfo2 calculation.
- Thermobar.core.calculate_mol_fractions_amphibole(amp_comps)[source]
Import amphibole compositions using amp_comps=My_amphiboles, returns mole fractions
- Parameters
- amp_comps: pandas.DataFrame
amphibole compositions with column headings SiO2_Amp, MgO_Amp etc.
- pandas DataFrame
mole fractions for amphiboles with column headings of the form SiO2_Amp_mol_frac
- Thermobar.core.calculate_mol_fractions_kspar(kspar_comps)[source]
Import AlkaliFspar compositions using kspar_comps=My_kspars, returns mole fractions
- Parameters
- kspar_comps: pandas.DataFrame
AlkaliFspar compositions with column headings SiO2_Kspar, MgO_Kspar etc.
- pandas DataFrame
mole fractions for AlkaliFspars with column headings of the form …Kspar_mol_frac
- Thermobar.core.calculate_mol_fractions_olivine(ol_comps)[source]
Import Olivine compositions using ol_comps=My_Olivines, returns mole fractions
- Parameters
- ol_comps: pandas.DataFrame
olivine compositions with column headings SiO2_Ol, MgO_Ol etc.
- pandas DataFrame
mole fractions for olivines with column headings of the form SiO2_Ol_mol_frac
- Thermobar.core.calculate_mol_fractions_olivine_ni(ol_comps)[source]
Import Olivine compositions using ol_comps=My_Olivines, returns mole fractions
- Parameters
- ol_comps: pandas.DataFrame
olivine compositions with column headings SiO2_Ol, MgO_Ol etc.
- pandas DataFrame
mole fractions for olivines with column headings of the form SiO2_Ol_mol_frac
- Thermobar.core.calculate_mol_fractions_plagioclase(*, plag_comps=None)[source]
Import plagioclase compositions using plag_comps=My_plagioclases, returns mole fractions
- Parameters
- plag_comps: pandas.DataFrame
plagioclase compositions with column headings SiO2_Plag, MgO_Plag etc.
- pandas DataFrame
mole fractions for plagioclases with column headings of the form SiO2_Plag_mol_frac
- Thermobar.core.calculate_mol_proportions_amphibole(amp_comps)[source]
Import amphibole compositions using amp_comps=My_amphiboles, returns mole proportions
- Parameters
- amp_comps: pandas.DataFrame
Panda DataFrame of amphibole compositions with column headings SiO2_Amp, MgO_Amp etc.
- pandas DataFrame
mole proportions for amphiboles with column headings of the form SiO2_Amp_mol_prop
- Thermobar.core.calculate_mol_proportions_amphibole_ridolfi(amp_comps)[source]
Import amphibole compositions using amp_comps=My_amphiboles, returns mole proportions
- Parameters
- amp_comps: pandas.DataFrame
Panda DataFrame of amphibole compositions with column headings SiO2_Amp, MgO_Amp etc.
- pandas DataFrame
mole proportions for amphiboles with column headings of the form SiO2_Amp_mol_prop
- Thermobar.core.calculate_mol_proportions_clinopyroxene(cpx_comps)[source]
Import clinopyroxene compositions using cpx_comps=My_Cpxs, returns mole proportions
- Parameters
- cpx_comps: pandas.DataFrame
clinopyroxene compositions with column headings SiO2_Cpx, MgO_Cpx etc.
- pandas DataFrame
mole proportions for clinopyroxene with column headings of the form SiO2_Cpx_mol_prop
- Thermobar.core.calculate_mol_proportions_kspar(*, kspar_comps=None)[source]
Import AlkaliFspar compositions using kspar_comps=My_kspars, returns mole proportions
- Parameters
- kspar_comps: pandas.DataFrame
Panda DataFrame of AlkaliFspar compositions with column headings SiO2_Kspar, MgO_Kspar etc.
- pandas DataFrame
mole proportions for AlkaliFspars with column headings of the form SiO2_Kspar_mol_prop
- Thermobar.core.calculate_mol_proportions_olivine(ol_comps)[source]
Import Olivine compositions using ol_comps=My_Olivines, returns mole proportions
- Parameters
- ol_comps: pandas.DataFrame
Panda DataFrame of olivine compositions with column headings SiO2_Ol, MgO_Ol etc.
- pandas DataFrame
mole proportions for olivines with column headings of the form SiO2_Ol_mol_prop
- Thermobar.core.calculate_mol_proportions_olivine_ni(ol_comps)[source]
Import Olivine compositions using ol_comps=My_Olivines, returns mole proportions
- Parameters
- ol_comps: pandas.DataFrame
olivine compositions with column headings SiO2_Ol, MgO_Ol etc.
- pandas DataFrame
mole proportions for olivines with column headings of the form SiO2_Ol_mol_prop
- Thermobar.core.calculate_mol_proportions_orthopyroxene(opx_comps)[source]
Import orthopyroxene compositions using opx_comps=My_Opxs, returns mole proportions
- Parameters
- opx_comps: pandas.DataFrame
orthopyroxene compositions with column headings SiO2_Opx, MgO_Opx etc.
- pandas DataFrame
mole proportions for orthopyroxene with column headings of the form SiO2_Opx_mol_prop
- Thermobar.core.calculate_mol_proportions_plagioclase(*, plag_comps=None)[source]
Import plagioclase compositions using plag_comps=My_plagioclases, returns mole proportions
- Parameters
- plag_comps: pandas.DataFrame
Panda DataFrame of plagioclase compositions with column headings SiO2_Plag, MgO_Plag etc.
- pandas DataFrame
mole proportions for plagioclases with column headings of the form SiO2_Plag_mol_prop
- Thermobar.core.calculate_orthopyroxene_components(opx_comps)[source]
Import orthopyroxene compositions using opx_comps=My_Opxs, returns orthopyroxene components along with entered Cpx compositions
- Parameters
- opx_comps: pandas.DataFrame
Panda DataFrame of orthopyroxene compositions with column headings SiO2_Cpx, MgO_Cpx etc.
- pandas DataFrame
-orthopyroxene compositions (MgO_Opx etc.) -cations on bases of 6 oxygens (column headings of form Cr2O3_Opx_cat_6ox, as well as Cation_Sum_Opx) -orthopyroxene components (NaAlSi2O6, FmTiAlSiO6, CrAl2SiO6, FmAl2SiO6, CaFmSi2O6, Fm2Si2O6, En_Opx, Di_Opx, Mgno_Opx)
- Thermobar.core.calculate_orthopyroxene_liquid_components(*, opx_comps=None, liq_comps=None, meltmatch=None, Fe3Fet_Liq=None)[source]
- Import orthopyroxene compositions using opx_comps=My_Opxs and liquid compositions using liq_comps=My_Liquids,
returns orthopyroxene and liquid components.
- Parameters
- liq_comps: pandas.DataFrame
liquid compositions with column headings SiO2_Liq, MgO_Liq etc.
- AND
- opx_comps: pandas.DataFrame
orthopyroxene compositions with column headings SiO2_Opx, MgO_Opx etc.
OR meltmatch: pandas.DataFrame
merged orthopyroxene and liquid compositions used for melt matching
- pandas DataFrame
Merged dataframe of inputted liquids, liquid mole fractions, liquid cation fractions, inputted opx compositions, opx cations on 6 oxygen basis, opx components and opx-liquid components.
- Thermobar.core.calculate_oxygens_amphibole(amp_comps)[source]
Import amphiboles compositions using amp_comps=My_Amps, returns number of oxygens (e.g., mol proportions * number of O in formula unit)
- Parameters
- amp_comps: pandas.DataFrame
amphiboles compositions with column headings SiO2_Amp, MgO_Amp etc.
- pandas DataFrame
number of oxygens with column headings of the form SiO2_Amp_ox
- Thermobar.core.calculate_oxygens_clinopyroxene(cpx_comps)[source]
Import clinopyroxene compositions using cpx_comps=My_Cpxs, returns number of oxygens (e.g., mol proportions * number of O in formula unit)
- Parameters
- cpx_comps: pandas.DataFrame
clinopyroxene compositions with column headings SiO2_Cpx, MgO_Cpx etc.
- pandas DataFrame
number of oxygens with column headings of the form SiO2_Cpx_ox
- Thermobar.core.calculate_oxygens_orthopyroxene(opx_comps)[source]
Import orthopyroxene compositions using opx_comps=My_Opxs, returns number of oxygens (e.g., mol proportions * number of O in formula unit)
- Parameters
- opx_comps: pandas.DataFrame
Panda DataFrame of orthopyroxene compositions with column headings SiO2_Opx, MgO_Opx etc.
- pandas DataFrame
number of oxygens with column headings of the form SiO2_Opx_ox
- Thermobar.core.calculate_plag_liq_eq_tests(*, plag_comps=None, liq_comps=None, meltmatch=None, XAb=None, XAn=None, XOr=0, P, T)[source]
Import Plag and Liq compositions, assesses An, Ab and Or equilibrium using the equations of Putirka (2005) :param liq_comps: Cpx compositions with column headings SiO2_Liq, MgO_Liq etc. :type liq_comps: pandas.DataFrame :param One of: :param 1) plag_comps: Plag compositions with column headings SiO2_Plag, MgO_Plag etc. :type 1) plag_comps: pandas.DataFrame (optional)
- XAn, XAb, XOr, float, int, pandas.Series
If plag_comps is None, enter XAn and XAb for plagioclases instead. XOr is set to zero by default, but can be overwritten for equilibrium tests
3) meltmatch (pandas dataframe), dont need Liq compositions. Used for plag-liq melt matching code.
- P: int, float, pandas.Series
Pressure in kbar
- T: int, float, pandas.Series
Temperature in Kelvin
- Returns:
Return all plag components, liq compnoents, and and cpx components, as well as values for Observed Kd (Ab-An), which Putirka (2008) suggests is the best equilibrium test. Also calculate Delta_An, which is the absolute value of measured An - predicted An from Putirka (2008).
- Return type:
pandas DataFrame
- Thermobar.core.classify_phases(filename=None, sheet_name=None, df=None, return_end_members=False, str_to_drop=None)[source]
Function in progress
- Thermobar.core.convert_fe_partition_to_fo2(*, liq_comps, T_K, P_kbar, model='Kress1991', Fe3Fet_Liq=None, renorm=False)[source]
Calculates delta fo2 relative to QFM and NNO buffer for liq compositions with FeO and Fe2O3
- Parameters
- liq_comps: pandas.DataFrame
Liquid compositions with column headings SiO2_Liq, MgO_Liq, FeO_Liq and Fe2O3_Liq etc. Or, have FeOt_Liq and Fe3Fet_Liq terms. In which case, you can overwrite with
- T_K: int, flt, pandas.Series
Temperature in Kelvin (buffer positions are very T-sensitive)
- P_kbar: int, flt, pandas.Series
Pressure in Kbar (Buffer positions are slightly sensitive to pressure)
- model: str
“Kress1991” - Uses Kress and Carmichael 1991 to calculate XFe2Fe3 from fo2 “Put2016_eq6b” - Uses Putirka (2016) expression to calculate XFe2Fe3 from fo2
- renorm: bool
Following excel code of K. Iacovino. If True, renormalizes other oxide concentrations to account for change in total following partitioning of Fe into FeO and Fe2O3.
liquid compositions with calculated Fe3FeT_Liq, FeO_Liq, Fe2O3_Liq, and XFe3Fe2.
- Thermobar.core.convert_fo2_to_buffer(fo2=None, T_K=None, P_kbar=None)[source]
Converts fo2 in bars to deltaNNO and delta QFM using Frost 1991, ONeill et al. (2018) and the equation in Petrolog3. based on user-entered T in Kelvin and P in kbar
- Thermobar.core.convert_fo2_to_fe_partition(*, liq_comps, T_K, P_kbar, model='Kress1991', fo2, renorm=False, fo2_offset=0)[source]
Calculates Fe3Fet_Liq, FeO and Fe2O3 based on user-specified buffer or fo2 value (in bars)
- Parameters
- liq_comps: pandas.DataFrame
Liquid compositions with column headings SiO2_Liq, MgO_Liq etc.
- T_K: int, flt, pandas.Series
Temperature in Kelvin (buffer positions are very T-sensitive)
- P_kbar: int, flt, pandas.Series
Pressure in Kbar (Buffer positions are slightly sensitive to pressure)
- fo2: str (“QFM”, “NNO”) or int, flt, pandas.Series
Either a value of fo2 (enter 10*logfo2), or buffer position as a string So far, includes QFM or NNO fo2 in bars.
- fo2_offset: int, flt, pandas.Series
log units offset from buffer, e.g., could specify fo2=QFM, fo2_offset=1 to perform calculations at QFM+1
- model: str
“Kress1991” - Uses Kress and Carmichael 1991 to calculate XFe2Fe3 from fo2 “Put2016_eq6b” - Uses Putirka (2016) expression to calculate XFe2Fe3 from fo2
- renorm: bool
Following excel code of K. Iacovino. If True, renormalizes other oxide concentrations to account for change in total following partitioning of Fe into FeO and Fe2O3.
liquid compositions with calculated Fe3Fet_Liq, FeO_Liq, Fe2O3_Liq, and XFe3Fe2.
- Thermobar.core.convert_oxide_percent_to_element_weight_percent(df, suffix=None, without_oxygen=False, anhydrous=True)[source]
Converts oxide wt% to elemental wt% including oxygen by default
- Parameters
- df: pandas.DataFrame
Data frame of oxide compositions. Can have suffixes like “_Amp” in which case you need to specify suffix=”_Amp”
- without_oxygen: str
default False, element wt% doesnt sum to 100.] if true, all elements sum to 100 w/o oxygen.
returns: pandas.DataFrame wt% of elements
- Thermobar.core.get_amp_sites2(amp_apfu_df)[source]
get_amp_sites takes generalized atom per formula unit calculations from calculate_23oxygens_amphibole and puts them in the proper cation sites according to Leake et al., 1997.
- Parameters:
amp_apfu_df (pandas DataFrame) – This is the dataframe output from calculate_23oxygens_amphibole. You should not have to modify this dataframe at all.
- Returns:
sites_df – a samples by cation sites dimension dataframe where each column corresponds to a cation site in amphibole. The suffix at the end corresponds to which site the cation is in:
T = tetrahedral sites (8 total) C = octahedral sites (5 total) B = M4 sites (2 total) A = A site (0 - 1 total)
- Return type:
pandas DataFrame
- Thermobar.core.get_amp_sites_ferric_ferrous(amp_apfu_df)[source]
get_amp_sites_ferric_ferrous is very similar to get_amp_sites, however it now incorporates the newly calculated Fe2O3 and FeO apfu values such that all Fe2O3 gets incorporated into the octahedral sites before any FeO. For more information see Leake et al., 1997 Appendix A.
- Parameters:
amp_apfu_df (pandas DataFrame) – amphibole apfu values for each cation, now reflecting Fe2O3 and FeO values. This is the output from amp_components_ferric_ferrous and does not need to be modified at all.
- Returns:
sites_df (pandas DataFrame)
a samples by cation sites dimension dataframe where each column corresponds – to a cation site in amphibole. The suffix at the end corresponds to which site the cation is in:
T = tetrahedral sites (8 total) C = octahedral sites (5 total) B = M4 sites (2 total) A = A site (0 - 1 total)
See Leake et al., 1997 for a discussion on cation site prioritization
- Thermobar.core.get_amp_sites_ferric_ferrous_mutch(amp_apfu_df)[source]
get_amp_sites_ferric_ferrous is very similar to get_amp_sites, however it now incorporates the newly calculated Fe2O3 and FeO apfu values such that all Fe2O3 gets incorporated into the octahedral sites before any FeO. For more information see Leake et al., 1997 Appendix A.
- Parameters:
amp_apfu_df (pandas DataFrame) – amphibole apfu values for each cation, now reflecting Fe2O3 and FeO values. This is the output from amp_components_ferric_ferrous and does not need to be modified at all.
- Returns:
sites_df (pandas DataFrame)
a samples by cation sites dimension dataframe where each column corresponds – to a cation site in amphibole. The suffix at the end corresponds to which site the cation is in:
T = tetrahedral sites (8 total) C = octahedral sites (5 total) B = M4 sites (2 total) A = A site (0 - 1 total)
See Leake et al., 1997 for a discussion on cation site prioritization
- Thermobar.core.get_amp_sites_from_input(amp_comps)[source]
get amp_sites from amp_comps input from import_excel() function.
- Thermobar.core.get_amp_sites_from_input_not_amp(dfin, col_drop)[source]
get amp_sites from amp_comps input from import_excel() function.
- Thermobar.core.get_amp_sites_leake(amp_apfu_df)[source]
get_amp_sites takes generalized atom per formula unit calculations from calculate_23oxygens_amphibole and puts them in the proper cation sites according to Leake et al., 1997.
- Parameters:
amp_apfu_df (pandas DataFrame) – This is the dataframe output from calculate_23oxygens_amphibole. You should not have to modify this dataframe at all.
- Returns:
sites_df – a samples by cation sites dimension dataframe where each column corresponds to a cation site in amphibole. The suffix at the end corresponds to which site the cation is in:
T = tetrahedral sites (8 total) C = octahedral sites (5 total) B = M4 sites (2 total) A = A site (0 - 1 total)
- Return type:
pandas DataFrame
- Thermobar.core.get_amp_sites_mutch(amp_apfu_df)[source]
get_amp_sites takes generalized atom per formula unit calculations from calculate_23oxygens_amphibole and puts them in the proper cation sites according to the spreasheet of Mutch et al. Gives negative numbers for Na. .
- Parameters:
amp_apfu_df (pandas DataFrame) – This is the dataframe output from calculate_23oxygens_amphibole. You should not have to modify this dataframe at all.
- Returns:
sites_df – a samples by cation sites dimension dataframe where each column corresponds to a cation site in amphibole. The suffix at the end corresponds to which site the cation is in:
T = tetrahedral sites (8 total) C = octahedral sites (5 total) B = M4 sites (2 total) A = A site (0 - 1 total)
- Return type:
pandas DataFrame