This page was generated from docs/Examples/Other_features/fo2_to_Fe3FeT.ipynb. Interactive online version: Binder badge.

Python Notebook Download

Converting back and forth from Fe3Fet to different redox buffer positions.

[1]:
# Loading various python things
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import Thermobar as pt

Load in data

  • No suffix in file, so add here to say they are liquids

[15]:
load=pt.import_excel('Redox_Conversions.xlsx', sheet_name="Liqs", suffix='_Liq')
Liqs=load['Liqs']
Liqs.head()
[15]:
SiO2_Liq TiO2_Liq Al2O3_Liq FeOt_Liq MnO_Liq MgO_Liq CaO_Liq Na2O_Liq K2O_Liq Cr2O3_Liq P2O5_Liq H2O_Liq Fe3Fet_Liq NiO_Liq CoO_Liq CO2_Liq Sample_ID_Liq
0 51.456179 2.601690 13.529073 11.114610 0.185873 6.698477 10.974609 2.406926 0.483801 0.0 0.248535 0.508277 0.0 0.0 0.0 0.0 0
1 51.462403 2.641448 13.717522 11.175642 0.189570 6.497934 10.814571 2.451116 0.493423 0.0 0.253478 0.518386 0.0 0.0 0.0 0.0 1
2 51.491657 2.771451 13.666925 11.521905 0.200504 6.275374 10.459901 2.509225 0.520502 0.0 0.268098 0.548285 0.0 0.0 0.0 0.0 2
3 51.508276 2.872896 13.569897 11.795709 0.208908 6.138356 10.217900 2.543802 0.541088 0.0 0.279336 0.571268 0.0 0.0 0.0 0.0 3
4 51.506960 3.058952 13.350351 12.214913 0.223782 5.856971 9.977521 2.592645 0.577148 0.0 0.299224 0.611940 0.0 0.0 0.0 0.0 4

Example 1: Calculating Fe3Fet for a series of liquid compositions

  • Remember, Fe3Fet_Liq to buffer positions is very dependent on temperature, so first we need to choose a thermometer

[16]:
# Calculate temperature
T_HT87=pt.calculate_liq_only_temp(liq_comps=Liqs, equationT='T_Helz1987_MgO')

1a: Using a value for logfo2

[17]:
logfo2=-7.58429552677443

# Calculate oxides using Kress 1991 and 3 kbar, and
myLiquids_Fe3_Kress_norm=pt.convert_fo2_to_fe_partition(liq_comps=Liqs, T_K=T_HT87,
                            P_kbar=3, fo2=10**logfo2, model="Kress1991", renorm=True)
myLiquids_Fe3_Kress_norm.head()
[17]:
SiO2_Liq TiO2_Liq Al2O3_Liq Fe2O3_Liq FeO_Liq MnO_Liq MgO_Liq CaO_Liq Na2O_Liq K2O_Liq P2O5_Liq Fe3Fet_Liq
0 51.573474 2.607633 13.559981 2.813568 8.606944 0.186298 6.713780 10.999680 2.412425 0.484906 0.249103 0.227286
1 51.582033 2.647602 13.749479 2.869927 8.617879 0.190011 6.513072 10.839765 2.456826 0.494572 0.254069 0.230563
2 51.620474 2.778399 13.701184 2.993012 8.856176 0.201006 6.291105 10.486121 2.515515 0.521807 0.268770 0.233184
3 51.644329 2.880498 13.605809 3.084121 9.050289 0.209461 6.154600 10.244940 2.550534 0.542520 0.280075 0.234673
4 51.654905 3.067754 13.388765 3.261699 9.313550 0.224426 5.873824 10.006230 2.600105 0.578808 0.300085 0.239613
[19]:
plt.plot(myLiquids_Fe3_Kress_norm['MgO_Liq'], myLiquids_Fe3_Kress_norm['Fe3Fet_Liq'], '-r')
plt.xlabel('MgO Liq')
plt.ylabel('Fe3Fet Liq')
[19]:
Text(0, 0.5, 'Fe3Fet Liq')
../../_images/Examples_Other_features_fo2_to_Fe3FeT_8_1.png

1b: At a known buffer (here, QFM)

