Code Documentation

Modules

meltPT

A Python package for whole-rock major-element themormobarometric analyses of basaltic (mafic) rocks.

parse

Read data from a csv file.

meltPT.parse.parse_csv(infile, Ce_to_H2O=0.0, src_FeIII_totFe=0.0, src_Fo=0.9, min_MgO=0.0, param_co2=False)[source]

Read a csv and return a dataframe after some processing.

Processing steps are: - check SiO2, MgO, and FexOx are specified; if not will crash - check other major elements are specified; if not will be set to zero - try to set some values via trace elements - redistribute Fe according to src_FeIII_totFe - add source forsterite numbers if not already specified - if desired, estimate CO2 from SiO2 - normalise major elements to 100% - reject samples with MgO less than some threshold.

Parameters:
  • infile (str) – Path to a csv containing data to be read.

  • Ce_to_H2O (float) – Ratio of Ce to H2O in mantle source.

  • src_FeIII_totFe (float) – Ratio of Fe3+ to total Fe in the mantle source.

  • src_Fo (float) – Forsterite number in the mantle source.

  • min_MgO (float, optional) – Minimum amount of MgO in sample to be accepted.

  • read_as_primary (bool) – If true, data from input_csv is assumed to be primary and backtracking is avoided.

  • param_co2 (bool) – If true, CO2 is calculated from SiO2 concentration.

Returns:

df – Dataframe containing processed data.

Return type:

pandas dataframe

backtrack_compositions

Backtrack sample compositions to ‘primary’ compositions.

class meltPT.backtrack_compositions.BacktrackOlivineFractionation(Kd=None, dm=0.0005, verbose=False, max_olivine_addition=0.3)[source]

Correct sample compositions for fractional olivine crystallisation.

Follows the scheme of Lee et al. (2009, EPSL) to correct major-element compositions of erupted basalts for the effects of fractional olivine crystallisation. Silicon, iron and magnesium in proportions corresponding to olvine in equilibrium with the sample are added iteratively until the composition reaches some forsterite number representative of the mantle source.

The partition coefficient, Kd, can be set to a constant value or be allowed to vary as a function of melt magnesium number, according to the scheme of Tamura et al. (2000, J. Pet).

Parameters:
  • Kd (float or None) – If float, sets the value of the partition coefficient. If None, the partition coefficient is allowed to vary as a function of melt magnesium number.

  • dm (float) – The mass increment to use during iterative olivine addition.

  • verbose (bool) – If True, progress messages are printed during iterative addition of olivine.

  • max_olivine_addition (float) – The maximum proportion of olivine to add before abandoning.

property Fo

Compute forsterite number from oxide weight compositions.

Returns:

Fo – The calculated forsterite number.

Return type:

float

property Kd

Compute the partition coefficient.

If a fixed value has been specified, it is returned. Otherwise, calculate as function of Mg & FeII content, using expression from Tamura et al. (2000, J. Pet), via Lee et al. (2009) spreadsheet.

add_olivine()[source]

Add olivine in equilibrium with given melt composition.

Returns:

out_comp – The updated concentrations.

Return type:

dict

backtrack_sample_composition(df, return_all=False)[source]

Backtrack composition to desired mantle forsterite number.

Iteratively adds olivine in equilibrium with melt until desired composition is reached.

Parameters:
  • df (pandas dataframe) – Dataframe containing the initial composition to be backtracked and the target forsterite number. Should contain only one row. To use with a multi-row dataframe use df.apply().

  • return_all (bool) – Return intermediate backtracking compositions.

Returns:

  • primary_oxide (df) – The backtracked compositions.

  • composition_through_addition (list) – If return_all is True, returns list of dictionaries containing intermediate backtracking compositions.

property cation_mole

Convert oxide concentrations in weight percent to cation concentrations.

Returns:

out_comp – The cation concentrations.

Return type:

dict

meltPT.backtrack_compositions.fill_dict_with_nans(in_dict)[source]

Fill a dictionary with numpy.nan values.

Parameters:
  • in_dict (dict) – The dictionary to be filled with nans.

  • Returns

  • out_dict (dict) – The dictionary with all values replaces with nan.

