Exemplo n.º 1
0
from pyrolite.geochem.norm import get_reference_composition, all_reference_compositions

########################################################################################
chondrite = get_reference_composition("Chondrite_PON")
########################################################################################
# To use the compositions with a specific set of units, you can change them with
# :func:`~pyrolite.geochem.norm.Composition.set_units`:
#
CI = chondrite.set_units("ppm")
#########################################################################################
# The :func:`~pyrolite.geochem.pyrochem.normalize_to` method can be used to
# normalise DataFrames to a given reference (e.g. for spiderplots):
#
fig, ax = plt.subplots(1)

for name, ref in list(all_reference_compositions().items())[::2]:
    if name != "Chondrite_PON":
        ref.set_units("ppm")
        df = ref.comp.pyrochem.REE.pyrochem.normalize_to(CI, units="ppm")
        df.pyroplot.REE(unity_line=True, ax=ax, label=name)

ax.set_ylabel("X/X$_{Chondrite}$")
ax.legend(frameon=False,
          facecolor=None,
          loc="upper left",
          bbox_to_anchor=(1.0, 1.0))
plt.show()
########################################################################################
# .. seealso::
#
#   Examples:
Exemplo n.º 2
0
"""
Reference Compositions
=======================

This page presents the range of compositions within the reference compositon database
accessible within :mod:`pyrolite`. It's currently a work in progress, but will soon
contain extended descriptions and notes for some of the compositions and associated
references.
"""
import matplotlib.pyplot as plt
from pyrolite.geochem.norm import all_reference_compositions, get_reference_composition
# sphinx_gallery_thumbnail_number = 11

refcomps = all_reference_compositions()
norm = "Chondrite_PON"  # a constant composition to normalise to
########################################################################################
# Chondrites
# -----------
#
fltr = lambda c: c.reservoir == "Chondrite"
compositions = [x for (name, x) in refcomps.items() if fltr(x)]

fig, ax = plt.subplots(1)
for composition in compositions:
    composition.set_units("ppm")
    df = composition.comp.pyrochem.normalize_to(norm, units="ppm")
    df.pyroplot.REE(unity_line=True, ax=ax, label=composition.name)
ax.legend()
plt.show()
########################################################################################
# Mantle
Exemplo n.º 3
0
 def test_default(self):
     refs = all_reference_compositions()
     self.assertIsInstance(refs, dict)
     self.assertIn('Chondrite_PON', refs)