Exemplo n.º 1
0
"""
import pandas as pd
import numpy as np
from pyrolite.mineral.mindb import get_mineral
from pyrolite.mineral.normative import endmember_decompose

########################################################################################
# First we'll start with a composition of an unknown olivine:
#
comp = pd.Series({"MgO": 42.06, "SiO2": 39.19, "FeO": 18.75})
########################################################################################
# We can break this down into olivine endmebmers using the
# :func:`~pyrolite.mineral.transform.endmember_decompose` function:
#
ed = endmember_decompose(pd.DataFrame(comp).T,
                         endmembers="olivine",
                         ord=1,
                         molecular=True)
ed
########################################################################################
# Equally, if you knew the likely endmembers beforehand, you could specify a list of
# endmembers:
#
ed = endmember_decompose(pd.DataFrame(comp).T,
                         endmembers=["forsterite", "fayalite"],
                         ord=1,
                         molecular=True)
ed
########################################################################################
# We can check this by recombining the components with these proportions. We can first
# lookup the compositions for our endmembers:
#
Exemplo n.º 2
0
 def test_molecular(self):
     for molecular in [True, False]:
         with self.subTest(molecular=molecular):
             s = endmember_decompose(self.df, molecular=molecular)
Exemplo n.º 3
0
 def test_endmembers_list_formulae(self):
     res = endmember_decompose(self.df, endmembers=["Mg2SiO4", "Fe2SiO4"])
Exemplo n.º 4
0
 def test_endmembers_list_mineralnames(self):
     res = endmember_decompose(self.df,
                               endmembers=["forsterite", "fayalite"])
Exemplo n.º 5
0
 def test_endmembers_mineral_group(self):
     res = endmember_decompose(self.df, endmembers="olivine")
Exemplo n.º 6
0
 def test_default(self):
     res = endmember_decompose(self.df)