meltPT.backtrack_compositions.normalise(in_comp)[source]

Normalise dictionary so that values sum to 100%.

Parameters:

in_comp (dict) – The values to be normalised.

Returns:

out_comp – The normalised values.

Return type:

dict

thermobarometry

Perform thermobarometric calculations.

meltPT.thermobarometry.Mg_num(df)[source]

Calculate Mg#.

Parameters:

df (pandas dataframe) – sample compositions in anhydrous mol%.

Returns:

Mg_num – The Mg#.

Return type:

float

meltPT.thermobarometry.NaK_num(df)[source]

Calculate NaK#.

Must previously run compute_components_species(), compute_components_cation(), compute_components_compound() or compute components_per_ox().

Parameters:

df (pandas dataframe with sample compositions in anhydrous mole%)

Returns:

NaK_num – The NaK#.

Return type:

float

meltPT.thermobarometry.compute_DMg(df)[source]

Calculate DMg.

Follows method outlined in Beattie, (1993), Contrib. Min. and Pet. Must previously run compute_components_cation().

Parameters:

df (pandas dataframe) – Dataframe containing sample compositions in anhydrous mole%.

Returns:

DMg – Calculated DMg.

Return type:

float

meltPT.thermobarometry.compute_components_cation(df)[source]

Calculate proportions of cations in mol% assuming the sample is anhydrous.

Parameters:

df (pandas dataframe) – Dataframe containing sample compositions in wt%. Should contain only one row. To use with a multi-row dataframe use df.apply().

Returns:

df

Original dataframe with additional columns:
  • anhydrous wt% with suffix ‘_primary_wt_dry’

  • cation mol% with suffix ‘_primary_mol’

  • anhydrous cation mol% with suffix ‘_primary_mol_dry’.

Return type:

pandas dataframe

meltPT.thermobarometry.compute_components_compound(df)[source]

Calculate proportions of oxides in mol% assuming all Fe is in FeO and the sample is anhydrous.

Parameters:

df (pandas dataframe) – The sample compositions in wt%. Should contain only one row. To use with a multi-row dataframe use df.apply().

Returns:

df

Original dataframe with additional columns:
  • anhydrous wt% with suffix ‘_primary_wt_dry’

  • anhydrous oxide mol% with suffix ‘_primary_mol_dry’.

Return type:

pandas dataframe

meltPT.thermobarometry.compute_components_per_oxygen(df)[source]

Calculate proportions of oxides in mol% assuming all Fe is in FeO and the sample is anhydrous. Normalise to each to one oxygen per compound.

Parameters:

df (pandas dataframe) – Dataframe containing sample compositions in wt%. Should contain only one row. To use with a multi-row dataframe use df.apply().

Returns:

df

Original dataframe with additional columns:
  • anhydrous wt% with suffix ‘_primary_wt_dry’

  • volatile free oxide mol content per unit oxygen with suffix ‘_primary_mol_dry’.

Return type:

pandas dataframe

meltPT.thermobarometry.compute_components_species(df)[source]

Calculate mole species proportions.

Use equations listed in Appendix A of Lee et al (2009, G-cubed) to compute proportions of each mole species.

Parameters:

df (pandas dataframe) – Dataframe containing sample compositions in wt%. Should contain only one row. To use with a multi-row dataframe use df.apply().

Returns:

df

Original dataframe with additional columns:
  • anhydrous wt% with suffix ‘_primary_wt_dry’

  • oxide mol% with suffix ‘_primary_mol’

  • species proportions in mol%, e.g., ‘Si4O8’

  • anhydrous species proportions in mol%, e.g., ‘Si4O8_dry’.

Return type:

pandas dataframe

meltPT.thermobarometry.compute_minerals(df)[source]

Calculate proportions of mineral components.

Using equations listed in Grove (1982, Contrib. Min. Pet., 80:160-182), compute stable mineral assemblage.

Parameters:

df (pandas dataframe) – Datframe containing sample compositions. Expects columns with suffix ‘_primary_mol_dry’; should be mol% anhydrous compositions. Should contain only one row. To use with a multi-row dataframe use df.apply().

Returns:

