Main Model#

class peridoxia.main.ModelRun(initial_assemblage: Assemblage | None = None, melting: bool = True, melting_method: str = 'fractional', potential_temperature_C: float = 1350, P_range_GPa: list[float] = [4, 0.1], P_step: float = -0.01, gt_out_P_range_GPa: list[float] = [3.0, 2.799], label: str = 'Model Run', color: str = 'k', gt_out_rxn_wts: dict = {'gt__pyx_pyxTs': 2, 'gt_olv__spl_pyx': 1}, debug: int = 0, run_model=True)#

This is the main class for running the model.

Parameters:
initial_assemblagedata_struct.Assemblage | None, optional

Initial composition, which must be given as an Assemblage object. See Data Structures for creating an Assemblage from a set of modes/phase compositions. By default None.

meltingbool, optional

If ‘melting’ is set to False, system remains subsolidus. Otherwise, melting proceeds according to P-T-F parametrization. By default True.

melting_methodstr, optional

By default, model performs fractional melting. If melting_method is set to ‘batch’, batch/equilibrium melting will be performed instead. NOTE: batch melting is not extensively tested. By default ‘fractional’.

potential_temperature_Cfloat, optional

Potential temperature for the system, in Celsius. By default 1350.

P_range_GPalist[float], optional

Pressure range for model run, in Gigapascals. If melting is allowed to proceed, model will stop automatically at cpx-out. By default [4,0.1].

P_stepfloat, optional

Pressure interval for each model run step, in Gigapascals. By default -0.01.

gt_out_P_range_GPalist[float], optional

Pressure range of gt-out reactions, in Gigapascals. Default value is from Robinson and Wood (1998).Garnet-out is not currently compositionally dependent. This will be coming in later versions of the model. By default [2.8+0.2,2.8-0.001].

labelstr, optional

Descriptive label for model run. By default ‘Model Run’.

colorstr, optional

Color for plotting model run. By default ‘k’.

gt_out_rxn_wts_type_, optional

Relative amount of the two categories of gt-out reactions. By default {‘gt_olv__spl_pyx’:1, ‘gt__pyx_pyxTs’:2}.

debugint, optional

Can set to 0, 1, or 2 for levels of output. By default 0.

run_modelbool, optional

If set to True, initializing the system will also run the model. If set to False, an empty ModelRun object is created (useful for loading data files). By default True.

Attributes:
FFM

Returns the value of the FFM buffer for each assemblage in the ModelRun object; FFM formulation is the first three terms of the fayalite-ferrosilite-magnetite buffer as compiled by Davis et al.

G_cont_to_fO2

Returns the Gibbs Free Energy contribution to fO2 for each assemblage in the ModelRun object.

PGPa

Returns P (in GPa) for each assemblage in the ModelRun object.

Pbar

Returns P (in bar) for each assemblage in the ModelRun object.

QFM

Returns the value of the QFM buffer for each assemblage in the ModelRun object; QFM formulation is that of Frost (1991).

TC

Returns T (in C) for each assemblage in the ModelRun object.

TK

Returns T (in K) for each assemblage in the ModelRun object.

TK_olv_spl

Returns T (in K) from olivine and spinel compositions using the Li et al., 1995 thermometer for each assemblage in the ModelRun object; This should return the same value as TK, since this is a partitioning constraint.

agg_liq

Returns aggregated liquid phase history object; User can call all PhaseHistory and LiquidHistory attributes on ModelRun.agg_liq object.

color

Returns the color for plotting the ModelRun object

cpx

Returns clinopyroxene phase history object; User can call all PhaseHistory and ClinopyroxeneHistory attributes on ModelRun.cpx object.

gt

Returns garnet phase history object; User can call all PhaseHistory and GarnetHistory attributes on ModelRun.gt object.

initial_assemblage

Returns the initial assemblage.

input_arguments

Returns a dictionary of all input arguments; this dictionary can be used directly as an input argument to ModelRun in order to re-create a run.

label

Returns the label for the ModelRun object.

liq

Returns incremental liquid phase history object; User can call all PhaseHistory and LiquidHistory attributes on ModelRun.liq object.

logfO2_abs

Returns the absolute logfO2 value of the assemblage, not normalized to any buffer.

logfO2_dFFM

Returns logfO2 relative to FFM buffer; FFM formulation is the first three terms of the fayalite-ferrosilite-magnetite buffer as compiled by Davis et al.

logfO2_dQFM

Returns logfO2 relative to QFM buffer; QFM formulation is that of Frost (1991).

olv

Returns olivine phase history object; User can call all PhaseHistory and OlivineHistory attributes on ModelRun.olv object.

opx

Returns orthopyroxene phase history object; User can call all PhaseHistory and OrthopyroxeneHistory attributes on ModelRun.opx object.

pot_TC

Returns the potential temperature (in C) at which the model run was performed.

pot_TK

Returns the potential temperature (in K) at which the model run was performed.

spl

Returns spinel phase history object; User can call all PhaseHistory and SpinelHistory attributes on ModelRun.spl object.

sys

Returns system (residual solid phases + incremental liquid) phase history object; User can call all PhaseHistory and SystemHistory attributes on ModelRun.sys object.

Methods

get_data_table([method, full_table])

Returns a Pandas dataframe with run results.

load_model_run_from_file(file[, sheet_name, ...])

Loads output from a previous model run.

plot([x, y])

Plots ModelRun attributes.

save_data_table([file_name, data_table, method])

Saves a single model run.

test_run()

Runs a simple test to ensure everything is installed and functioning properly.

classmethod load_model_run_from_file(file: str, sheet_name: str = 'Sheet1', label: str = 'model_run', color: str = 'k', pot_TC=None)#

Loads output from a previous model run.

  • See Files and Templates for template file

  • Current included phases: [‘olv’, ‘opx’, ‘cpx’, ‘spl’, ‘gt’, ‘liq’, ‘agg_liq’]

  • Current included oxides: [‘SiO2’, ‘Al2O3’, ‘Fe2O3’, ‘Cr2O3’, ‘FeO’, ‘MgO’, ‘CaO’]

  • File expects columns: T°C, P (GPa), olv_mass, olv_SiO2, … , opx_mass, opx_SiO2, … , etc… (in any order)

  • Extra columns are added to a dictionary, stored in [model_run].extras

NOTE: This method can be used to load results from other models, such as pMELTS. However, be aware that only the phases/oxides included in this model will be directly considered– other phases/oxides (e.g., plagioclase or Na2O) will be ignored when loading data and creating assemblages. Thus, when calculating properties for pMELTS runs with a wider set of phases/oxides, you will get a different answer here than calculated directly on the pMELTS results. If you wish to plot or otherwise use results that rely on a wider set of phases/oxides, you must externally calculate these fields, add them as columns to your input spreadsheet, and access them through the [model_run].extras dictionary method.

Parameters:
filestr

The path/name of the file to load, e.g. ‘input_file.xlsx’.

sheet_namestr, optional

The Excel sheet to load, by default ‘Sheet1’.

labelstr, optional

A descriptive label for the model run, by default ‘model_run’.

colorstr, optional

The color to use when plotting the model run, by default ‘k’.

pot_TC: float, optional

The potential temperature of the model run, in Celsius, by default None.

Returns:
ModelRun object

A ModelRun object with the assemblage information at each step.

classmethod test_run()#

Runs a simple test to ensure everything is installed and functioning properly.

property input_arguments: dict#

Returns a dictionary of all input arguments; this dictionary can be used directly as an input argument to ModelRun in order to re-create a run.

property initial_assemblage: Assemblage#

Returns the initial assemblage.

property label: str#

Returns the label for the ModelRun object.

property color: str#

Returns the color for plotting the ModelRun object

property pot_TK: float#

Returns the potential temperature (in K) at which the model run was performed.

property pot_TC: float#

Returns the potential temperature (in C) at which the model run was performed.

property TC: ndarray#

Returns T (in C) for each assemblage in the ModelRun object.

property TK: ndarray#

Returns T (in K) for each assemblage in the ModelRun object.

property TK_olv_spl: ndarray#

Returns T (in K) from olivine and spinel compositions using the Li et al., 1995 thermometer for each assemblage in the ModelRun object; This should return the same value as TK, since this is a partitioning constraint.

property PGPa: ndarray#

Returns P (in GPa) for each assemblage in the ModelRun object.

property Pbar: ndarray#

Returns P (in bar) for each assemblage in the ModelRun object.

property G_cont_to_fO2: ndarray#

Returns the Gibbs Free Energy contribution to fO2 for each assemblage in the ModelRun object.

property logfO2_abs: ndarray#

Returns the absolute logfO2 value of the assemblage, not normalized to any buffer.

property FFM: ndarray#

Returns the value of the FFM buffer for each assemblage in the ModelRun object; FFM formulation is the first three terms of the fayalite-ferrosilite-magnetite buffer as compiled by Davis et al. (2017).

property QFM: ndarray#

Returns the value of the QFM buffer for each assemblage in the ModelRun object; QFM formulation is that of Frost (1991).

property logfO2_dFFM: ndarray#

Returns logfO2 relative to FFM buffer; FFM formulation is the first three terms of the fayalite-ferrosilite-magnetite buffer as compiled by Davis et al. (2017).

property logfO2_dQFM: ndarray#

Returns logfO2 relative to QFM buffer; QFM formulation is that of Frost (1991).

property olv#

Returns olivine phase history object; User can call all PhaseHistory and OlivineHistory attributes on ModelRun.olv object.

property opx#

Returns orthopyroxene phase history object; User can call all PhaseHistory and OrthopyroxeneHistory attributes on ModelRun.opx object.

property cpx#

Returns clinopyroxene phase history object; User can call all PhaseHistory and ClinopyroxeneHistory attributes on ModelRun.cpx object.

property spl#

Returns spinel phase history object; User can call all PhaseHistory and SpinelHistory attributes on ModelRun.spl object.

property gt#

Returns garnet phase history object; User can call all PhaseHistory and GarnetHistory attributes on ModelRun.gt object.

property liq#

Returns incremental liquid phase history object; User can call all PhaseHistory and LiquidHistory attributes on ModelRun.liq object.

property agg_liq#

Returns aggregated liquid phase history object; User can call all PhaseHistory and LiquidHistory attributes on ModelRun.agg_liq object.

property sys#

Returns system (residual solid phases + incremental liquid) phase history object; User can call all PhaseHistory and SystemHistory attributes on ModelRun.sys object.

get_data_table(method: str = 'standard', full_table: bool = True) DataFrame#

Returns a Pandas dataframe with run results.

Parameters:
methodstr, optional

Standard method returns P/T/fO2 and phase masses/oxide wt%. Compact method returns P/T/extensive endmembers. By default ‘standard’.

full_tablebool, optional

full_table=True will display the entire table (all rows and columns). By default True.

Returns:
pd.DataFrame

A Pandas dataframe with run results.

save_data_table(file_name='model_output.xlsx', data_table: DataFrame | None = None, method='standard')#

Saves a single model run. To save a set of model runs, use save_data_tables() function in plotting_and_saving module.

Parameters:
file_namestr, optional

The path/file name to save the file to, by default ‘model_output.xlsx’.

data_tablepd.DataFrame | None, optional

The data table to save. By default will use “get_data_table” method, but can be used to save other tables as well (e.g., if you have modified the columns of the table). By default None.

methodstr, optional

See “get_data_table”. By default ‘standard’.

plot(x: str = 'PGPa', y: str = 'logfO2_dFFM')#

Plots ModelRun attributes.

Parameters:
xstr, optional

A string representing the assemblage or phase attribute to plot on the x axis, by default ‘PGPa’.

ystr, optional

A string representing the assemblage or phase attribute to plot on the x axis, by default ‘logfO2_dFFM’.

class peridoxia.main.PhaseHistory(model_run: ModelRun, phs_str: str, name: str, color: str)#

Class for returning properties of individual phases for each assemblage in a ModelRun object.

By default, the ModelRun class creates PhaseHistory objects for olv, opx, cpx, spl, gt, liq, agg_liq, and sys.

  • The methods and properties listed here can be called for each of those phase objects, e.g. “[ModelRunObject].olv.mass”.

  • Each PhaseHistory object also has phase-specific properties, which are listed in the [Phase]History subclasses below.

  • For instance, the OlivineHistory subclass has a Fo_num property, allowing the user to call [ModelRunObject].olv.Fo_num.

  • See Tutorial for more information.

Parameters:
model_runModelRun

The ModelRun object from which to load the phase data.

phs_strstr

The phase string representing the phase type: ‘olv’, ‘opx’, ‘cpx’, ‘gt’, ‘spl’, ‘liq’, ‘sys’. This tells PhaseHistory which type of object to create.

namestr

The name of the phase instance. Often the same as the phase string, but may be different– e.g., for the aggregated liquid, ‘agg_liq’ would be the name, whereas ‘liq’ would be the phase type string.

colorstr

The color for plotting the phase.

Attributes:
Cr_num

Returns an array of Cr# values (Cr/(Cr+Al)) for the given phase for each assemblage in the ModelRun object.

Fe3_Al

Returns an array of Fe3/Al ratios for the given phase for each assemblage in the ModelRun object.

Fe3_tFe

Returns an array of Fe3+/tFe ratios for the given phase for each assemblage in the ModelRun object.

Mg_num

Returns an array of Mg# values (Mg/(Mg+Fe2+)) for the given phase for each assemblage in the ModelRun object.

ext_end_mol

Returns an array of extensive endmember moles for the given phase for each assemblage in the ModelRun object.

mass

Returns an array of masses for the given phase for each assemblage in the ModelRun object.

mol_cat

Returns an array of cation moles (per 100 g of oxides) for the given phase for each assemblage in the ModelRun object; Cation order is same as oxide order, and can be retrieved by calling [self].oxide_order.

name

Returns the name of the phase, which represents the name of the phase instance; Often the same as the phase string, but may be different– e.g., for the aggregated liquid, ‘agg_liq’ would be the name, whereas ‘liq’ would be the phase type.

oxide_order

Returns an array of strings representing the order of oxides when returned by the model.

oxides

Returns an array of oxides, normalized to 100 wt%, for the given phase for each assemblage in the ModelRun object; Oxide order can be retrieved by calling [self].oxide_order.

phs_obj_list

Returns a list of Phase objectes for the given phase for each assemblage in the ModelRun object.

phs_str

Returns the phase string, which represents the type of phase: e.g., ‘olv’, ‘opx’, ‘liq’, ‘sys’, etc.

property phs_obj_list: list#

Returns a list of Phase objectes for the given phase for each assemblage in the ModelRun object.

property phs_str: str#

Returns the phase string, which represents the type of phase: e.g., ‘olv’, ‘opx’, ‘liq’, ‘sys’, etc. (but not ‘agg_liq’, which is a Liquid phase object).

property name: str#

Returns the name of the phase, which represents the name of the phase instance; Often the same as the phase string, but may be different– e.g., for the aggregated liquid, ‘agg_liq’ would be the name, whereas ‘liq’ would be the phase type.

property ext_end_mol: ndarray#

Returns an array of extensive endmember moles for the given phase for each assemblage in the ModelRun object.

property mass: ndarray#

Returns an array of masses for the given phase for each assemblage in the ModelRun object.

property oxides: ndarray#

Returns an array of oxides, normalized to 100 wt%, for the given phase for each assemblage in the ModelRun object; Oxide order can be retrieved by calling [self].oxide_order.

property oxide_order: ndarray#

Returns an array of strings representing the order of oxides when returned by the model.

property mol_cat: ndarray#

Returns an array of cation moles (per 100 g of oxides) for the given phase for each assemblage in the ModelRun object; Cation order is same as oxide order, and can be retrieved by calling [self].oxide_order.

property Fe3_Al: ndarray#

Returns an array of Fe3/Al ratios for the given phase for each assemblage in the ModelRun object.

property Fe3_tFe: ndarray#

Returns an array of Fe3+/tFe ratios for the given phase for each assemblage in the ModelRun object.

property Cr_num: ndarray#

Returns an array of Cr# values (Cr/(Cr+Al)) for the given phase for each assemblage in the ModelRun object.

property Mg_num: ndarray#

Returns an array of Mg# values (Mg/(Mg+Fe2+)) for the given phase for each assemblage in the ModelRun object.

class peridoxia.main.OlivineHistory(model_run: ModelRun, name: str = 'olv', color: str = 'springgreen')#

Class for olivine properties over the course of a model run. Inherits from PhaseHistory, so all PhaseHistory properties can be accessed in addition to the olivine-specific properties indicated here.

Parameters:
model_runModelRun

The ModelRun object from which to load the phase data.

namestr, optional

The name of the phase instance, by default ‘olv’.

colorstr, optional

The color for plotting the phase, by default ‘springgreen’.

Attributes:
Cr_num

Returns an array of Cr# values (Cr/(Cr+Al)) for the given phase for each assemblage in the ModelRun object.

Fe3_Al

Returns an array of Fe3/Al ratios for the given phase for each assemblage in the ModelRun object.

Fe3_tFe

Returns an array of Fe3+/tFe ratios for the given phase for each assemblage in the ModelRun object.

Fo_num

Returns an array of Fo# values (100*Mg/(Mg+Fe2+)) in olivine for each assemblage in the ModelRun object.

Mg_num

Returns an array of Mg# values (Mg/(Mg+Fe2+)) for the given phase for each assemblage in the ModelRun object.

ext_end_mol

Returns an array of extensive endmember moles for the given phase for each assemblage in the ModelRun object.

fO2_cont

Returns an array of fO2 contributions (-12*log(1-Mg_num) - 2620*(Mg_num)^2/T) in olivine for each assemblage in the ModelRun object.

mass

Returns an array of masses for the given phase for each assemblage in the ModelRun object.

mol_cat

Returns an array of cation moles (per 100 g of oxides) for the given phase for each assemblage in the ModelRun object; Cation order is same as oxide order, and can be retrieved by calling [self].oxide_order.

name

Returns the name of the phase, which represents the name of the phase instance; Often the same as the phase string, but may be different– e.g., for the aggregated liquid, ‘agg_liq’ would be the name, whereas ‘liq’ would be the phase type.

oxide_order

Returns an array of strings representing the order of oxides when returned by the model.

oxides

Returns an array of oxides, normalized to 100 wt%, for the given phase for each assemblage in the ModelRun object; Oxide order can be retrieved by calling [self].oxide_order.

phs_obj_list

Returns a list of Phase objectes for the given phase for each assemblage in the ModelRun object.

phs_str

Returns the phase string, which represents the type of phase: e.g., ‘olv’, ‘opx’, ‘liq’, ‘sys’, etc.

property Fo_num: ndarray#

Returns an array of Fo# values (100*Mg/(Mg+Fe2+)) in olivine for each assemblage in the ModelRun object.

property fO2_cont: ndarray#

Returns an array of fO2 contributions (-12*log(1-Mg_num) - 2620*(Mg_num)^2/T) in olivine for each assemblage in the ModelRun object.

class peridoxia.main.OrthopyroxeneHistory(model_run: ModelRun, name: str = 'opx', color: str = 'darkolivegreen')#

Class for orthopyroxene properties over the course of a model run. Inherits from PhaseHistory, so all PhaseHistory properties can be accessed in addition to the orthopyroxene-specific properties indicated here.

Parameters:
model_runModelRun

The ModelRun object from which to load the phase data.

namestr, optional

The name of the phase instance, by default ‘opx’.

colorstr, optional

The color for plotting the phase, by default ‘darkolivegreen’.

Attributes:
Al_per_6_O

Returns an array of total Al per 6 Oxygen in orthopyroxene for each assemblage in the ModelRun object.

Cr_num

Returns an array of Cr# values (Cr/(Cr+Al)) for the given phase for each assemblage in the ModelRun object.

Fe3_Al

Returns an array of Fe3/Al ratios for the given phase for each assemblage in the ModelRun object.

Fe3_tFe

Returns an array of Fe3+/tFe ratios for the given phase for each assemblage in the ModelRun object.

Mg_num

Returns an array of Mg# values (Mg/(Mg+Fe2+)) for the given phase for each assemblage in the ModelRun object.

Ts_per_6_O

Returns an array of Al_VI+Cr_VI per 6 Oxygen as a proxy for Ts per 6 Oxygen in orthopyroxene for each assemblage in the ModelRun object.

XM1XM2

Returns an array of (X_Fe2+)_M1*(X_Fe3+)_M2 in orthopyroxene for each assemblage in the ModelRun object; Gives slightly different result than original XM1XM2 calculator because it takes Fe3+ vs Fe2+ into account (differences are on the order of 0.01 log units contribution to fO2).

ext_end_mol

Returns an array of extensive endmember moles for the given phase for each assemblage in the ModelRun object.

fO2_cont

Returns an array of fO2 contributions (3*log(XM1XM2)) in orthopyroxene for each assemblage in the ModelRun object.

mass

Returns an array of masses for the given phase for each assemblage in the ModelRun object.

mol_cat

Returns an array of cation moles (per 100 g of oxides) for the given phase for each assemblage in the ModelRun object; Cation order is same as oxide order, and can be retrieved by calling [self].oxide_order.

name

Returns the name of the phase, which represents the name of the phase instance; Often the same as the phase string, but may be different– e.g., for the aggregated liquid, ‘agg_liq’ would be the name, whereas ‘liq’ would be the phase type.

oxide_order

Returns an array of strings representing the order of oxides when returned by the model.

oxides

Returns an array of oxides, normalized to 100 wt%, for the given phase for each assemblage in the ModelRun object; Oxide order can be retrieved by calling [self].oxide_order.

phs_obj_list

Returns a list of Phase objectes for the given phase for each assemblage in the ModelRun object.

phs_str

Returns the phase string, which represents the type of phase: e.g., ‘olv’, ‘opx’, ‘liq’, ‘sys’, etc.

property Ts_per_6_O: ndarray#

Returns an array of Al_VI+Cr_VI per 6 Oxygen as a proxy for Ts per 6 Oxygen in orthopyroxene for each assemblage in the ModelRun object.

property Al_per_6_O: ndarray#

Returns an array of total Al per 6 Oxygen in orthopyroxene for each assemblage in the ModelRun object.

property XM1XM2: ndarray#

Returns an array of (X_Fe2+)_M1*(X_Fe3+)_M2 in orthopyroxene for each assemblage in the ModelRun object; Gives slightly different result than original XM1XM2 calculator because it takes Fe3+ vs Fe2+ into account (differences are on the order of 0.01 log units contribution to fO2).

property fO2_cont: ndarray#

Returns an array of fO2 contributions (3*log(XM1XM2)) in orthopyroxene for each assemblage in the ModelRun object.

class peridoxia.main.ClinopyroxeneHistory(model_run: ModelRun, name: str = 'cpx', color: str = 'green')#