[21]:
# Calculate oxides using Kress 1991 and 3 kbar, and
myLiquids_Fe3_Kress_norm_QFM=pt.convert_fo2_to_fe_partition(liq_comps=Liqs, T_K=T_HT87,
                            P_kbar=3, fo2="QFM", model="Kress1991", renorm=True)
myLiquids_Fe3_Kress_norm_QFM.head()
[21]:
SiO2_Liq TiO2_Liq Al2O3_Liq Fe2O3_Liq FeO_Liq MnO_Liq MgO_Liq CaO_Liq Na2O_Liq K2O_Liq P2O5_Liq Fe3Fet_Liq
0 51.621424 2.610058 13.572588 1.881698 9.456264 0.186471 6.720022 11.009907 2.414668 0.485357 0.249335 0.151860
1 51.632661 2.650201 13.762974 1.886144 9.514574 0.190198 6.519464 10.850404 2.459237 0.495057 0.254318 0.151373
2 51.675308 2.781350 13.715738 1.928249 9.827054 0.201220 6.297788 10.497260 2.518187 0.522361 0.269056 0.150063
3 51.702115 2.883721 13.621032 1.962512 10.073308 0.209695 6.161487 10.256404 2.553387 0.543127 0.280389 0.149155
4 51.718628 3.071538 13.405281 2.025025 10.442040 0.224702 5.881070 10.018574 2.603312 0.579522 0.300455 0.148573
[22]:
plt.plot(myLiquids_Fe3_Kress_norm_QFM['MgO_Liq'], myLiquids_Fe3_Kress_norm_QFM['Fe3Fet_Liq'], '-r')
plt.xlabel('MgO Liq')
plt.ylabel('Fe3Fet Liq')
[22]:
Text(0, 0.5, 'Fe3Fet Liq')
../../_images/Examples_Other_features_fo2_to_Fe3FeT_11_1.png

1c: At buffer with offset (here NNO+1)

[24]:
# Calculate oxides using Kress 1991 and 3 kbar, and
myLiquids_Fe3_Kress_norm_NNO1=pt.convert_fo2_to_fe_partition(liq_comps=Liqs, T_K=T_HT87,
                            P_kbar=3, fo2="NNO", fo2_offset=1, model="Kress1991", renorm=True)
myLiquids_Fe3_Kress_norm_NNO1.head()
[24]:
SiO2_Liq TiO2_Liq Al2O3_Liq Fe2O3_Liq FeO_Liq MnO_Liq MgO_Liq CaO_Liq Na2O_Liq K2O_Liq P2O5_Liq Fe3Fet_Liq
0 51.546390 2.606264 13.552860 3.339932 8.127207 0.186200 6.710254 10.993904 2.411158 0.484651 0.248972 0.269955
1 51.557365 2.646336 13.742904 3.349248 8.180990 0.189920 6.509957 10.834581 2.455651 0.494335 0.253947 0.269205
2 51.598076 2.777193 13.695239 3.427946 8.459594 0.200919 6.288375 10.481571 2.514423 0.521581 0.268654 0.267191
3 51.623335 2.879327 13.600278 3.491627 8.678603 0.209376 6.152098 10.240776 2.549497 0.542300 0.279962 0.265793
4 51.637241 3.066705 13.384186 3.604510 9.000728 0.224349 5.871815 10.002808 2.599216 0.578610 0.299982 0.264891
[25]:
plt.plot(myLiquids_Fe3_Kress_norm_NNO1['MgO_Liq'], myLiquids_Fe3_Kress_norm_NNO1['Fe3Fet_Liq'], '-r')
plt.xlabel('MgO Liq')
plt.ylabel('Fe3Fet Liq')
[25]:
Text(0, 0.5, 'Fe3Fet Liq')
../../_images/Examples_Other_features_fo2_to_Fe3FeT_14_1.png

1d: With different normalization routines:

  • So far, we used Norm=True, this renormalizes the other oxides to account for the changing FeO and Fe2O3 amount, can also put false, doesn’t affect the Fe3FeT but affects the oxide concs. You can see this by comparing the other oxide contents

[29]:
logfo2=-7.58429552677443
print('Original')
display(Liqs.loc[[0]])

# No renormalizatoin
myLiquids_Fe3_Kress_nonorm=pt.convert_fo2_to_fe_partition(liq_comps=Liqs.loc[[0]], T_K=T_HT87.loc[[0]],
                            P_kbar=3, fo2=10**logfo2, model="Kress1991", renorm=False)