MINS – Predicted mineral proportions. 0: Olivine, 1: cpx, 2: plg, 3: qz, 4: opx, 5: spl, 6: ap.

Return type:

numpy array

meltPT.thermobarometry.compute_parameter_BK21(df, OL, P, regression_params)[source]

Calculate parameter values using equation of Brown Krein et al., (2021)

Parameters:
  • df (pandas dataframe) – sample compositions in anhydrous wt% need suffix ‘_primary_wt_dry’ sample compositions in anhydrous mol% need suffix ‘_primary_mol_dry’. Should contain only one row. To use with a multi-row dataframe use df.apply().

  • OL (flota) – Olivine concentration.

  • P (float) – Pressure in GPa.

  • regression_params (array) – Array containing eight calibrated parameter values.

Returns:

result – either T or predicted mineral percentages.

Return type:

float

meltPT.thermobarometry.compute_parameter_TGK12(df, MINS, P, regression_params)[source]

Calculate parameter values using equation of Till et al., (2012)

Parameters:
  • df (pandas dataframe) – sample compositions in anhydrous wt% need suffix ‘_primary_wt_dry’ sample compositions in anhydrous mol% need suffix ‘_primary_mol_dry’. Should contain only one row. To use with a multi-row dataframe use df.apply().

  • MINS (array) – Concentrations of each mineral.

  • P (float) – Pressure in GPa.

  • regression_params (array) – one row array of 8 calibrated prameter values.

Returns:

result – either T or predicted mineral percentages

Return type:

float

meltPT.thermobarometry.compute_sample_pressure(df, method='PF16', T=1300.0, min_SiO2=0.0)[source]

Calculate temperate of melt equilibration

Parameters:
  • df (pandas dataframe.) – Dataframe containing the sample primary composition. Should contain only one row. To use with a multi-row dataframe use df.apply().

  • method (sring) – choice of thermobaric method PF16 = Plank & Forsyth (2016), G3 L09 = Lee et al., (2009), G3 P08 = Putirka (2008) Eq 42.

  • T (float) – Temperature in oC

Returns:

PT – The calculated temperature(s) in oC, assumed pressures in GPa and associated errors.

Return type:

pandas dataframe

meltPT.thermobarometry.compute_sample_pressure_temperature(df, method='PF16', min_SiO2=0.0)[source]

Calculate temperate and pressure of melt equilibration.

Parameters:
  • df (pandas dataframe.) – Dataframe containing the sample primary composition. Should contain only one row. To use with a multi-row dataframe use df.apply().

  • method (string) – choice of thermobaric method PF16 = Plank & Forsyth (2016), G3 L09 = Lee et al., (2009), G3 TGK12_PLG = Till et al., (2012) in plagioclase stability field. TGK12_SPL = Till et al., (2012) in spinel stability field. G13 = Grove et al., (2013) in garnet stability field. BK21_PLG = Brown Krein et al., (2021) in plagioclase stability field. BK21_SPL = Brown Krein et al., (2021) in spinel stability field. BK21_GNT = Brown Krein et al., (2021) in garnet stability field. BK21 = Brown Krein et al., (2021) P07_P08 = Putirka et al., (2007) Eq 4. and Putirka (2008) combined. SD20 = Sun & Dasgupta (2020), EPSL low SiO2 thermobarometer.

Returns:

PT – The calculated temperature(s) in oC, pressures in GPa, and associated errors.

Return type:

dict

meltPT.thermobarometry.compute_sample_temperature(df, method='HA15', P=1.0, min_SiO2=0.0)[source]

Calculate temperate of melt equilibration.

Parameters:
  • df (pandas dataframe.) – Dataframe containing the sample primary composition. Should contain only one row. To use with a multi-row dataframe use df.apply().

  • method (sring) – choice of thermobaric method HA15 = Herzberg & Asimow (2015) P07_2 = Putirka et al., (2007) equation 2. P07_4 = Putirka et al., (2007) equation 4. TGK12_PLG = Till et al., (2012) in plagioclase stability field. TGK12_SPL = Till et al., (2012) in spinel stability field. G13 = Grove et al., (2013) in garnet stability field. BK21_PLG = Brown Krein et al., (2021) in plagioclase stability field. BK21_SPL = Brown Krein et al., (2021) in spinel stability field. BK21_GNT = Brown Krein et al., (2021) in garnet stability field. BK21 = Brown Krein et al., (2021). SD20 = Sun & Dasgupta (2020), EPSL low SiO2 thermobarometer.

  • P (float) – pressure in GPa

