Loading Melts Tables

pyrolite-meltsutil includes utilites to import the information from alphaMELTS-generated tables such that they can be more readily used for further interrogation and visualiastion.

This example shows how you would typically import a single experiment from the experiment directory. In this case we point you to a pyrolite-meltsutil example folder which already contains some table files. Note that the function returns two tables - one for system variables and one for phases, which contains information pertaining to individual phases or aggregates (e.g. ‘olivine_0’, ‘bulk’, ‘liquid’ etc).

from pyrolite_meltsutil.tables.load import import_tables
from pyrolite_meltsutil.util.general import get_data_example

# let's use the example batch data for this
experiment_dir = get_data_example("batch/363f3d0a0b")
system, phases = import_tables(experiment_dir)  # let's import the tables
/home/docs/checkouts/readthedocs.org/user_builds/pyrolite-meltsutil/checkouts/develop/pyrolite_meltsutil/tables/load.py:333: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.
  phase = pd.concat([phase, cumulate_comp])

The system table contains intensive variables and ‘whole of system’ measures.

(5000, 1300) (5000, 1290) (5000, 1280)
step 0.000000e+00 1.000000e+00 2.000000e+00
pressure 5.000000e+03 5.000000e+03 5.000000e+03
temperature 1.300000e+03 1.290000e+03 1.280000e+03
mass 9.939652e+01 9.939682e+01 9.939714e+01
F 1.000000e+00 1.000000e+00 1.000000e+00
phi 1.000000e+00 1.000000e+00 1.000000e+00
entropy 2.736931e+02 2.727447e+02 2.717903e+02
enthalpy -1.180334e+06 -1.181827e+06 -1.183320e+06
volume 3.628890e+01 3.626443e+01 3.623998e+01
dVdP*10^6 -1.814359e+02 -1.815891e+02 -1.817428e+02
dVdT*10^6 2.471388e+03 2.471513e+03 2.471646e+03
Cp 1.488222e+02 1.488238e+02 1.488254e+02
logfO2(absolute) -7.247000e+00 -7.346000e+00 -7.447000e+00
logfO2-QFM 0.000000e+00 0.000000e+00 0.000000e+00
rhol 2.739034e+00 2.740890e+00 2.742748e+00
rhos 0.000000e+00 0.000000e+00 0.000000e+00
viscosity 2.024000e+00 2.064000e+00 2.105000e+00
aH2O 0.000000e+00 0.000000e+00 0.000000e+00
chisqr 0.000000e+00 0.000000e+00 0.000000e+00
mass% 1.000000e+02 1.000003e+02 1.000006e+02
volume% 1.000000e+02 9.993258e+01 9.986521e+01


The phases table contains information about individual components. In this case this includes the liquid, and also other aggregate measures such as ‘bulk’ and ‘solid’.

(5000, 1290) (5000, 1170) (5000, 1170)
step 1 13 13
pressure 5000.0 5000.0 5000.0
temperature 1290.0 1170.0 1170.0
mass 99.396821 67.999377 0.946826
entropy NaN NaN 2.231831
enthalpy NaN NaN -10938.122505
volume NaN NaN 0.282183
Cp NaN NaN 1.121183
viscosity NaN NaN NaN
SiO2 50.7159 6.008481 50.1368
TiO2 1.54935 6.037164 0.469525
Al2O3 15.0407 8.160833 4.27892
Fe2O3 1.41409 8.236141 1.62997
FeO 8.8587 8.912174 18.0233
MnO 0.17405 8.912174 0.0
MgO 7.73667 9.607979 17.7881
CaO 11.4189 10.70147 7.43182
Na2O 2.77675 11.134156 0.241609
K2O 0.144874 11.144714 0.0
P2O5 0.170026 11.144714 0.0
Mg# 0.608882 0.657735 0.637587
phaseID NaN NaN clinopyroxene_0
phase bulk cumulate clinopyroxene
formula NaN NaN Na0.02Ca0.3Fe{2+}0.56Mg0.99Fe{3+}0.05Ti0.01Al0...
structure NaN NaN cpx
mass% 100.000303 68.412231 0.952575
volume% NaN NaN 0.777602