print('No Norm')
display(myLiquids_Fe3_Kress_nonorm)


# With renormalization
myLiquids_Fe3_Kress_norm=pt.convert_fo2_to_fe_partition(liq_comps=Liqs.loc[[0]], T_K=T_HT87.loc[[0]],
                            P_kbar=3, fo2=10**logfo2, model="Kress1991", renorm=True)
print('Renorm')
display(myLiquids_Fe3_Kress_norm)

Original
SiO2_Liq TiO2_Liq Al2O3_Liq FeOt_Liq MnO_Liq MgO_Liq CaO_Liq Na2O_Liq K2O_Liq Cr2O3_Liq P2O5_Liq H2O_Liq Fe3Fet_Liq NiO_Liq CoO_Liq CO2_Liq Sample_ID_Liq
0 51.456179 2.60169 13.529073 11.11461 0.185873 6.698477 10.974609 2.406926 0.483801 0.0 0.248535 0.508277 0.0 0.0 0.0 0.0 0
No Norm
SiO2_Liq TiO2_Liq Al2O3_Liq FeOt_Liq MnO_Liq MgO_Liq CaO_Liq Na2O_Liq K2O_Liq Cr2O3_Liq P2O5_Liq H2O_Liq Fe3Fet_Liq NiO_Liq CoO_Liq CO2_Liq Sample_ID_Liq FeO_Liq Fe2O3_Liq XFe3Fe2
0 51.456179 2.60169 13.529073 11.11461 0.185873 6.698477 10.974609 2.406926 0.483801 0.0 0.248535 0.508277 0.227286 0.0 0.0 0.0 0 8.589075 2.807726 0.147152
Renorm
SiO2_Liq TiO2_Liq Al2O3_Liq Fe2O3_Liq FeO_Liq MnO_Liq MgO_Liq CaO_Liq Na2O_Liq K2O_Liq P2O5_Liq Fe3Fet_Liq
0 51.573474 2.607633 13.559981 2.813568 8.606944 0.186298 6.71378 10.99968 2.412425 0.484906 0.249103 0.227286

Converting from FeO and Fe2O3 proportions to fo2

  • This function goes the other way, it takes a liquid with FeO and Fe2O3, and a temperature and pressure, and converts to a buffer position/delta fo2 vlaue

[41]:
## The inversion isn't quite perfect, but is very close
calc_fo2=pt.convert_fe_partition_to_fo2(liq_comps=myLiquids_Fe3_Kress_norm_NNO1,
                                        T_K=T_HT87, P_kbar=3, model="Kress1991", renorm=False)