Returns:

PT – The calculated temperature(s) in oC, assumed pressures in GPa and associated errors.

Return type:

pandas dataframe

meltPT.thermobarometry.normalize_v2(df, list_parameters, input_suffix, output_suffix, end_sum)[source]

Normalise sample compositions so they sum to a given value.

Concentrations in list_parameters are normalised so that they sum to value given by end_sum. New values added to df with list_parameter name appended by output_suffix.

Parameters:
  • df (pandas dataframe) – Should contain only one row. To use with a multi-row dataframe use df.apply().

  • list_parameters (list) – Dataframe columns to be normalised.

  • input_suffix (str) – Original suffix for columns to use.

  • output_suffix (str) – Suffix to be added to create new column name.

  • end_sum (float) – Value that columns should total after normalisation.

Returns:

df – The updated dataframe containing normalised values.

Return type:

pandas datframe

fit_melting_paths

Find best-fitting melting paths.

meltPT.fit_melting_paths.compute_sample_melt_fraction_misfit(F, df, path)[source]

Compute misfit between sample and point along given melting path, specified by melt path.

Parameters:
  • F (float) – The melt fraction with which to compare the pressure/temperature point.

  • df (pandas dataframe) – Dataframe containing sample pressure and temperature estimates.

  • path (instance of pyMelt.meltingcolumn_classes.meltingColumn) – The melt path. Can be instance of any class containing arrays of melt fraction (F), pressure (P) and temperature (T).

  • P_err (float, optional) – Uncertainty in pressure observation(s). If NaN, P_err is assumed to be 10% of P.

  • T_err (float, optional) – Uncertainty in temperature observation(s). If NaN, T_err is assumed to be 10% of T.

Returns:

misfit – Misfit between observed pressure and temperature and point along melt path. Defined as distance in normalised pressure-temperature space. Pressure and temperature are normalised by their respective uncertainties.

Return type:

float

meltPT.fit_melting_paths.compute_sample_potential_temperature_misfit(Tp, df, mantle)[source]

Compute a melting path for a given potential temperature then find misfit between it and a sample pressure-temperature estimate.

First uses mantle.adiabaticMelt() to compute melt path for specified potential temperature. Then finds closest melt fraction

Parameters:
  • Tp (float) – The potential temperature to be used.

  • df (pandas dataframe) – Dataframe containing sample pressure and temperature estimates. Should contain only one row. To use with a multi-row dataframe use df.apply().

  • mantle (instance of pyMelt.mantle_class.mantle) – The mantle object to be used to calculate the melting path.

Returns:

misfit – Distance between sample pressure-temperature estimate and its nearest point on the calculated melting path.

Return type:

float

meltPT.fit_melting_paths.compute_suite_potential_temperature_misfit(Tp, df, mantle)[source]

Compute a melt path for a specified potential temperature then calculate the misfit between it and one or more pressure-temperature estimates.

Parameters:
  • Tp (float) – The potential temperature to be used.

  • df (pandas dataframe) – Dataframe containing sample pressure and temperature estimates. Can contain any number of samples.

  • mantle (instance of pyMelt.mantle_class.mantle) – The mantle object to be used to calculate the melting paths.

Returns:

misfit – The average distance between sample pressure-temperature estimates and their nearest points on the calculated melting path.

Return type:

float

meltPT.fit_melting_paths.find_bounding_potential_temperature(points, starting_temperature, mantle, lower=False, threshold=0.6666666666666666)[source]

Find either upper or lower bound on best-fitting potential temperature for suite of pressure-temperature estimates.

Works by computing melting paths progressively further away from the best- fitting path, until a threshold number of points lie between the two paths.

