import numpy as np
import matplotlib.pyplot as plt
import Thermobar as pt
file = "branchetti_2021.xlsx" #Wherever that /Examples/Garnet is
data = pt.import_excel(file, sheet_name = "Sheet_1")
tb_data = data['my_input']
#
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Input In [3], in <module> 15 T, depth, p, depth_intercepts = pt.calculate_hasterok2011_geotherm(SHF = shf_solution, BDL_T = 800+273, T_0 = 0, max_depth = 300, moho = 38, kinked = False, adiabat = True) 17 #Making a plot of the solution. ---> 18 mantle_geotherm_plot(T = T, P = p, Depth = depth, plot_style = 'Depth', Temp_unit = 'Celsius', T_Sample = T_ext, P_Sample = P_ext, T_std = 50, P_std = 0.3, plot_type = 'show', max_depth = 300, moho = 38, lab = 230) NameError: name 'mantle_geotherm_plot' is not defined
#RSINAN PLEASE REPLACE THIS WITH THERMOBAR FUNCTIONS SHOWING HOW TO CALCULATE THESE AGAIN
T_ext = np.array(tb_data['Temp']) + 273.15
P_ext = np.array(tb_data['P'])
#Inverting for SHF for the function
shf_solution, T_solution, depth_solution, p_solution, misfit_solution = pt.invert_generalised_mantle_geotherm(P_sample = P_ext, T_sample = T_ext, std_P = 0.3, std_T = 50,
SHF_start = 35, SHF_end=45, SHF_increment=0.1, max_depth=300, kinked=False, BDL_T = 170, adiabat = True,
plot_solution = True)
#Recalculating with the solution
T, depth, p, depth_intercepts = pt.calculate_hasterok2011_geotherm(
SHF = shf_solution, BDL_T = 800+273, T_0 = 0, max_depth = 300,
moho = 38, kinked = False, adiabat = True)
#Making a plot of the solution.
pt.mantle_geotherm_plot(T = T, P = p, Depth = depth,
plot_style = 'Depth', Temp_unit = 'Celsius',
T_Sample = T_ext, P_Sample = P_ext, T_std = 50,
P_std = 0.3, plot_type = 'show', max_depth = 300,
moho = 38, lab = 230)
help(pt.mantle_geotherm_plot)
Help on function mantle_geotherm_plot in module Thermobar.plotting: mantle_geotherm_plot(T, P, Depth, plot_style, Temp_unit, T_Sample, P_Sample, T_std, P_std, max_depth, plot_type, **kwargs) A function to plot calculate geotherm alongside the thermobarometric calculations. ###Parameters### T: Temperature array of the geotherm. P: Pressure array of the geotherm. Depth: Depth array of the geotherm in meters. plot_style: String parameter for the y-axis of the geotherm plot 'Pressure' or 'Depth'. Temp_unit: String parameter for the temperature unit, 'Celsius' or 'Kelvin'. T_Sample: Array of temperature of the thermobarometric solutions. P_Sample: Array of pressure of the thermobarometric solutions in GPa. T_std: Standart deviation of thermobarometric temperature estimation. Could be array or a single value. P_std: Standart deviation of thermobarometric pressure estimation. Could be array or a single value. max_depth: Maximum depth to show the plot. plot_type: 'show' or 'save' the figure. moho: moho depth in km. lab: lab depth in km. Depth_Sample: Array of depths of the thermobarometric solutions. filename_save: string parameter for filename to save the figures.