Class for clinopyroxene properties over the course of a model run. Inherits from PhaseHistory, so all PhaseHistory properties can be accessed in addition to the clinopyroxene-specific properties indicated here.

Parameters:
model_runModelRun

The ModelRun object from which to load the phase data.

namestr, optional

The name of the phase instance, by default ‘cpx’.

colorstr, optional

The color for plotting the phase, by default ‘green’.

Attributes:
Al_per_6_O

Returns an array of total Al per 6 Oxygen in clinopyroxene for each assemblage in the ModelRun object.

Cr_num

Returns an array of Cr# values (Cr/(Cr+Al)) for the given phase for each assemblage in the ModelRun object.

Fe3_Al

Returns an array of Fe3/Al ratios for the given phase for each assemblage in the ModelRun object.

Fe3_tFe

Returns an array of Fe3+/tFe ratios for the given phase for each assemblage in the ModelRun object.

Mg_num

Returns an array of Mg# values (Mg/(Mg+Fe2+)) for the given phase for each assemblage in the ModelRun object.

Ts_per_6_O

Returns an array of Al_VI+Cr_VI per 6 Oxygen as a proxy for Ts per 6 Oxygen in clinopyroxene for each assemblage in the ModelRun object.

ext_end_mol

Returns an array of extensive endmember moles for the given phase for each assemblage in the ModelRun object.

mass

Returns an array of masses for the given phase for each assemblage in the ModelRun object.

mol_cat

Returns an array of cation moles (per 100 g of oxides) for the given phase for each assemblage in the ModelRun object; Cation order is same as oxide order, and can be retrieved by calling [self].oxide_order.

name

Returns the name of the phase, which represents the name of the phase instance; Often the same as the phase string, but may be different– e.g., for the aggregated liquid, ‘agg_liq’ would be the name, whereas ‘liq’ would be the phase type.

oxide_order

Returns an array of strings representing the order of oxides when returned by the model.

oxides

Returns an array of oxides, normalized to 100 wt%, for the given phase for each assemblage in the ModelRun object; Oxide order can be retrieved by calling [self].oxide_order.

phs_obj_list

Returns a list of Phase objectes for the given phase for each assemblage in the ModelRun object.

phs_str

Returns the phase string, which represents the type of phase: e.g., ‘olv’, ‘opx’, ‘liq’, ‘sys’, etc.

property Ts_per_6_O: ndarray#

Returns an array of Al_VI+Cr_VI per 6 Oxygen as a proxy for Ts per 6 Oxygen in clinopyroxene for each assemblage in the ModelRun object.

property Al_per_6_O: ndarray#

Returns an array of total Al per 6 Oxygen in clinopyroxene for each assemblage in the ModelRun object.

class peridoxia.main.SpinelHistory(model_run: ModelRun, name: str = 'spl', color: str = 'black')#

Class for spinel properties over the course of a model run. Inherits from PhaseHistory, so all PhaseHistory properties can be accessed in addition to the spinel-specific properties indicated here.

Parameters:
model_runModelRun

The ModelRun object from which to load the phase data.

namestr, optional

The name of the phase instance, by default ‘spl’.

colorstr, optional

The color for plotting the phase, by default ‘black’.

Attributes:
Cr_num

Returns an array of Cr# values (Cr/(Cr+Al)) for the given phase for each assemblage in the ModelRun object.

Fe3_Al

Returns an array of Fe3/Al ratios for the given phase for each assemblage in the ModelRun object.

Fe3_tFe

Returns an array of Fe3+/tFe ratios for the given phase for each assemblage in the ModelRun object.

Mg_num

Returns an array of Mg# values (Mg/(Mg+Fe2+)) for the given phase for each assemblage in the ModelRun object.

aFe3O4

Returns an array of magnetite activity in spinel for each assemblage in the ModelRun object; Magnetite activity is calculated via the ThermoEngine python package (enki-portal.org) using the spinel activity models of Sack and Ghiorso (1991ab).

ext_end_mol

Returns an array of extensive endmember moles for the given phase for each assemblage in the ModelRun object.

fO2_cont

Returns an array of fO2 contributions (2*log(aFe3O4)) in spinel for each assemblage in the ModelRun object; Magnetite activity is calculated via the ThermoEngine python package (enki-portal.org) using the spinel activity models of Sack and Ghiorso (1991ab).

mass

Returns an array of masses for the given phase for each assemblage in the ModelRun object.

mol_cat

Returns an array of cation moles (per 100 g of oxides) for the given phase for each assemblage in the ModelRun object; Cation order is same as oxide order, and can be retrieved by calling [self].oxide_order.

name

Returns the name of the phase, which represents the name of the phase instance; Often the same as the phase string, but may be different– e.g., for the aggregated liquid, ‘agg_liq’ would be the name, whereas ‘liq’ would be the phase type.