Parameters:
  • points (list of shapely.geometry.point.Point objects) – The points to be bounded.

  • starting_temperature (float) – The best-fitting potential temperature for the suite.

  • mantle (instance of pyMelt.mantle_class.mantle) – The mantle object to be used to calculate the melting paths.

  • lower (bool, optional) – Specify whether an upper or lower bound is to be found.

  • threshold (float) – The threshold fraction of points to be lie between the best-fitting and bounding temperature melting paths.

Returns:

  • bounding_temperature (float) – The estimated bounding temperature.

  • bounding_path (instance of pyMelt.meltingcolumn_classes.meltingColumn) – The melting path corresonding to the bounding potential temperature.

meltPT.fit_melting_paths.find_max_potential_temperature(mantle)[source]

Find the maximum valid potential temperature for a given pyMelt mantle object.

Solidi described by a parabolic function, as in Katz et al. (2003, G-cubed), have turning points at high temperatures/pressures. As a result, adiabatic geotherms above some potential temperature no longer intersect the solidus, which is a problem for the fitting functions in meltPT. This function finds the maximum potential temperature that can be safely used with a given mantle object.

Parameters:

mantle (instance of pyMelt.mantle_class.mantle) – The mantle object to be used to calculate the melting path.

meltPT.fit_melting_paths.find_sample_melt_fraction(df, path)[source]

Find best-fitting melt fraction for sample along given melting path.

Uses scipy’s minimize_scalar function to find melt fraction that minimizes misfit between estimated pressure and temperature and the melt path. Options used are:

method: “bounded” bounds: min –> 0

max –> Maximum melt fraction in “path”

bracket: min –> 0

max –> Maximum melt fraction in “path”

Parameters:
  • df (pandas dataframe) – Dataframe containing sample pressure and temperature estimates. Should contain only one row. To use with a multi-row dataframe use df.apply().

  • path (instance of pyMelt.meltingcolumn_classes.meltingColumn) – The melting path. Can be instance of any class containing arrays of melt fraction (F), pressure (P) and temperature (T).

Returns:

out

Various properties of the result:
Ffloat

The best-fitting melt fraction.

Pfloat

Pressure on path corresponding to best-fitting melt fraction.

Tfloat

Temperature on path corresponding to best-fitting melt fraction.

misfitfloat

Distance between sample and closest point on melting path.

If sample pressure or temperature are nan, all returned values are nan.

Return type:

dict

meltPT.fit_melting_paths.find_sample_potential_temperature(df, mantle)[source]

Find best-fitting potential temperature for a sample pressure-temperature estimate.

Uses scipy’s minimize_scalar function to find potential temperature that minimizes misfit between estimated pressure and temperature and the corresponding melt path. Options used are:

method: “bounded” bounds: min –> intersection of solidus with surface

max –> max Tp for melting model

bracket: min –> intersection of solidus with surface

max –> max Tp for melting model

Parameters:
  • df (pandas dataframe) – Dataframe containing sample pressure and temperature estimates. Should contain only one row. To use with a multi-row dataframe use df.apply().

  • mantle (instance of pyMelt.mantle_class.mantle) – The mantle object to be used to calculate the melting paths.

Returns:

out

Various properties of the result:
Ffloat

The melt fraction along the best-fitting melting path.

Pfloat

The pressure along the best-fitting melting path.

Tfloat

The temperature along the best-fitting melting path.

misfitfloat

Distance between sample and closest point on melting path.

Tpfloat

The best-fitting potential temperature.

pathinstance of pyMelt.meltingcolumn_classes.meltingColumn

The best-fitting melting path.

If sample pressure or temperature are nan, all returned values are nan.

Return type:

dict

meltPT.fit_melting_paths.melt_fraction_to_pressure_temperature(F, path)[source]

Find pressure and temperature corresponding to specified melt fraction for a specified melting path.

Parameters:
  • F (float) – The melt fraction.

  • path (instance of pyMelt.meltingcolumn_classes.meltingColumn) – The melt path. Can be instance of any class containing arrays of melt fraction (F), pressure (P) and temperature (T).

Returns:

  • P (float) – Pressure corresponding to specified melt fraction.

  • T (float) – Temperature corresponding to specified melt fraction.

The Suite class

Process suites of samples.

class meltPT.suite.Suite(input_csv, Ce_to_H2O=0.0, src_FeIII_totFe=0.0, src_Fo=0.9, min_MgO=0.0, read_as_primary=False, param_co2=False, read_PT=False)[source]

Store and process compositions of basaltic rocks.

Includes methods to find primary compositions (i.e. correcting for the crystallisation of olivine; Lee et al., 2009, EPSL), compute equilibration pressures and temperatures (Plank & Forsyth, 2016, G-cubed), and fit melting paths to those pressure-temperature estimates.

Parameters:
  • input_csv (str) – Path to a csv containing data to be read.

  • Ce_to_H2O (float) – Ratio of Ce to H2O in mantle source.

  • src_FeIII_totFe (float) – Ratio of Fe3+ to total Fe in the mantle source.

  • min_MgO (float, optional) – Minimum amount of MgO in sample to be accepted.

  • read_as_primary (bool) – If true, data from input_csv is assumed to be primary and backtracking is avoided.

  • param_co2 (bool) – If true, CO2 is calculated from SiO2 concentration.

  • read_PT (bool) – If true, pressures and temperatures are not calculated.

Variables:
  • data (pandas dataframe) – The raw data from the provided csv.

  • primary (pandas dataframe or NoneType) – If backtrack_compositions has been run, or read_as_primary is set to true, will contain the estimated primary compositions in various forms.

  • PT (pandas dataframe or NoneType) – If compute_pressure_temperature has been run, will contain the esimated equilibration pressures and temperatures.

  • PT_to_fit (pandas dataframe or NoneType) – If any melt-path fitting has been run, will contain pressure and temperature estimates of samples that have been selected for fitting.

  • individual_melt_fractions (pandas dataframe or NoneType) – If find_individual_melt_fractions, will contain results of fitting suite of pressure-temperature estimates to a specified melt path.

  • individual_potential_temperatures (pandas dataframe or NoneType) – If find_individual_potential_temperatures has been run, will contain results of fitting melting paths to each individual pressure- temperature estimate.

  • suite_melt_fractions (pandas dataframe or NoneType) – If find_suite_potential_temperature has been run, will contain closest points on best-fitting melting path for each pressure-temperature estimate.

  • potential_temperature (float or NoneType) – If find_suite_potential_temperature has been run, will be the best- fitting potential temperature for the suite of pressure-temperature estimates.

  • upper_potential_temperature (float or NoneType) – If find_suite_potential_temperature has been run, with find_bounds, will be the upper bound on potential temperature for the suite of pressure-temperature estimates.

  • lower_potential_temperature (float or NoneType) – If find_suite_potential_temperature has been run, with find_bounds, will be the lower bound on potential temperature for the suite of pressure-temperature estimates.

  • path (instance of pyMelt.meltingcolumn_classes.meltingColumn) – If find_suite_potential_temperature has been run, will be the best- fitting melting path.

  • upper_path (instance of pyMelt.meltingcolumn_classes.meltingColumn) – If find_suite_potential_temperature has been run, with find_bounds, will be the upper-bounding melting path.

  • lower_path (instance of pyMelt.meltingcolumn_classes.meltingColumn) – If find_suite_potential_temperature has been run, with find_bounds, will be the lower-bounding melting path.

backtrack_compositions(backtracker)[source]

Backtrack compositions for entire suite.

Applies backtracker.backtrack_sample_composition to the “data” property. Result is saved in the “primary” property.

Parameters:

backtracker (class instance) – Instance of a backtracker class. Must have a backtrack_sample_composition method that returns a dict containing backtracked major element compositions.

check_samples_for_fitting(mantle, filters=(None,), args=(None,))[source]

Determine which samples should be fitted.

Samples below the solidus will be dropped. Also applies additional filters if provided by the user. Samples which fail any filter will be rejected.

Result is saved in “PT_to_fit” property. Same as “PT” but rejected samples are assigned nan pressure and temperature.

Parameters:
  • mantle (instance of pyMelt.mantle_class.mantle) – The mantle object to be used to calculate the solidus.

  • filters (tuple of functions, optional) – Set of functions to filter samples before fitting. Filters take the form of a function that reads a single-row dataframe and returns either true or force.

  • args (tuple of tuples, optional, same length as filters) – Extra arguments to be passed to the filter functions.

