This page was generated from docs/Examples/Liquid_Ol_Liq_Themometry/CHOMPI_Liq_calcs.ipynb. Interactive online version: .
CHOMPI calculations
This notebook shows how to perform CHOMPI calculations following Blundy (2022)- JPET
Specifically, this method calculates P, T and XH2O for samples saturated in CHOMPI - Cpx, Hornblende, Opx, Ilmenite-Magnetite, and Plagioclase
It also includes a test of how likely it is the liquid was actually CHOMPI saturated
Here, we show how to perform calculations using the Cascade liquids from the Blundy paper.
If you havent already, import or upgrade Thermobar. Only in v1.0.25 onwards
[1]:
#!pip install --upgrade Thermobar
[6]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import Thermobar as pt
pt.__version__
pd.set_option('display.max_columns', None)
[7]:
# Load in the data, dont worry about normalizing, the code will do it for you!
out=pt.import_excel('Cascade_Liqs.xlsx', sheet_name='Sheet1')
Liq=out['Liqs']
all=out['my_input']
[8]:
df_out=pt.calculate_CHOMPI(liq_comps=Liq, deltaNNO=all['∆NNO (log units)'],
T_K_guess=all['T erupt (°C)']+273.15, N_rep=100)
df_out.head()
[8]:
final_assessment | SSR | In Cali Range? | T_K_calc | T_K_residual | P_kbar_calc | XH2O_mol_calc | XCO2XH2O | SiO2_calc | TiO2_calc | Al2O3_calc | FeOt_calc | MgO_calc | CaO_calc | Na2O_calc | K2O_calc | CHOMPI (SSI<6?) | Pass_Cali_test_SiO2? | Pass_Cali_test_Al2O3? | Pass_Cali_test_MgO? | Pass_Cali_test_Na2O? | Pass_Cali_test_K2O? | SiO2_Liq | TiO2_Liq | Al2O3_Liq | FeOt_Liq | MgO_Liq | CaO_Liq | Na2O_Liq | K2O_Liq | Fe3Fet_Liq | Sample_ID_Liq | NiO_Liq | CoO_Liq | CO2_Liq | H2O_Liq | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Strong_positive | 0.890216 | True | 1173.709528 | 100.559528 | 3.504459 | 0.725600 | 0.378169 | 69.893687 | 0.401833 | 16.037467 | 2.756033 | 0.959862 | 3.431091 | 3.841899 | 2.678127 | True | True | True | True | True | True | 69.299930 | 0.379375 | 15.675434 | 2.805987 | 1.408777 | 3.599436 | 4.258715 | 2.572347 | 0.0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 |
1 | Permissive_positive | 14.786599 | True | 1276.842769 | 3.692769 | 4.881374 | 0.539418 | 0.853850 | 59.635015 | 0.940393 | 19.167929 | 4.871097 | 2.992865 | 5.856037 | 4.394051 | 2.142614 | True | True | True | True | True | True | 62.700096 | 0.598123 | 17.082901 | 4.360429 | 3.670163 | 6.234633 | 4.140009 | 1.213647 | 0.0 | 1 | 0.0 | 0.0 | 0.0 | 0.0 |
2 | Strong_positive | 1.483696 | True | 1121.009366 | -12.140634 | 2.267972 | 0.732973 | 0.364307 | 72.840975 | 0.262233 | 14.364388 | 2.023597 | 0.252214 | 1.611477 | 4.526237 | 4.118879 | True | True | True | True | True | True | 73.812642 | 0.284803 | 13.799921 | 1.924439 | 0.362842 | 1.399290 | 4.134659 | 4.281403 | 0.0 | 2 | 0.0 | 0.0 | 0.0 | 0.0 |
3 | Permissive_positive | 8.305913 | True | 1289.833057 | 66.683057 | 5.757290 | 0.407235 | 1.455582 | 57.456685 | 1.030918 | 19.591490 | 5.720371 | 3.308518 | 6.313887 | 4.546906 | 2.031226 | True | True | True | True | True | True | 59.888020 | 0.778866 | 18.175961 | 5.804112 | 3.697594 | 6.364292 | 4.139059 | 1.152095 | 0.0 | 3 | 0.0 | 0.0 | 0.0 | 0.0 |
4 | Strong_positive | 0.799768 | True | 1110.734404 | -12.415596 | 1.259607 | 0.814489 | 0.227763 | 72.458598 | 0.246746 | 14.493137 | 2.238104 | 0.226659 | 1.587819 | 5.066988 | 3.681950 | True | True | True | True | True | True | 73.034776 | 0.234337 | 14.569193 | 2.082972 | 0.196227 | 0.948193 | 4.900449 | 4.033852 | 0.0 | 4 | 0.0 | 0.0 | 0.0 | 0.0 |
[9]:
## What about using a fixed value of T_K_guess if you dont know?
df_out=pt.calculate_CHOMPI(liq_comps=Liq, deltaNNO=all['∆NNO (log units)'],
T_K_guess=1200+273.15, N_rep=100)
df_out.head()
[9]:
final_assessment | SSR | In Cali Range? | T_K_calc | T_K_residual | P_kbar_calc | XH2O_mol_calc | XCO2XH2O | SiO2_calc | TiO2_calc | Al2O3_calc | FeOt_calc | MgO_calc | CaO_calc | Na2O_calc | K2O_calc | CHOMPI (SSI<6?) | Pass_Cali_test_SiO2? | Pass_Cali_test_Al2O3? | Pass_Cali_test_MgO? | Pass_Cali_test_Na2O? | Pass_Cali_test_K2O? | SiO2_Liq | TiO2_Liq | Al2O3_Liq | FeOt_Liq | MgO_Liq | CaO_Liq | Na2O_Liq | K2O_Liq | Fe3Fet_Liq | Sample_ID_Liq | NiO_Liq | CoO_Liq | CO2_Liq | H2O_Liq | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Strong_positive | 0.890216 | True | 1173.709528 | -299.440472 | 3.504459 | 0.725600 | 0.378169 | 69.893687 | 0.401833 | 16.037467 | 2.756033 | 0.959862 | 3.431091 | 3.841899 | 2.678127 | True | True | True | True | True | True | 69.299930 | 0.379375 | 15.675434 | 2.805987 | 1.408777 | 3.599436 | 4.258715 | 2.572347 | 0.0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 |
1 | Permissive_positive | 14.786599 | True | 1276.842769 | -196.307231 | 4.881374 | 0.539418 | 0.853850 | 59.635015 | 0.940393 | 19.167929 | 4.871097 | 2.992865 | 5.856037 | 4.394051 | 2.142614 | True | True | True | True | True | True | 62.700096 | 0.598123 | 17.082901 | 4.360429 | 3.670163 | 6.234633 | 4.140009 | 1.213647 | 0.0 | 1 | 0.0 | 0.0 | 0.0 | 0.0 |
2 | Strong_positive | 1.483696 | True | 1121.009366 | -352.140634 | 2.267972 | 0.732973 | 0.364307 | 72.840975 | 0.262233 | 14.364388 | 2.023597 | 0.252214 | 1.611477 | 4.526237 | 4.118879 | True | True | True | True | True | True | 73.812642 | 0.284803 | 13.799921 | 1.924439 | 0.362842 | 1.399290 | 4.134659 | 4.281403 | 0.0 | 2 | 0.0 | 0.0 | 0.0 | 0.0 |
3 | Permissive_positive | 8.305913 | True | 1289.833057 | -183.316943 | 5.757290 | 0.407235 | 1.455582 | 57.456685 | 1.030918 | 19.591490 | 5.720371 | 3.308518 | 6.313887 | 4.546906 | 2.031226 | True | True | True | True | True | True | 59.888020 | 0.778866 | 18.175961 | 5.804112 | 3.697594 | 6.364292 | 4.139059 | 1.152095 | 0.0 | 3 | 0.0 | 0.0 | 0.0 | 0.0 |
4 | Strong_positive | 0.799768 | True | 1110.734404 | -362.415596 | 1.259607 | 0.814489 | 0.227763 | 72.458598 | 0.246746 | 14.493137 | 2.238104 | 0.226659 | 1.587819 | 5.066988 | 3.681950 | True | True | True | True | True | True | 73.034776 | 0.234337 | 14.569193 | 2.082972 | 0.196227 | 0.948193 | 4.900449 | 4.033852 | 0.0 | 4 | 0.0 | 0.0 | 0.0 | 0.0 |
[12]:
## What about using a fixed value deltaNNO - lets try 0 and 2 to see how much they differ
df_out_NNO0=pt.calculate_CHOMPI(liq_comps=Liq, deltaNNO=0,
T_K_guess=1200+273.15, N_rep=100)
display(df_out_NNO0.head())
df_out_NNO2=pt.calculate_CHOMPI(liq_comps=Liq, deltaNNO=2,
T_K_guess=1200+273.15, N_rep=100)
display(df_out_NNO2.head())
final_assessment | SSR | In Cali Range? | T_K_calc | T_K_residual | P_kbar_calc | XH2O_mol_calc | XCO2XH2O | SiO2_calc | TiO2_calc | Al2O3_calc | FeOt_calc | MgO_calc | CaO_calc | Na2O_calc | K2O_calc | CHOMPI (SSI<6?) | Pass_Cali_test_SiO2? | Pass_Cali_test_Al2O3? | Pass_Cali_test_MgO? | Pass_Cali_test_Na2O? | Pass_Cali_test_K2O? | SiO2_Liq | TiO2_Liq | Al2O3_Liq | FeOt_Liq | MgO_Liq | CaO_Liq | Na2O_Liq | K2O_Liq | Fe3Fet_Liq | Sample_ID_Liq | NiO_Liq | CoO_Liq | CO2_Liq | H2O_Liq | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Strong_positive | 0.933310 | True | 1173.709528 | -299.440472 | 3.504459 | 0.725600 | 0.378169 | 69.893687 | 0.425833 | 16.037467 | 2.756033 | 0.915862 | 3.431091 | 3.841899 | 2.698127 | True | True | True | True | True | True | 69.299930 | 0.379375 | 15.675434 | 2.805987 | 1.408777 | 3.599436 | 4.258715 | 2.572347 | 0.0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 |
1 | Permissive_positive | 14.865142 | True | 1276.842769 | -196.307231 | 4.881374 | 0.539418 | 0.853850 | 59.635015 | 0.964393 | 19.167929 | 4.871097 | 2.948865 | 5.856037 | 4.394051 | 2.162614 | True | True | True | True | True | True | 62.700096 | 0.598123 | 17.082901 | 4.360429 | 3.670163 | 6.234633 | 4.140009 | 1.213647 | 0.0 | 1 | 0.0 | 0.0 | 0.0 | 0.0 |
2 | Strong_positive | 1.494860 | True | 1121.009366 | -352.140634 | 2.267972 | 0.732973 | 0.364307 | 72.840975 | 0.286233 | 14.364388 | 2.023597 | 0.208214 | 1.611477 | 4.526237 | 4.138879 | True | True | True | True | True | True | 73.812642 | 0.284803 | 13.799921 | 1.924439 | 0.362842 | 1.399290 | 4.134659 | 4.281403 | 0.0 | 2 | 0.0 | 0.0 | 0.0 | 0.0 |
3 | Permissive_positive | 8.354762 | True | 1289.833057 | -183.316943 | 5.757290 | 0.407235 | 1.455582 | 57.456685 | 1.054918 | 19.591490 | 5.720371 | 3.264518 | 6.313887 | 4.546906 | 2.051226 | True | True | True | True | True | True | 59.888020 | 0.778866 | 18.175961 | 5.804112 | 3.697594 | 6.364292 | 4.139059 | 1.152095 | 0.0 | 3 | 0.0 | 0.0 | 0.0 | 0.0 |
4 | Strong_positive | 0.800198 | True | 1110.734404 | -362.415596 | 1.259607 | 0.814489 | 0.227763 | 72.458598 | 0.270746 | 14.493137 | 2.238104 | 0.182659 | 1.587819 | 5.066988 | 3.701950 | True | True | True | True | True | True | 73.034776 | 0.234337 | 14.569193 | 2.082972 | 0.196227 | 0.948193 | 4.900449 | 4.033852 | 0.0 | 4 | 0.0 | 0.0 | 0.0 | 0.0 |
final_assessment | SSR | In Cali Range? | T_K_calc | T_K_residual | P_kbar_calc | XH2O_mol_calc | XCO2XH2O | SiO2_calc | TiO2_calc | Al2O3_calc | FeOt_calc | MgO_calc | CaO_calc | Na2O_calc | K2O_calc | CHOMPI (SSI<6?) | Pass_Cali_test_SiO2? | Pass_Cali_test_Al2O3? | Pass_Cali_test_MgO? | Pass_Cali_test_Na2O? | Pass_Cali_test_K2O? | SiO2_Liq | TiO2_Liq | Al2O3_Liq | FeOt_Liq | MgO_Liq | CaO_Liq | Na2O_Liq | K2O_Liq | Fe3Fet_Liq | Sample_ID_Liq | NiO_Liq | CoO_Liq | CO2_Liq | H2O_Liq | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Strong_positive | 0.852145 | True | 1173.709528 | -299.440472 | 3.504459 | 0.725600 | 0.378169 | 69.893687 | 0.377833 | 16.037467 | 2.756033 | 1.003862 | 3.431091 | 3.841899 | 2.658127 | True | True | True | True | True | True | 69.299930 | 0.379375 | 15.675434 | 2.805987 | 1.408777 | 3.599436 | 4.258715 | 2.572347 | 0.0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 |
1 | Permissive_positive | 14.713079 | True | 1276.842769 | -196.307231 | 4.881374 | 0.539418 | 0.853850 | 59.635015 | 0.916393 | 19.167929 | 4.871097 | 3.036865 | 5.856037 | 4.394051 | 2.122614 | True | True | True | True | True | True | 62.700096 | 0.598123 | 17.082901 | 4.360429 | 3.670163 | 6.234633 | 4.140009 | 1.213647 | 0.0 | 1 | 0.0 | 0.0 | 0.0 | 0.0 |
2 | Strong_positive | 1.477556 | True | 1121.009366 | -352.140634 | 2.267972 | 0.732973 | 0.364307 | 72.840975 | 0.238233 | 14.364388 | 2.023597 | 0.296214 | 1.611477 | 4.526237 | 4.098879 | True | True | True | True | True | True | 73.812642 | 0.284803 | 13.799921 | 1.924439 | 0.362842 | 1.399290 | 4.134659 | 4.281403 | 0.0 | 2 | 0.0 | 0.0 | 0.0 | 0.0 |
3 | Permissive_positive | 8.262088 | True | 1289.833057 | -183.316943 | 5.757290 | 0.407235 | 1.455582 | 57.456685 | 1.006918 | 19.591490 | 5.720371 | 3.352518 | 6.313887 | 4.546906 | 2.011226 | True | True | True | True | True | True | 59.888020 | 0.778866 | 18.175961 | 5.804112 | 3.697594 | 6.364292 | 4.139059 | 1.152095 | 0.0 | 3 | 0.0 | 0.0 | 0.0 | 0.0 |
4 | Strong_positive | 0.804362 | True | 1110.734404 | -362.415596 | 1.259607 | 0.814489 | 0.227763 | 72.458598 | 0.222746 | 14.493137 | 2.238104 | 0.270659 | 1.587819 | 5.066988 | 3.661950 | True | True | True | True | True | True | 73.034776 | 0.234337 | 14.569193 | 2.082972 | 0.196227 | 0.948193 | 4.900449 | 4.033852 | 0.0 | 4 | 0.0 | 0.0 | 0.0 | 0.0 |
[ ]: