Visualising Cumulate Compositions

First we’ll import a set of example data tables:

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

hsh = "3149b39eee"  # the hash index of our experiment
batchdir = get_data_example("montecarlo")  # let's use the example batch data for this
system, phases = import_tables(batchdir / hsh)  # let's import the tables

The cumulate composition is automatically calculated and added to the phase table:

phases.loc[phases.phase == "cumulate", :].head(3).T
(5000, 1300) (5000, 1295) (5000, 1290)
step 0 1 2
pressure NaN NaN NaN
temperature NaN NaN NaN
mass NaN NaN NaN
entropy NaN NaN NaN
enthalpy NaN NaN NaN
volume NaN NaN NaN
Cp NaN NaN NaN
viscosity NaN NaN NaN
SiO2 NaN NaN NaN
TiO2 NaN NaN NaN
Al2O3 NaN NaN NaN
Fe2O3 NaN NaN NaN
FeO NaN NaN NaN
MnO NaN NaN NaN
MgO NaN NaN NaN
CaO NaN NaN NaN
Na2O NaN NaN NaN
K2O NaN NaN NaN
P2O5 NaN NaN NaN
Mg# NaN NaN NaN
phaseID NaN NaN NaN
phase cumulate cumulate cumulate
structure NaN NaN NaN
formula NaN NaN NaN
mass% NaN NaN NaN
volume% NaN NaN NaN


We can also manually calculate the phase mass proportions for the cumulate pile:

from pyrolite_meltsutil.util.tables import integrate_solid_proportions

cumulate_phases = integrate_solid_proportions(phases, frac=False)
cumulate_phases.tail(3).T
(5000, 745) (5000, 740) (5000, 735)
pressure 5000.000000 5000.000000 5000.000000
temperature 745.000000 740.000000 735.000000
step 111.000000 112.000000 113.000000
clinopyroxene_0 22.560717 22.569348 22.578173
clinopyroxene_1 25.775885 25.773038 25.770461
clinopyroxene_2 8.750804 8.759462 8.767811
feldspar_0 41.084019 41.068917 41.053587
olivine_0 0.802876 0.803690 0.804486
quartz 1.025699 1.025545 1.025482
rhm-oxide_0 0.000000 0.000000 0.000000
whitlockite 0.000000 0.000000 0.000000


Ternary diagrams can be useful to visualise how the overal/fractional cumulates change during the experiment:

import matplotlib.pyplot as plt
import pyrolite.plot
from pyrolite.util.plot.style import mappable_from_values

chemvars = ["MgO", "Al2O3", "FeO"]
cumulate_comp = phases.loc[phases.phase == "cumulate", :]
ax = cumulate_comp.loc[:, chemvars].pyroplot.scatter(
    c=cumulate_comp.temperature, cmap="magma"
)
plt.colorbar(
    mappable_from_values(cumulate_comp.temperature.dropna(), cmap="magma"),
    label="Temperature (C)",
    ax=ax,
    shrink=0.7,
)
plt.show()
vis cumulates

Similarly, we can plot the phase proportions:

phaselist = ["clinopyroxene_0", "clinopyroxene_1", "feldspar_0"]
ax = cumulate_phases.loc[:, phaselist].pyroplot.scatter(
    c=cumulate_phases.temperature, cmap="magma"
)
plt.colorbar(
    mappable_from_values(cumulate_phases.temperature, cmap="magma"),
    label="Temperature (C)",
    ax=ax,
    shrink=0.7,
)
plt.show()
vis cumulates

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

Gallery generated by Sphinx-Gallery