oxide_order

Returns an array of strings representing the order of oxides when returned by the model.

oxides

Returns an array of oxides, normalized to 100 wt%, for the given phase for each assemblage in the ModelRun object; Oxide order can be retrieved by calling [self].oxide_order.

phs_obj_list

Returns a list of Phase objectes for the given phase for each assemblage in the ModelRun object.

phs_str

Returns the phase string, which represents the type of phase: e.g., ‘olv’, ‘opx’, ‘liq’, ‘sys’, etc.

property aFe3O4: ndarray#

Returns an array of magnetite activity in spinel for each assemblage in the ModelRun object; Magnetite activity is calculated via the ThermoEngine python package (enki-portal.org) using the spinel activity models of Sack and Ghiorso (1991ab).

property fO2_cont: ndarray#

Returns an array of fO2 contributions (2*log(aFe3O4)) in spinel for each assemblage in the ModelRun object; Magnetite activity is calculated via the ThermoEngine python package (enki-portal.org) using the spinel activity models of Sack and Ghiorso (1991ab).

class peridoxia.main.GarnetHistory(model_run: ModelRun, name: str = 'gt', color: str = 'purple')#

Class for garnet properties over the course of a model run. Inherits from PhaseHistory, so all PhaseHistory properties can be accessed in addition to the garnet-specific properties indicated here.

Parameters:
model_runModelRun

The ModelRun object from which to load the phase data.

namestr, optional

The name of the phase instance, by default ‘gt’.

colorstr, optional

The color for plotting the phase, by default ‘purple’.

Attributes:
Ca_mass_ratio

Returns an array of Ca-garnet/Fe-Mg-garnet mass ratios for each assemblage in the ModelRun object.

Cr_num

Returns an array of Cr# values (Cr/(Cr+Al)) for the given phase for each assemblage in the ModelRun object.

Fe3_Al

Returns an array of Fe3/Al ratios for the given phase for each assemblage in the ModelRun object.

Fe3_tFe

Returns an array of Fe3+/tFe ratios for the given phase for each assemblage in the ModelRun object.

Mg_num

Returns an array of Mg# values (Mg/(Mg+Fe2+)) for the given phase for each assemblage in the ModelRun object.

ext_end_mol

Returns an array of extensive endmember moles for the given phase for each assemblage in the ModelRun object.

mass

Returns an array of masses for the given phase for each assemblage in the ModelRun object.

mol_cat

Returns an array of cation moles (per 100 g of oxides) for the given phase for each assemblage in the ModelRun object; Cation order is same as oxide order, and can be retrieved by calling [self].oxide_order.

name

Returns the name of the phase, which represents the name of the phase instance; Often the same as the phase string, but may be different– e.g., for the aggregated liquid, ‘agg_liq’ would be the name, whereas ‘liq’ would be the phase type.

oxide_order

Returns an array of strings representing the order of oxides when returned by the model.

oxides

Returns an array of oxides, normalized to 100 wt%, for the given phase for each assemblage in the ModelRun object; Oxide order can be retrieved by calling [self].oxide_order.

phs_obj_list

Returns a list of Phase objectes for the given phase for each assemblage in the ModelRun object.

phs_str

Returns the phase string, which represents the type of phase: e.g., ‘olv’, ‘opx’, ‘liq’, ‘sys’, etc.

property Ca_mass_ratio: ndarray#

Returns an array of Ca-garnet/Fe-Mg-garnet mass ratios for each assemblage in the ModelRun object.

class peridoxia.main.LiquidHistory(model_run: ModelRun, name: str = 'liq', color: str = 'red')#

Class for liquid properties over the course of a model run. Inherits from PhaseHistory, so all PhaseHistory properties can be accessed in addition to the liquid-specific properties indicated here.

Parameters:
model_runModelRun

The ModelRun object from which to load the phase data.

namestr, optional

The name of the phase instance, by default ‘liq’.

colorstr, optional

The color for plotting the phase, by default ‘red’.

Attributes:
Cr_num

Returns an array of Cr# values (Cr/(Cr+Al)) for the given phase for each assemblage in the ModelRun object.

Fe3_Al

Returns an array of Fe3/Al ratios for the given phase for each assemblage in the ModelRun object.

Fe3_tFe

Returns an array of Fe3+/tFe ratios for the given phase for each assemblage in the ModelRun object.

Mg_num

Returns an array of Mg# values (Mg/(Mg+Fe2+)) for the given phase for each assemblage in the ModelRun object.

ext_end_mol

Returns an array of extensive endmember moles for the given phase for each assemblage in the ModelRun object.

mass

Returns an array of masses for the given phase for each assemblage in the ModelRun object.

mol_cat

Returns an array of cation moles (per 100 g of oxides) for the given phase for each assemblage in the ModelRun object; Cation order is same as oxide order, and can be retrieved by calling [self].oxide_order.

name

Returns the name of the phase, which represents the name of the phase instance; Often the same as the phase string, but may be different– e.g., for the aggregated liquid, ‘agg_liq’ would be the name, whereas ‘liq’ would be the phase type.

oxide_order

Returns an array of strings representing the order of oxides when returned by the model.

oxides

Returns an array of oxides, normalized to 100 wt%, for the given phase for each assemblage in the ModelRun object; Oxide order can be retrieved by calling [self].oxide_order.

phs_obj_list

Returns a list of Phase objectes for the given phase for each assemblage in the ModelRun object.

phs_str

Returns the phase string, which represents the type of phase: e.g., ‘olv’, ‘opx’, ‘liq’, ‘sys’, etc.

Methods

fO2_Borisov_2018([pressure_term])

Returns an array of logfO2 (absolute) values in liquid for each assemblage in the ModelRun object; Uses the Borisov et al. (2018) formulation (Table 2); Pressure term options are: 'None', 'KC1991', 'Zhang2017'.

fO2_Hirschmann_2022([pressure_term])

Returns an array of logfO2 (absolute) values in liquid for each assemblage in the ModelRun object; Uses the Hirschmann et al. (2022) formulation (Eq 21); Pressure term options are: 'None', 'KC1991', 'Zhang2017', and 'Deng2020'.

fO2_Kress_and_Carmichael_1991()

Returns an array of logfO2 (absolute) values in liquid for each assemblage in the ModelRun object; Uses the Kress and Carmichael (1991) formulation.

fO2_Kress_and_Carmichael_1991() ndarray#

Returns an array of logfO2 (absolute) values in liquid for each assemblage in the ModelRun object; Uses the Kress and Carmichael (1991) formulation.

fO2_Borisov_2018(pressure_term: str = 'None') ndarray#

Returns an array of logfO2 (absolute) values in liquid for each assemblage in the ModelRun object; Uses the Borisov et al. (2018) formulation (Table 2); Pressure term options are: ‘None’, ‘KC1991’, ‘Zhang2017’.

fO2_Hirschmann_2022(pressure_term: str = 'None') ndarray#

Returns an array of logfO2 (absolute) values in liquid for each assemblage in the ModelRun object; Uses the Hirschmann et al. (2022) formulation (Eq 21); Pressure term options are: ‘None’, ‘KC1991’, ‘Zhang2017’, and ‘Deng2020’.

class peridoxia.main.SystemHistory(model_run: ModelRun, name: str = 'sys', color: str = 'grey')#

Class for system properties over the course of a model run. Inherits from PhaseHistory, so all PhaseHistory properties can be accessed in addition to the system-specific properties indicated here.

Parameters:
model_runModelRun

The ModelRun object from which to load the phase data.

namestr, optional

The name of the phase instance, by default ‘sys’.

colorstr, optional

The color for plotting the phase, by default ‘grey’.

Attributes:
Cr_num

Returns an array of Cr# values (Cr/(Cr+Al)) for the given phase for each assemblage in the ModelRun object.

Fe3_Al

Returns an array of Fe3/Al ratios for the given phase for each assemblage in the ModelRun object.

Fe3_tFe

Returns an array of Fe3+/tFe ratios for the given phase for each assemblage in the ModelRun object.

Mg_num

Returns an array of Mg# values (Mg/(Mg+Fe2+)) for the given phase for each assemblage in the ModelRun object.

ext_end_mol

Returns an array of extensive endmember moles for the given phase for each assemblage in the ModelRun object.

mass

Returns an array of masses for the given phase for each assemblage in the ModelRun object.

mol_cat

Returns an array of cation moles (per 100 g of oxides) for the given phase for each assemblage in the ModelRun object; Cation order is same as oxide order, and can be retrieved by calling [self].oxide_order.

name

Returns the name of the phase, which represents the name of the phase instance; Often the same as the phase string, but may be different– e.g., for the aggregated liquid, ‘agg_liq’ would be the name, whereas ‘liq’ would be the phase type.

oxide_order

Returns an array of strings representing the order of oxides when returned by the model.

oxides

Returns an array of oxides, normalized to 100 wt%, for the given phase for each assemblage in the ModelRun object; Oxide order can be retrieved by calling [self].oxide_order.

phs_obj_list

Returns a list of Phase objectes for the given phase for each assemblage in the ModelRun object.

phs_str

Returns the phase string, which represents the type of phase: e.g., ‘olv’, ‘opx’, ‘liq’, ‘sys’, etc.