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

[2]:
load=pt.import_excel('Redox_Conversions.xlsx', sheet_name="Liqs", suffix='_Liq')
Liqs=load['Liqs']
Liqs.head()
[2]:
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

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

1a: Using a value for logfo2

[4]:
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()
[4]:
SiO2_Liq TiO2_Liq Al2O3_Liq Fe2O3_Liq FeO_Liq MnO_Liq MgO_Liq CaO_Liq Na2O_Liq K2O_Liq P2O5_Liq Fe3Fet_Liq ln_XFe2FeO3_XFeO
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.916290
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 -1.897726
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 -1.883008
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 -1.874703
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 -1.847396
[5]:
plt.plot(myLiquids_Fe3_Kress_norm['MgO_Liq'], myLiquids_Fe3_Kress_norm['Fe3Fet_Liq'], '-r')
plt.xlabel('MgO Liq')
plt.ylabel('Fe3Fet Liq')
[5]:
Text(0, 0.5, 'Fe3Fet Liq')
../../_images/Examples_Other_features_fo2_to_Fe3FeT_8_1.png

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

[6]:
# 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=1200+273.15,
                            P_kbar=1.734, fo2="QFM", fo2_offset=0, model="Kress1991", renorm=True)
myLiquids_Fe3_Kress_norm_QFM.head()
[6]:
SiO2_Liq TiO2_Liq Al2O3_Liq Fe2O3_Liq FeO_Liq MnO_Liq MgO_Liq CaO_Liq Na2O_Liq K2O_Liq P2O5_Liq Fe3Fet_Liq ln_XFe2FeO3_XFeO
0 51.622224 2.610098 13.572799 1.866153 9.470432 0.186474 6.720126 11.010078 2.414705 0.485364 0.249339 0.150603 -2.422469
1 51.633633 2.650250 13.763233 1.867267 9.531780 0.190201 6.519587 10.850608 2.459283 0.495067 0.254323 0.149855 -2.428329
2 51.676499 2.781414 13.716054 1.905119 9.848144 0.201224 6.297933 10.497502 2.518245 0.522373 0.269062 0.148259 -2.440912
3 51.703454 2.883796 13.621385 1.936526 10.097010 0.209701 6.161646 10.256669 2.553453 0.543141 0.280396 0.147176 -2.449517
4 51.720280 3.071636 13.405710 1.992969 10.471292 0.224710 5.881258 10.018894 2.603396 0.579541 0.300465 0.146216 -2.457186
[7]:
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')
[7]:
Text(0, 0.5, 'Fe3Fet Liq')
../../_images/Examples_Other_features_fo2_to_Fe3FeT_11_1.png

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

[8]:
# 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()
[8]:
SiO2_Liq TiO2_Liq Al2O3_Liq Fe2O3_Liq FeO_Liq MnO_Liq MgO_Liq CaO_Liq Na2O_Liq K2O_Liq P2O5_Liq Fe3Fet_Liq ln_XFe2FeO3_XFeO
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.687440
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 -1.691251
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 -1.701514
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 -1.708666
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 -1.713293
[9]:
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')
[9]:
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

[10]:
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 ... H2O_Liq Fe3Fet_Liq NiO_Liq CoO_Liq CO2_Liq Sample_ID_Liq FeO_Liq Fe2O3_Liq XFe3Fe2 ln_XFe2FeO3_XFeO
0 51.456179 2.60169 13.529073 11.11461 0.185873 6.698477 10.974609 2.406926 0.483801 0.0 ... 0.508277 0.227286 0.0 0.0 0.0 0 8.589075 2.807726 0.147152 -1.91629

1 rows × 21 columns

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 ln_XFe2FeO3_XFeO
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 -1.91629

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

[11]:
## 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)
using inputted FeO and Fe2O3 contents
(49,)
[12]:
calc_fo2
[12]:
DeltaQFM_Frost1991 DeltaNNO_Frost1991 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 ln_XFe2FeO3_XFeO FeOt_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.687440 11.132479
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 -1.691251 11.194643
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 -1.701514 11.544059
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 -1.708666 11.820369
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 -1.713293 12.244066
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 -1.714823 12.523550
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 -1.717094 12.933002
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 -1.718595 13.199906
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 -1.720831 13.591826
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 -1.722315 13.847810
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 -1.724532 14.224314
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 -1.726005 14.470564
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 -1.726005 14.470564
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 -1.726740 14.592314
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 -1.727475 14.713166
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 -1.728209 14.833132
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 -1.728942 14.952224
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 -1.729562 15.066224
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 -1.723305 14.531444
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 -1.717905 14.072685
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 -1.713409 13.692598
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 -1.709471 13.360979
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 -1.705893 13.060760
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 -1.696627 12.287555
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 -1.685169 11.341740
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 -1.678367 10.783049
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 -1.672346 10.290116
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 -1.665294 9.714217
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 -1.660613 9.332311
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 -1.656372 8.986360
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 -1.652519 8.671629
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 -1.647907 8.294152
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 -1.644799 8.038846
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 -1.641906 7.799956
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 -1.638315 7.500744
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 -1.635955 7.302138
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 -1.633855 7.123598
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 -1.631405 6.911521
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 -1.629825 6.772314
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 -1.628446 6.648508
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 -1.626889 6.505096
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 -1.625913 6.412242
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 -1.625084 6.330810
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 -1.624391 6.259847
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 -1.623657 6.180035
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 -1.623237 6.130281
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 -1.622923 6.088466
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 -1.622663 6.043810
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 -1.622798 6.014841
[ ]: