Import Functions

Thermobar.import_export.convert_from_vesical(data)[source]

Takes liquid compositions from VESIcal, and converts it into a panda dataframe that can be inputted into the thermobaromety functions in PyMME

Parameters

data: VESIcal data formatted, obtained from myfile.get_Data

Returns

pandas dataframe formatted wtih column headings suitable for PyMME

Thermobar.import_export.convert_to_vesical(liq_comps, T1, unit='Kelvin', Fe3Fet_Liq=None)[source]

Takes liquid dataframe in the format used for PyMME, and strips the _Liq string so that it can be input into VESical. Also removes the Fe3FeTcolumn, and appends temperature (converted from Kevlin to celcius)

Parameters
liq_comps: pandas.DataFrame

DataFrame of liquid compositions.

T1: Panda series, int, float

Temperature in Kelvin by default (e.g., from a thermometer of choice)

unit: Kelvin or Celcius

What unit supplied temperature is in

Returns

DataFrame formatted so that it can be inputted into VESIcal.

Thermobar.import_export.import_excel(file_name=None, sheet_name=None, path=None, sample_label=None, GEOROC=False, suffix=None, df=None)[source]

Import excel sheet of oxides in wt%, headings should be of the form SiO2_Liq (for the melt/liquid), SiO2_Ol (for olivine comps), SiO2_Cpx (for clinopyroxene compositions). Order doesn’t matter

Parameters
file_name: .xlsx, .csv, .xls file

Compositional data as an Excel spreadsheet (.xlsx, .xls) or a comma separated values (.csv) file with columns labelled SiO2_Liq, SiO2_Ol, SiO2_Cpx etc, and each row corresponding to an analysis.

file_name: str

specifies the file name (e.g., Python_OlLiq_Thermometers_Test.xlsx)

OR enter a dataframe instead of an excel file.

Optional:

path: provide a pathlib path to where the file is stored

GEOROC: bool (defualt False) - reads in GEOROC files

suffix: default None, can be ‘_Liq’ etc. Used to add a suffix onto all column headings.

pandas DataFrames stored in a dictionary. E.g., Access Cpxs using output.Cpxs

my_input = pandas dataframe of the entire spreadsheet mylabels = sample labels Experimental_press_temp = User-entered PT Liqs=pandas dataframe of liquid oxides Ols=pandas dataframe of olivine oxides Cpxs=pandas dataframe of cpx oxides Plags=pandas dataframe of plagioclase oxides Kspars=pandas dataframe of kspar oxides Opxs=pandas dataframe of opx oxides Amps=pandas dataframe of amphibole oxides Sps=pandas dataframe of spinel oxides

Thermobar.import_export.import_excel_errors(file_name, sheet_name, GEOROC=False)[source]

Import excel sheet of oxide errors in wt%, headings should be of the form SiO2_Liq_Err (for the melt/liquid), SiO2_Ol_Err (for olivine comps), SiO2_Cpx_Err (for clinopyroxene compositions).

Parameters
file_name: pExcel file

Excel file of oxides in wt% with columns labelled SiO2_Liq, SiO2_Ol, SiO2_Cpx etc.

file_name: str

specifies the file name (e.g., Python_OlLiq_Thermometers_Test.xlsx)

pandas DataFrames stored in a dictionary. E.g., Access Cpxs using output.Cpxs

my_input_Err = pandas dataframe of the entire spreadsheet Experimental_press_temp_Err = User-entered PT errors. Liqs_Err=pandas dataframe of liquid oxide errors Ols_Err=pandas dataframe of olivine oxide errors Cpxs_Err=pandas dataframe of cpx oxide errors Plags_Err=pandas dataframe of plagioclase oxide errors Kspars_Err=pandas dataframe of kspar oxide errors Opxs_Err=pandas dataframe of opx oxide errors Amps_Err=pandas dataframe of amphibole oxide errors Sps_Err=pandas dataframe of spinel oxide errors

Thermobar.import_export.import_lepr_file(file_name)[source]

Reads in data from the outputs from the Caltech LEPR site (where oxides are followed by the word “value”) Splits the data into phases, as for the read_excel function.

Parameters
file_name: str

Excel file_name from LEPR

pandas DataFrames stored in a dictionary. E.g., Access Cpxs using output.Cpxs

my_input = pandas dataframe of the entire spreadsheet mylabels = sample labels Experimental_PT = User-entered PT Fluid=pandas dataframe of fluid compositions Liqs=pandas dataframe of liquid oxides Ols=pandas dataframe of olivine oxides Cpxs=pandas dataframe of cpx oxides Plags=pandas dataframe of plagioclase oxides Kspars=pandas dataframe of kspar oxides Opxs=pandas dataframe of opx oxides Amps=pandas dataframe of amphibole oxides Sps=pandas dataframe of spinel oxides