项目作者: inkenbrandt

项目描述 :
From Peeters 2014 in Groundwater; ArcGIS Python Toolbox; Piper Diagram; Water Chemistry
高级语言: Python
项目地址: git://github.com/inkenbrandt/Peeters_Piper.git
创建时间: 2017-08-23T04:21:20Z
项目社区:https://github.com/inkenbrandt/Peeters_Piper

开源协议:

下载


THIS LIBRARY IS NOW OUT OF DATE. PLEASE USE WQChartPy AS IT IS BY THE ORIGINAL AUTHOR AND MUCH MORE ROBUST.

Peeters_Piper

This script plots a piper diagram of water chemisty.
It includes an ArcGIS Toolbox for use in ArcGIS Pro.

Reference

This script was taken from Peeters 2014 in Groundwater

  1. @article {GWAT:GWAT12118,
  2. author = {Peeters, Luk},
  3. title = {A Background Color Scheme for Piper Plots to Spatially Visualize Hydrochemical Patterns},
  4. journal = {Groundwater},
  5. volume = {52},
  6. number = {1},
  7. publisher = {Blackwell Publishing Ltd},
  8. issn = {1745-6584},
  9. url = {http://dx.doi.org/10.1111/gwat.12118},
  10. doi = {10.1111/gwat.12118},
  11. pages = {2--6},
  12. year = {2014},
  13. }

Please refer to the original publication for licensing guidelines.

Installation

  1. pip install https://github.com/inkenbrandt/Peeters_Piper/zipball/master

Example

  1. import pandas as pd
  2. import numpy as np
  3. import matplotlib.pyplot as plt
  4. from peeters_piper.peeter_piper import piper
  5. filename = "examples/GW20130314-0057-s02_additional_field.csv"
  6. df = pd.read_csv(filename)
  7. # Plot example data
  8. # Piper plot
  9. fig = plt.figure()
  10. markers = ["s", "o", "^", "v", "+", "x"]
  11. arrays = []
  12. for i, (label, group_df) in enumerate(df.groupby("additional-field")):
  13. arr = group_df.iloc[:, 2:10].values
  14. arrays.append(
  15. [
  16. arr,
  17. {
  18. "label": label,
  19. "marker": markers[i],
  20. "edgecolor": "k",
  21. "linewidth": 0.3,
  22. "facecolor": "none",
  23. },
  24. ]
  25. )
  26. rgb = piper(arrays, "title", use_color=True, fig=fig)
  27. plt.legend()
  28. fig.savefig(filename + "_piper_plot.png", dpi=120)

Example Piper Output