[42]:
calc_fo2
[42]:
DeltaQFM DeltaNNO fo2_calc SiO2_Liq TiO2_Liq Al2O3_Liq Fe2O3_Liq FeO_Liq MnO_Liq MgO_Liq CaO_Liq Na2O_Liq K2O_Liq P2O5_Liq Fe3Fet_Liq
0 1.587252 0.980283 7.999607e-08 51.546390 2.606264 13.552860 3.339932 8.127207 0.186200 6.710254 10.993904 2.411158 0.484651 0.248972 0.269955
1 1.587349 0.980431 7.139051e-08 51.557365 2.646336 13.742904 3.349248 8.180990 0.189920 6.509957 10.834581 2.455651 0.494335 0.253947 0.269205
2 1.587300 0.980439 6.284887e-08 51.598076 2.777193 13.695239 3.427946 8.459594 0.200919 6.288375 10.481571 2.514423 0.521581 0.268654 0.267191
3 1.587231 0.980406 5.807824e-08 51.623335 2.879327 13.600278 3.491627 8.678603 0.209376 6.152098 10.240776 2.549497 0.542300 0.279962 0.265793
4 1.586615 0.979863 4.928451e-08 51.637241 3.066705 13.384186 3.604510 9.000728 0.224349 5.871815 10.002808 2.599216 0.578610 0.299982 0.264891
5 1.586086 0.979386 4.382653e-08 51.638351 3.199578 13.221434 3.682642 9.209909 0.234892 5.673066 9.879096 2.629078 0.603989 0.314080 0.264593
6 1.585330 0.978706 3.698529e-08 51.634502 3.398218 12.978289 3.796698 9.516734 0.250723 5.387579 9.701648 2.668614 0.641860 0.335248 0.264151
7 1.584851 0.978275 3.316046e-08 51.628396 3.530278 12.816809 3.870774 9.716984 0.261292 5.205129 9.588480 2.691642 0.666987 0.349380 0.263860
8 1.584167 0.977661 2.831006e-08 51.614145 3.727939 12.575476 3.979141 10.011395 0.277175 4.942417 9.425986 2.721464 0.704516 0.370618 0.263425
9 1.583734 0.977274 2.556757e-08 51.601373 3.859495 12.415173 4.049654 10.203931 0.287788 4.774137 9.322264 2.738345 0.729436 0.384809 0.263138
10 1.583119 0.976725 2.205359e-08 51.577516 4.056607 12.175604 4.152968 10.487474 0.303752 4.531307 9.173226 2.759398 0.766683 0.406155 0.262708
11 1.582732 0.976380 2.004672e-08 51.558600 4.187924 12.016501 4.220276 10.673160 0.314429 4.375443 9.078035 2.770713 0.791434 0.420430 0.262423
12 1.582732 0.976380 2.004672e-08 51.558600 4.187924 12.016501 4.220276 10.673160 0.314429 4.375443 9.078035 2.770713 0.791434 0.420430 0.262423
13 1.582544 0.976214 1.913018e-08 51.548269 4.253568 11.937139 4.253476 10.765036 0.319778 4.299228 9.031643 2.775586 0.803787 0.427583 0.262280
14 1.582362 0.976051 1.826626e-08 51.537371 4.319209 11.857907 4.286379 10.856281 0.325135 4.224120 8.986032 2.779949 0.816127 0.434746 0.262138
15 1.582183 0.975893 1.745137e-08 51.525916 4.384849 11.778808 4.318990 10.946905 0.330500 4.150092 8.941187 2.783811 0.828454 0.441920 0.261996
16 1.582009 0.975739 1.668222e-08 51.513916 4.450493 11.699847 4.351312 11.036914 0.335874 4.077119 8.897096 2.787183 0.840768 0.449106 0.261855
17 1.581827 0.975579 1.589241e-08 51.529100 4.496905 11.625147 4.382480 11.122869 0.341191 3.998756 8.848689 2.792709 0.854256 0.456956 0.261735
18 1.581695 0.975511 1.375841e-08 52.612734 4.263861 11.713650 4.246476 10.710464 0.327012 3.766118 8.463650 2.870163 0.979760 0.463878 0.262946
19 1.581520 0.975392 1.214620e-08 53.545497 4.063865 11.790118 4.128805 10.357587 0.314846 3.566451 8.133268 2.936798 1.087593 0.469841 0.263994
20 1.581327 0.975246 1.094722e-08 54.320717 3.898105 11.853887 4.030598 10.065866 0.304765 3.400949 7.859484 2.992153 1.177063 0.474801 0.264868
21 1.581123 0.975083 9.993273e-09 54.998878 3.753437 11.909834 3.944379 9.811827 0.295969 3.256496 7.620568 3.040558 1.255220 0.479143 0.265636
22 1.580911 0.974907 9.198004e-09 55.614102 3.622435 11.960703 3.865888 9.582234 0.288004 3.125681 7.404243 3.084456 1.326045 0.483083 0.266334
23 1.580231 0.974324 7.416449e-09 57.204632 3.284890 12.092753 3.661803 8.992664 0.267487 2.788582 6.846957 3.197883 1.508776 0.493280 0.268149
24 1.579221 0.973432 5.683154e-09 59.154871 2.871874 12.255080 3.408360 8.274897 0.242386 2.376084 6.165149 3.336912 1.732547 0.505790 0.270403
25 1.578437 0.972719 4.846800e-09 60.316296 2.627669 12.352587 3.256571 7.852786 0.227552 2.132128 5.762176 3.419607 1.865233 0.513254 0.271747
26 1.577633 0.971978 4.206919e-09 61.346095 2.412078 12.439490 3.121347 7.481528 0.214461 1.916728 5.406509 3.492877 1.982573 0.519881 0.272940
27 1.576543 0.970962 3.560534e-09 62.556232 2.160024 12.542227 2.961789 7.049199 0.199161 1.664854 4.990808 3.578904 2.120038 0.527678 0.274342
28 1.575718 0.970186 3.184888e-09 63.363583 1.992753 12.611191 2.855025 6.763360 0.189011 1.497674 4.715018 3.636246 2.211458 0.532887 0.275275
29 1.574891 0.969404 2.877135e-09 64.098829 1.841131 12.674334 2.757645 6.505031 0.179815 1.346111 4.465098 3.688427 2.294479 0.537637 0.276122
30 1.574065 0.968618 2.621649e-09 64.771438 1.703098 12.732418 2.668493 6.270519 0.171445 1.208111 4.237641 3.736124 2.370207 0.541988 0.276893
31 1.572966 0.967569 2.343280e-09 65.583633 1.537408 12.803026 2.560853 5.989896 0.161403 1.042426 3.964702 3.793663 2.461326 0.547249 0.277817
32 1.572146 0.966783 2.170925e-09 66.136981 1.425242 12.851474 2.487602 5.800502 0.154609 0.930241 3.780003 3.832823 2.523170 0.550840 0.278441
33 1.571302 0.965970 2.020282e-09 66.659137 1.320178 12.897561 2.418719 5.623593 0.148248 0.825132 3.607073 3.869732 2.581271 0.554235 0.279022
34 1.570115 0.964823 1.845036e-09 67.320571 1.188397 12.956564 2.331963 5.402444 0.140275 0.693250 3.390294 3.916410 2.654442 0.558545 0.279746
35 1.569236 0.963970 1.736422e-09 67.764932 1.100791 12.996645 2.274078 5.255923 0.134980 0.605547 3.246275 3.947716 2.703295 0.561449 0.280221
36 1.568370 0.963128 1.643674e-09 68.168968 1.021921 13.033462 2.221829 5.124396 0.130216 0.526562 3.116695 3.976137 2.747456 0.564096 0.280645
37 1.567206 0.961992 1.539031e-09 68.657179 0.928027 13.078620 2.159486 4.968416 0.124551 0.432482 2.962573 4.010397 2.800356 0.567305 0.281140
38 1.566354 0.961159 1.473449e-09 68.983138 0.866257 13.109207 2.118394 4.866183 0.120829 0.370557 2.861274 4.033219 2.835374 0.569456 0.281459
39 1.565521 0.960342 1.417047e-09 69.277768 0.811201 13.137225 2.081729 4.775369 0.117516 0.315335 2.771067 4.053804 2.866770 0.571406 0.281738
40 1.564441 0.959282 1.353801e-09 69.626379 0.747242 13.170940 2.039103 4.670311 0.113672 0.251141 2.666395 4.078091 2.903531 0.573723 0.282053
41 1.563655 0.958509 1.313931e-09 69.857694 0.705689 13.193732 2.011406 4.602379 0.111179 0.209403 2.598487 4.094157 2.927632 0.575268 0.282251
42 1.562891 0.957756 1.279569e-09 70.065498 0.669123 13.214572 1.987043 4.542868 0.108990 0.172645 2.538813 4.108545 2.949032 0.576662 0.282419
43 1.562148 0.957023 1.250000e-09 70.251670 0.637130 13.233607 1.965748 4.491067 0.107078 0.140454 2.486686 4.121392 2.967954 0.577917 0.282560
44 1.561192 0.956077 1.217011e-09 70.469170 0.600944 13.256412 1.941707 4.432888 0.104923 0.103998 2.427862 4.136333 2.989668 0.579393 0.282708
45 1.560499 0.955392 1.196463e-09 70.611226 0.578222 13.271741 1.926656 4.396676 0.103574 0.081069 2.391034 4.146039 3.003551 0.580365 0.282794
46 1.559812 0.954711 1.179003e-09 70.737740 0.558946 13.285850 1.913944 4.366299 0.102436 0.061577 2.359909 4.154628 3.015600 0.581238 0.282857
47 1.558883 0.953788 1.159793e-09 70.886236 0.538023 13.303220 1.900261 4.333956 0.101211 0.040344 2.326343 4.164613 3.029184 0.582277 0.282910
48 1.557488 0.952397 1.144100e-09 71.036962 0.523079 13.323848 1.890969 4.313347 0.100377 0.024876 2.303243 4.174388 3.040906 0.583383 0.282883
[ ]: