Skip to content

Commit

Permalink
Remove QAP diagram from CIPW example (wt% vs vol% conflict)
Browse files Browse the repository at this point in the history
  • Loading branch information
morganjwilliams committed Oct 29, 2024
1 parent a607594 commit 1c6e3bc
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions docs/source/gallery/examples/geochem/CIPW.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,27 +205,6 @@ def compare_NORMs(SINCLAS_outputs, NORM_outputs, name=""):
fig, ax = compare_NORMs(df.loc[~volcanic_filter, :], NORM.loc[~volcanic_filter])
plt.show()
########################################################################################
# These normative mineralogical components could be input into mineralogical
# classifiers, as mentioned above. For example, the IUGS QAP classifier:
#
from pyrolite.util.classification import QAP

clf = QAP() # build a QAP classifier

qap_data = NORM.loc[:, ["quartz", "orthoclase"]] #
qap_data["plagioclase"] = NORM.loc[:, ["albite", "anorthite"]].sum(axis=1)
# predict which lithological class each mineralogical composiiton belongs in
# we add a small value to zeros here to ensure points fit in polygons
predicted_classes = clf.predict(qap_data.replace(0, 10e-6).values)
predicted_classes.head()
########################################################################################
# We can use these predicted classes as a color index also, within the QAP diagram
# or elsewhere:
#
ax = clf.add_to_axes()
qap_data.pyroplot.scatter(ax=ax, c=predicted_classes, axlabels=False, cmap="tab20c")
plt.show()
########################################################################################
# We could also compare how these mineralogical distinctions map into chemical ones
# like the TAS diagram:
#
Expand Down

0 comments on commit 1c6e3bc

Please sign in to comment.