The standard MELTS tables are extended to generate a ‘cumulate’ composiiton of integrated solids (for fractional crystallisation experiments) from the phases table:

cumulate = phases.loc[phases.phase == "cumulate", :]

Some of the thermodynamic variables will necessarily be missing for now, but most other relevant variables are present:

cumulate.sample(3).dropna(how="all", axis="columns").T
(5000, 1300) (5000, 1230) (5000, 1240)
step 0 7 6
pressure NaN 5000.0 5000.0
temperature NaN 1230.0 1240.0
mass 0.0 30.152252 16.91258
SiO2 0.0 5.859363 5.977881
TiO2 0.0 5.880174 6.015734
Al2O3 0.0 8.06166 7.44965
Fe2O3 0.0 8.131114 7.570659
FeO 0.0 8.632891 8.213393
MnO 0.0 8.632891 8.213393
MgO 0.0 9.587405 9.700182
CaO 0.0 11.103842 11.611412
Na2O 0.0 11.368497 11.74858
K2O 0.0 11.371081 11.749558
P2O5 0.0 11.371081 11.749558
Mg# NaN 0.664389 0.677962
phase cumulate cumulate cumulate
mass% 0.0 30.33532 17.015264


These cumulate compositions are generated with the integrate_solid_composition() function (along with a few additions provided in import_tables() which reindex and calcuate relative percentages using the system table). You should get similar results with:

from pyrolite_meltsutil.util.tables import integrate_solid_composition

cumulate_comp = integrate_solid_composition(phases)
cumulate_comp.tail()
step pressure temperature mass entropy enthalpy volume Cp viscosity SiO2 TiO2 Al2O3 Fe2O3 FeO MnO MgO CaO Na2O K2O P2O5 Mg# phaseID phase formula structure mass% volume%
(5000, 1210) 9.0 5000.0 1210.0 48.987740 NaN NaN NaN NaN NaN 5.898307 5.918431 8.114838 8.180449 8.775893 8.775893 9.654138 10.924174 11.249662 11.254108 11.254108 0.662269 NaN NaN NaN NaN NaN NaN
(5000, 1200) 10.0 5000.0 1200.0 55.269095 NaN NaN NaN NaN NaN 5.924116 5.946533 8.125842 8.194184 8.811160 8.811160 9.641844 10.869362 11.221547 11.227126 11.227126 0.661086 NaN NaN NaN NaN NaN NaN
(5000, 1190) 11.0 5000.0 1190.0 60.320954 NaN NaN NaN NaN NaN 5.950951 5.975578 8.137289 8.208163 8.845525 8.845525 9.630017 10.814085 11.192999 11.199934 11.199934 0.659937 NaN NaN NaN NaN NaN NaN
(5000, 1180) 12.0 5000.0 1180.0 64.488064 NaN NaN NaN NaN NaN 5.978991 6.005728 8.148943 8.222155 8.879111 8.879111 9.618701 10.758244 11.163960 11.172528 11.172528 0.658822 NaN NaN NaN NaN NaN NaN
(5000, 1170) 13.0 5000.0 1170.0 67.999377 NaN NaN NaN NaN NaN 6.008481 6.037164 8.160833 8.236141 8.912174 8.912174 9.607979 10.701470 11.134156 11.144714 11.144714 0.657735 NaN NaN NaN NaN NaN NaN


Similarly, you can integrate phase proportions using integrate_solid_proportions():

from pyrolite_meltsutil.util.tables import integrate_solid_proportions

cumulate_phases = integrate_solid_proportions(phases)
cumulate_phases.tail()
pressure temperature step clinopyroxene_0 clinopyroxene_1 feldspar_0
(5000, 1210) 5000.0 1210.0 9 51.989077 6.829321 41.181602
(5000, 1200) 5000.0 1200.0 10 49.492175 7.192969 43.314856
(5000, 1190) 5000.0 1190.0 11 47.765816 7.455552 44.778632
(5000, 1180) 5000.0 1180.0 12 46.479335 7.652483 45.868183
(5000, 1170) 5000.0 1170.0 13 45.471665 7.801344 46.726991


Total running time of the script: (0 minutes 0.287 seconds)

Gallery generated by Sphinx-Gallery