0% found this document useful (0 votes)
46 views20 pages

PiperStiff-EXPLAIN v10

The document describes the functionalities of the PiperStiff-QW-2019 Excel workbook, which is used for creating Piper plots and Stiff diagrams from water-quality data. It outlines the process of converting concentrations, computing charge balances, and generating visual representations of water quality data, including the ability to export Stiff diagrams to KMZ files for Google Earth. The workbook includes features for data entry, customization of plots, and diagnostic capabilities, with detailed instructions on revisions and updates made to the software over time.

Uploaded by

carmen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views20 pages

PiperStiff-EXPLAIN v10

The document describes the functionalities of the PiperStiff-QW-2019 Excel workbook, which is used for creating Piper plots and Stiff diagrams from water-quality data. It outlines the process of converting concentrations, computing charge balances, and generating visual representations of water quality data, including the ability to export Stiff diagrams to KMZ files for Google Earth. The workbook includes features for data entry, customization of plots, and diagnostic capabilities, with detailed instructions on revisions and updates made to the software over time.

Uploaded by

carmen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

PiperStiff–An Excel workbook for charting a Piper plot

and mapping Stiff diagrams

Piper and Stiff diagrams are plotted and mapped, respectively from water-quality
concentrations in milligrams per liter (mg/L). The program converts mg/L to
milliequivalents per liter (meq/L). Concentration of major ions are summed for
total dissolved solids (TDS) and charge balances are computed. Sites are
highlighted if charge balances exceed a user-specified threshold. Constituent
concentrations and TDS from a site can be selected and highlighted in the Piper
plot (Figure 1). A Stiff diagram is displayed for the selected site.

Figure 1.— Piper plot, Stiff diagram, and controls in PiperStiff-QW-2019.xlsm.


Stiff diagrams are written to a KMZ (Google Earth) file where groups of sites can
be viewed or hidden (Figure 2). Stiff icon changes to labeled Stiff diagram with site
identifier as mouse hovers over an icon. TDS and constituent concentrations in
mg/L are displayed as a table after selecting a site.

P a g e 1 | 20
Figure 2.— Stiff diagrams as presented in Google Earth.

Diagnostic Stiff diagrams also can be created in a new workbook, where each site
in a group is diagrammed in a single plot (Figure 3). A page is created for each
group of sites with an open Stiff diagram of individual ions for each site.
Milliequivalents of anions are plotted as negative values in Cartesian plots and are
inverted on log plots.

P a g e 2 | 20
Figure 3.—Diagnostic Stiff diagrams for groups of sites that are created in a new workbook.

PiperStiff-QW-2019.xlsm and explanatory PDF can be downloaded with the


following link. Site locations, names, and analyte concentrations should be
arranged in separate workbook and pasted special as values on the DATA page
(see Data Entry).
Macros were developed in Excel 2019 and should work in Excel 2013+. Labels
have failed when revised by macros in Excel 2010.

Suggested Citation
Halford, Keith, 2024, Piper and Stiff–A workbook for creating Piper plots and Stiff
diagrams, version 10, Halford Hydrology LLC web page, revised July 2024, at
https://halfordhydrology.com/piper-and-stiff/

Revisions
October 28, 2019—Revisions in version 2 include the following. Sites can be
labeled with numbers rather than just text. Specified minimum and maximum
values of milliequivalents per liter in Stiff chart are transferred to minimum and
maximum values in Stiff icons that are displayed in Google Earth.

P a g e 3 | 20
November 25, 2019—Revisions in version 3 include the following. Site names are
checked for uniqueness. Non-unique site names are made unique by appending
occurrence number to repeated site names. For example, sites MW-A, MW-A, and
MW-A will be changed to sites MW-A, MW-A2, and MW-A3.
January 19, 2020—Revisions in version 4 include the following. Macro for writing
KMZ was revised so CONTROL sheet with icon chart is activated and refreshed
prior to writing images to graphic files. Stiff images sometimes did not appear or
appeared as X’s prior to this bug fix.
April 9, 2020—Revisions in version 5 include the following. Macro for writing KMZ
was revised so sites can be identified with numerical values such as dates. Site
identifiers appear as decimal days from 1/1/1900 if a user insists on using dates
as a site name. Percentage calculations in columns AL:AQ on the hidden
CONTROL page were revised to treat empty cells as 0 for unspecified chemical
concentrations. Both revisions are less bug fixes than enabling less than ideal
usage of the workbook.
July 29, 2020—Revisions in version 6 include the following. CONTROL page is
left visible so KMZ macro momentarily can activate page prior to writing STIFF
images from chart in range BT1:BV2. Stiff images previously sometimes did not
appear or appeared as X’s prior to this bug fix. Manually activate the CONTROL
page and return to the PIPER page if this error occurs.
January 1, 2021—Revisions in version 7 include the following. Macro for writing
KMZ was revised so decimal delimiters in longitude and latitude are written with
periods (.) regardless of regional settings in Excel. Thanks to Casper Zoete for
identifying and fixing this bug. Functions for plotting Stiff diagrams on a log scale
of the X-axis and creating diagnostic Stiff diagrams in a new workbook were
added.
May 1, 2021—Revisions in version 8 include the following. Minor correction so
that empty columns do not cause diagnostic Stiff macro to fail. Added discussion
about entering data as values in a block rather than dragging cells all over the
data page.
May 4, 2021—Revisions in version 9 include the following. Macro for writing KMZ
was revised so decimal delimiters in icon scales and geochemical summaries are
written with periods (.) regardless of regional settings in Excel. Thanks to Eduardo
Díaz Jiménez for identifying and fixing this bug.
July 10, 2024—Revisions in version 10 include the following. List of ions was
expanded to include Boron (B³⁺), Manganese (Mn²⁺), Copper (Cu⁺), and Iron
(Fe²⁺). These ions were specified in cells B17:F20 on the CONTROL page, which
is normally hidden. Plottable ions were expanded from 10 to 14 on the DATA
page. Further expansion is possible, but not advised. Piper plot labels are
unwieldy with greater than 10 ions and likely to become inky masses with greater
than 14 ions. Revision at request of Sam North, New South Wales Department of
Primary Industries.

P a g e 4 | 20
PiperStiff-QW-2019.xlsm Workbook
The workbook consists of two visible pages, DATA and PIPER, and one hidden
page, CONTROL. The hidden CONTROL page contains code for translating
coordinates and users should not need to edit the page. The table for converting
mg/L to meq/L is the exception if a constituent exists other than Bicarbonate
(HCO₃⁻), Calcium (Ca²⁺), Carbonate (CO₃⁻), Chloride (Cl⁻), Fluoride (F⁻),
Magnesium (Mg²⁺), Potassium (K⁺), Sodium (Na⁺), Sulfate (SO₄²⁻), Boron (B³⁺),
Manganese (Mn²⁺), Copper (Cu⁺), and Iron (Fe²⁺).

DATA page
Longitude, latitude, data group, site name, and chemical concentrations are
specified for each site in columns A-R and from row 15 and down (Figure 4).
Longitude and latitude are optional, but KMZ file will not be written without a
longitude and latitude for all sites. Groups define series in Piper plot (Figure 1)
and Stiff icons of similar color in KMZ file (Figure 2). Columns of chemical
concentrations can be ordered to suit user’s data sets by changing headings in
rows 13 and 14 through pull-down menus. Rows of site data are highlighted where
charge balance exceeds a user-defined threshold, cell U12, which is 5 percent in
the example (Figure 4).

Figure 4.—DATA page in the PiperStiff-QW-2019 workbook where longitude, latitude, data
group, site name, and chemical concentrations are specified for each site.

Data Page

Clear existing data between columns


A and M and from row 15 to the last
entry.

Empty cells before adding your data.

P a g e 5 | 20
All data for a site is entered on a
single row before pasting into
workbook.
Paste your data to cell to A15 or C15
if longitude and latitude are not
included.

Change headings with the pull-down


menus in row 14 to match chemical
constituent in columns of user’s data.

Change headings with the pull-down


menus in row 13 to match sides of
ternary plots of cations and anions.

Bottom, side, and diamond are


defined relative to ternary plots.

P a g e 6 | 20
Criteria for excessive charge
imbalance is specified with a pull-
down menu in cell Q12.

P a g e 7 | 20
PIPER page—Piper plot
Piper plot and plotting controls are displayed on the PIPER page (Figure 5). A
unique list of groups is created and corresponding series in the Piper plot are
formatted with the refresh button (cell J2). Symbol colors are assigned by fill
colors in column J and are filled with colors in column K if colored. Groups are
displayed or hidden by toggling cells TRUE or FALSE in column K. Specific sites
are identified by pull-down menu in cell J1.

Figure 5.—User controls for Piper plot in the PiperStiff-QW-2019 workbook.

Piper Plot
Refresh button in cell J2.
– Creates a list of unique group
names in column J.
– Maps cell colors in columns J and K
to series in Piper plot.
– Sizes symbols as specified in
column L.

Changing all group entries on the


DATA page to same label will define

P a g e 8 | 20
a single big group. New list of 1 group after revising groups on DATA

Groups are limited to twelve or less.

Toggle visibility of series with


TRUE/FALSE pull-down menus in
column K.

Plot limited to two groups where


TRUE specified only in cells K5:K6.

Effect of cell colors in columns J and


K and size specification in column L
on series symbols in Piper plot.

Filled, smaller symbol after refreshing with

P a g e 9 | 20
revised show & size specifications.

Select TDS, charge balance, and


concentrations at a site with site
selector in cell J1.

Available sites in site selector limited


to sites in visible series.

P a g e 10 | 20
For example, wells AW27 and AW28
are the only sites in the Well AD-4
corridor and site selection is limited to
these two sites.

Button in cell K2 toggles labels on


and off .

Site selector also is cleared so that


TDS, charge balance, and table of
concentrations do not appear.

P a g e 11 | 20
Stiff diagrams and KMZ file
Stiff diagrams are created primarily for display in a KMZ file. Icon sizes are user
defined and Stiff diagrams are colored by cell colors in column J (Figure 6). X-axis
can be toggled from Cartesian to log scale to better display geochemistry of
brines.

Figure 6.—User controls for Stiff diagrams in the PiperStiff-QW-2019 workbook.

P a g e 12 | 20
Stiff diagrams and KMZ

Folder name specifies name of KMZ


file that is written in the directory that
contains the workbook.

Icon scales are multipliers that scale


placemark icons in Google Earth.
Normal defines unselected icon scale
and highlight defines icon scale as
mouse hovers and on selection.

Y-axis buffer creates a gap in the Stiff


diagram so that the Y-axis remains
visible.

Press Write KMZ to create icon


images, kml file, and zip output to a
KMZ file.
KMZ file will be opened automatically
if box in cell P20 is checked.

P a g e 13 | 20
Vertical order of cations and anions in
Stiff diagram are user defined through
pull-down menus.

Example alternative Stiff diagrams


where vertical order of cations and Stiff pattern changed by user-ordered ions.
anions differed in cells O17:P18.

P a g e 14 | 20
Default scaling of X-axis of Stiff
diagram rounds to maximum value of
milliequivalents for an ion, which is
reported in cell P15.

Maximum value of X-axis can be


defined manually in cell O15.
Labeled steps also can be specified
in cell O16.
Scales are revised by either double-
clicking the combo menu in cell O18
to changing the selection from
FRESH to BRINE.

X-axis scale can be changed to


logarithmic for sites with greater
range of TDS as occurs with brines.
Select BRINE in combo menu in cell
O18 to display logarithmic scale.
Minimum plottable value of
milliequivalents for an ion is specified
in cell O14 and is rounded to units of
10. For example,
• 0.12 rounds to 0.1
• 0.9 rounds to 0.1
• 1.2 rounds to 1
Maximum and major steps are in
powers of 10 for logarithmic scale.

P a g e 15 | 20
Diagnostic Stiff diagrams in new workbook
Diagnostic Stiff diagrams also can be created in a new workbook, where each site
in a group is diagrammed in a single plot (Figure 7). A page is created for each
group of sites with an open Stiff diagram of individual ions for each site.
Milliequivalents of anions are plotted as negative values in Cartesian plots and are
inverted on log plots.

Figure 7.—Diagnostic Stiff diagram in new workbook.

P a g e 16 | 20
Diagnostic Stiff diagrams

Press “Diagnostic Stiff” button


(cell P16) to create diagrams in new
workbook.

X-axis of Stiff diagrams in new


workbook will reflect settings in cells
O14:O16 and O18.

A page is created for each group in


the new workbook. The distributed
example has seven groups which
results in seven sheets with an open
Stiff diagram on each sheet.

P a g e 17 | 20
Odd items
The following explanations address items that users have misconstrued.
1. Unused ions can be eliminated.
2. Additional ions can be specified.

Eliminate unused ions

For example, Carbonate (CO₃⁻) is not


specified and an empty column J on
the DATA page does not need to be
retained.

Copy data in columns K13:N104.

Paste special as vales to cell J13.


Get paste special form with

mouse or
Keyboard shortcut is,
Alt-key, h, v, s

P a g e 18 | 20
Activate PIPER page.

Select old anion group


HCO₃⁻ + CO₃⁻ (cell p22).

Old option HCO₃⁻ + CO₃⁻ is no longer


available and has been replaced by
HCO₃⁻ in (cell p22).

Stiff diagram functions correctly after


HCO₃⁻ is specified in (cell p22).

P a g e 19 | 20
Add ions

Unhide CONTROL page

Right-click on a page tab and


select Unhide…

CONTROL is the only hidden page so


click OK on the Unhide form.

Add ion, charge, conversion,


descriptor, and atomic weight of new
ion in columns B:F in the first empty
row.

P a g e 20 | 20

You might also like