compute_pressure(method='PF16', T=1300.0, min_SiO2=0.0)[source]

Compute equilibration pressures for entire suite at given temperature.

Applies “compute_sample_pressure” to the “primary” property. Result is saved in the “PT” property.

Parameters:
  • method (str) – Code corresponding to desired barometer. Current options are:

    • P08: Putirka et al. (2008, Revs. in Min. and Geo.)

    • L09: Lee et al. (2009, EPSL)

    • TGK12_PLG: Till et al. (2012, JGR: Solid Earth), plagioclase

    • TGK12_SPL: Till et al. (2012, JGR: Solid Earth), spinel

    • PF16: Plank and Forsyth (2016, G-cubed)

    • SD20: Sun and Dasgupta (2020, EPSL)

    • BK21: Brown Krien et al. (2021, JGR: Solid Earth), stable phase

    • BK21_PLG: Brown Krien et al. (2021, JGR: Solid Earth), plagioclase

    • BK21_SPL: Brown Krien et al. (2021, JGR: Solid Earth), spinel

    • BK21_GNT: Brown Krien et al. (2021, JGR: Solid Earth), garnet

  • T (float) – Temperature at which pressure should be calculated.

  • min_SiO2 (float) – Threshold SiO2 content below which samples will be ignored.

compute_pressure_temperature(method='PF16', min_SiO2=0.0)[source]

Compute equilibration pressures and temperatures for entire suite.

Applies “compute_sample_pressure_temperature” to the “primary” property. Result is saved in the “PT” property.

Parameters:
  • method (str) – Code corresponding to desired thermobarometer. Current options are:

    • P08: Putirka et al. (2008, Revs. in Min. and Geo.)

    • L09: Lee et al. (2009, EPSL)

    • TGK12_PLG: Till et al. (2012, JGR: Solid Earth), plagioclase

    • TGK12_SPL: Till et al. (2012, JGR: Solid Earth), spinel

    • PF16: Plank and Forsyth (2016, G-cubed)

    • SD20: Sun and Dasgupta (2020, EPSL)

    • BK21: Brown Krien et al. (2021, JGR: Solid Earth), stable phase

    • BK21_PLG: Brown Krien et al. (2021, JGR: Solid Earth), plagioclase

    • BK21_SPL: Brown Krien et al. (2021, JGR: Solid Earth), spinel

    • BK21_GNT: Brown Krien et al. (2021, JGR: Solid Earth), garnet

  • min_SiO2 (float) – Threshold SiO2 content below which samples will be ignored.

compute_temperature(method='PF16', P=1.0, min_SiO2=0.0)[source]

Compute equilibration temperatures for entire suite at given pressure.

Applies “compute_sample_temperature” to the “primary” property. Result is saved in the “PT” property.

Parameters:
  • method (str) – Code corresponding to desired thermometer. Current options are:

    • P08: Putirka et al. (2008, Revs. in Min. and Geo.)

    • L09: Lee et al. (2009, EPSL)

    • TGK12_PLG: Till et al. (2012, JGR: Solid Earth), plagioclase

    • TGK12_SPL: Till et al. (2012, JGR: Solid Earth), spinel

    • PF16: Plank and Forsyth (2016, G-cubed)

    • SD20: Sun and Dasgupta (2020, EPSL)

    • BK21: Brown Krien et al. (2021, JGR: Solid Earth), stable phase

    • BK21_PLG: Brown Krien et al. (2021, JGR: Solid Earth), plagioclase

    • BK21_SPL: Brown Krien et al. (2021, JGR: Solid Earth), spinel

    • BK21_GNT: Brown Krien et al. (2021, JGR: Solid Earth), garnet

    • B93: Beattie (1993, Contrib. to Min. and Pet.)

    • P07_2: Putirka et al. (2007, Chem. Geol.), Equation 2

    • P07_4: Putirka et al. (2007, Chem. Geol.), Equation 4

    • HA15: Herzberg and Asimow (2015, G-cubed)

  • P (float) – Pressure at which temperature whould be calculated.

  • min_SiO2 (float) – Threshold SiO2 content below which samples will be ignored.

find_individual_melt_fractions(mantle, path, filters=(None,), filter_args=(None,))[source]

Find best-fitting melt fractions for each sample relative to given melt path.

Applies “find_sample_melt_fraction” to “PT_to_fit” dataframe. Results saved in “individual_melt_fractions” property.

Parameters:
  • mantle (instance of pyMelt.mantle_class.mantle) – The mantle object to be used to calculate the solidus.

  • path (instance of pyMelt.meltingcolumn_classes.meltingColumn) – The melting path to be used.

  • filters (tuple of functions, optional) – Set of functions to filter samples before fitting. Filters take the form of a function that reads a single-row dataframe and returns either true or force.

  • args (tuple of tuples, optional, same length as filters) – Extra arguments to be passed to the filter functions.

find_individual_potential_temperatures(mantle, filters=(None,), filter_args=(None,))[source]

Find best-fitting melting paths for each sample.

Applies “find_sample_potential_temperature” to “PT_to_fit” dataframe. Result is saved in “individual_potential_temperatures” property.

Parameters:
  • mantle (instance of pyMelt.mantle_class.mantle) – The mantle object to be used to calculate the solidus and melting paths.

  • filters (tuple of functions, optional) – Set of functions to filter samples before fitting. Filters take the form of a function that reads a single-row dataframe and returns either true or force.

  • args (tuple of tuples, optional, same length as filters) – Extra arguments to be passed to the filter functions.

find_suite_potential_temperature(mantle, find_bounds=False, bounds_threshold=0.6666666666666666, filters=(None,), filter_args=(None,))[source]

Find best-fitting potential temperature for suite.

Uses scipy’s minimize_scalar to minimize mean distance from suite pressure-temperature estimates to melting path. Options used are:

method: “bounded” bounds: min –> intersection of solidus with surface

max –> max Tp for melting model

bracket: min –> intersection of solidus with surface

max –> max Tp for melting model

Parameters:
  • mantle (instance of pyMelt.mantle_class.mantle) – The mantle object to be used to calculate the solidus and melting paths.

  • find_bounds (bool, optional) – If True, uses find_bounds to place upper and lower bounds on best-fitting potential temperature.

  • bounds_threshold (float) – The threshold fraction of points to be lie between the best-fitting and bounding temperature melting paths.

  • filters (tuple of functions, optional) – Set of functions to filter samples before fitting. Filters take the form of a function that reads a single-row dataframe and returns either true or force.

  • args (tuple of tuples, optional, same length as filters) – Extra arguments to be passed to the filter functions.

  • Results (saved as class properties)

  • ——-

  • potential_temperature (float) – The best-fitting potential temperature.

  • path (instance of pyMelt.meltingcolumn_classes.meltingColumn) – The best-fitting melting path.

  • suite_melt_fractions (pandas dataframe) – Nearest melt fractions, pressures and temperatures along best- fitting melting path for each sample.

  • upper_potential_temperature (float, if find_bounds is True) – The upper bouding potential temperature.

  • lower_potential_temperature (float, if find_bounds is True) – The lower bounding potential temperature.

  • upper_path (instance of pyMelt.meltingcolumn_classes.meltingColumn,) – if finds_bounds is True The upper bounding melting path.

  • lower_path (instance of pyMelt.meltingcolumn_classes.meltingColumn,) – if finds_bounds is True The lower bounding melting path.

write_to_csv(outfile, write_primary=True, write_PT=True, write_suite_Tp=False, write_individual_Tp=False)[source]

Write results to csv.

Combine desired outputs, give appropriate column names, and save as csv to a specified location.

Parameters:
  • outfile (str) – Path to location where csv should be saved.

  • write_primary (bool) – Whether hydrous wt% concentrations should be saved.

  • write_PT (bool) – Whether equilibration pressure/temperature estimates should be saved.

  • write_suite_Tp (bool) – Whether results of fitting melting paths through suite of pressure/ temperature estimates should be saved.

  • write_individual_Tp (bool) – Whether results of fitting melting paths through individual pressure/temperature points should be saved.