-
Notifications
You must be signed in to change notification settings - Fork 1
/
06_shiny-gui.Rmd
541 lines (307 loc) · 53 KB
/
06_shiny-gui.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
# GWSDAT Graphical User Interface (GUI) {#GWSDATGUI}
The GWSDAT user interface is a web-based graphical user interface (GUI) using the R Shiny framework (`https://shiny.rstudio.com/`) which the user can interact with in many ways. The following sections explain the interface in detail.
## Data Input via Graphical User Interface {#DataInputviaGUI}
If the user entry point to a GWSDAT analysis is via the Excel Add-in interface (Section \@ref(DataInputExcelAddin)) then the input data has already been specified and the GUI goes straight into *Analyse* mode and is presented as displayed in Figure \@ref(fig:GWSDATSpatialPlot). However, if the user entry point is via the online version or the R package (Sections \@ref(GWSDATOnline) and \@ref(GWSDATRPackage))) with no input data specified then a menu is displayed on the left hand side, see Figure \@ref(fig:GWSDATDataManager), initially engaged on the *Manage Data* option. The *Basic Example* and *Comprehensive Example* datasets are all already pre-loaded and are identical to the data sets included in the Excel Add-in interface, see Section \@ref(DataInputExcelAddinMenu).
```{r, fig.cap = "GWSDAT Data Manager.", label="GWSDATDataManager",out.width = '90%',echo = FALSE}
include_graphics("figures/data_manager.png", auto_pdf = FALSE)
```
The Data Manager options allows the user to input data sets in a variety of different formats:
* **Restore Examples**: This allows the two in-built examples to be restored at any point, should this be needed.
* **Load Data**: This allows the user to load a previously saved GWSDAT session, see Section \@ref(GWSDATSaveSession). Use the *Browse* button to select the '.rds' file, enter an appropriate name and press the *Add Data* button to add the data set to list of available data sets in the Data Manager.
* **Add New Data**: This displays a data editor which allows the user to enter a *Historical Monitoring Data* table and *Well Coordinate data* table in much the same way as data is entered into an Excel spreadsheet. Shapefiles (Section \@ref(GISShapeFiles)) can be selected via the *Browse* button. Enter an appropriate name for the data set and click the *Save* button to add the data set to list of available data sets in the Data Manager.
* **Import .csv Data**: This option allows the user to select, via *Browse* buttons, comma separated value (csv) formatted data for the *Historical Monitoring Data* and *Well Coordinate data* tables together with GIS Shapefiles. Example '.csv' formatted input data sets and GIS Shapefiles can be downloaded from `https://github.com/WayneGitShell/GWSDAT/tree/master/data`.
* **Import Excel File**: This options allows the user to input a GWSDAT Excel Add-in formatted input dataset, see Figure \@ref(fig:GWSDATExcelAddinmenu), together with GIS Shapefiles. Use the *Browse* button to select the Excel file. If multiple sheets are detected a pop-up menu will prompt the user to select the appropriate sheet. Example input files can be found at `https://github.com/WayneGitShell/GWSDAT/tree/master/inst/extdata`. Enter an appropriate name for the data set and click the *Import* button to add the data set to list of available data sets in the Data Manager.
Please note that data sets can also be specified when launching GWSDAT from the R Statistical Programming Language - see `https://github.com/WayneGitShell/GWSDAT` for details. The user is referred to Section \@ref(DataInput) for full details on the format of the input data.
**Note**: To select a data set for a GWSDAT analysis first select the *Analyse* option on the left hand menu located under the *Manage Data* option.
<!-- GWSDAT comes supplied with examples of groundwater monitoring data and these can be used to experiment with the tools for analysis and visualisation. If you would like to do this you can move immediately to Section~X of this manual. However, the aim of GWSDAT is of course to provide means of analysing user-supplied data and various options are supplied to allow this. These options are all available from the *Manage Data* page which is the point of entry when GWSDAT is launched but can also be accessed at any time from the *Manage Data* item on the menu bar on the left hand side of the window. -->
<!-- GWSDAT is designed to produce informative visualisations of groundwater monitoring over space and time. To illustrate this, we will use the *Basic Example*. If you are still in the detailed pages of the *Manage Data* section, click on the `back-arrow' in the top left hand corner to return to the main \textit{manage Data} page and then click on *Analyse* on the left had sidebar. You will then be asked to specify which dataset you would like to analyse. In addition to the standard examples, any other datasets you have created will be listed here too. For the moment, click on the *Select* button for the *Basic Example'*. You should now see a screen similar to the image below. -->
<!-- The tabs at the top of this page give access to several different forms of analysis. These are described in detail below. -->
<!-- The functionality to input data directly via the GUI is a feature first introduced in GWSDAT version 3.0. -->
<!-- A *Basic Example* and a *Comprehensive Example* are supplied but the buttons at the top of the page allow other data to be entered, in different forms. -->
<!-- ```{r echo = FALSE} -->
<!-- tbl <- matrix(c("Restore Examples", "This allows the two in-built examples to be restored at any point, should this be needed.", -->
<!-- "Load Data", "Use the *Browse* button to loaded from a previous GWSDAT session.", -->
<!-- "Add New Data", "This allows data to be entered manually into a spreadsheet (and saved for later use).", -->
<!-- "Import .csv Data", "Use the *Browse* buttons to load separate 'Contaminant Data' and 'Well Coordinates' files, each in `.csv` form. One or more shapefiles may also be loaded.", -->
<!-- "Import Excel File", "Use the *Browse* button to load an Excel spreadsheet containing both 'Contaminant Data' and 'Well Coordinates'. One or more shapefiles may also be loaded." -->
<!-- ), ncol = 2, byrow = TRUE) -->
<!-- kable(tbl) %>% -->
<!-- column_spec(2, width = "30em") -->
<!-- ``` -->
<!-- # ```{r echo = FALSE} -->
<!-- # tbl <- matrix(c("Import Excel File", "The file to be loaded should contain two spreadsheets labelled `Contaminant Data` and `Well Coordinates` and have the structure described above. An example spreadsheet is available at *web address at gwsdat.net*.", -->
<!-- # "Import .csv Data", "The data can be exported from *Excel() into `.csv` format. In this case there should be separate `.csv` files for the *Contaminant Data* and *Well Coordinates*. Click on the *Browse* button to select these files. For convenience, GWSDAT gives options for the *Column separator* and the *Quote for Character Strings* at the foot of this page. Click on the *Import|* button to read the data.", -->
<!-- # "Add New Data", "This creates blank spreadsheets with the required structure. Entries can by typed in directly or copied and pasted from another source. There is an *+Add Row* button and right clicking gives further options for adding and removing rows.", -->
<!-- # "Load Data", "This allows data which has previously been saved from GWSDAT to be loaded again." -->
<!-- # ), ncol = 2, byrow = TRUE) -->
<!-- # kable(tbl) %>% -->
<!-- # column_spec(2, width = "30em") -->
<!-- # ``` -->
<!-- # -->
<!-- \begin{tabular}{rm{0.7\textwidth}} -->
<!-- \cline{2-2} -->
<!-- \colorbox{NavyBlue}{\color{white} \textsf{Restore Examples}} & -->
<!-- This allows the two in-built examples to be restored at any point, should this be needed. \\ -->
<!-- \cline{2-2} -->
<!-- \colorbox{NavyBlue}{\color{white} \textsf{Load Data}} & -->
<!-- Use the \textit{Browse} button to loaded from a previous GWSDAT session. \\ -->
<!-- \cline{2-2} -->
<!-- \colorbox{NavyBlue}{\color{white} \textsf{Add New Data}} & -->
<!-- This allows data to be entered manually into a spreadsheet (and saved for later use). \\ -->
<!-- \cline{2-2} -->
<!-- \colorbox{NavyBlue}{\color{white} \textsf{Import .csv Data}} & -->
<!-- Use the \textit{Browse} buttons to load separate 'Contaminant Data' and 'Well Coordinates' files, each in \texttt{.csv} form. One or more shapefiles may also be loaded. \\ -->
<!-- \cline{2-2} -->
<!-- \colorbox{NavyBlue}{\color{white} \textsf{Import Excel File}} & -->
<!-- Use the \textit{Browse} button to load an Excel spreadsheet containing both 'Contaminant Data' and 'Well Coordinates. One or more shapefiles may also be loaded. \\ -->
<!-- \cline{2-2} -->
<!-- \end{tabular} -->
<!-- The details of data entry are described below but it is helpful first to describe the format of the data which is required. The essential information is in are two spreadsheets - one which contains the contaminant data, and a second one which gives the co-ordinates of the wells. There is also an option to use shape files to superimpose map information on spatial plots. -->
<!-- An example of the first spreadsheet is shown for the *Basic Example* in the screenshot below. The full spreadsheet can be viewed by clicking the *Edit* button for the *Basic Example* in the *Manage Data* page of GWSDAT. (When you wish to return to the *Manage Data* page, click the `back-arrow' button in the top left hand corner of the *Edit Data* page.) The columns of the spreadsheet are explained in detail below. -->
<!-- \fbox{Wayne advises against the use of the term 'contaminant' but this is the terminology used in the software.} -->
<!-- \colorbox{NavyBlue}{\color{white} \textsf{Import Excel File}} The file to be loaded should contain two spreadsheets labelled `Contaminant Data' and `Well Coordinates' and have the structure described above. An example spreadsheet is available at \fbox{web address at gwsdat.net}. -->
<!-- \ -->
<!-- \noindent -->
<!-- \colorbox{NavyBlue}{\color{white} \textsf{Import .csv Data}} The data can be exported from Excel into \texttt{.csv} format. In this case there should be separate \texttt{.csv} files for the Contaminant Data and Well Coordinates. Click on the `Browse' buttons to select these files. For convenience, GWSDAT gives options for the `Column separator' and the `Quote for Character Strings' at the foot of this page. Click on the `Import' button to lead the data. -->
<!-- \ -->
<!-- \noindent -->
<!-- \colorbox{NavyBlue}{\color{white} \textsf{Add New Data}} This creates blank spreadsheets with the required structure. Entries can by typed in directly or copied and pasted from another source. There is an \textit{+Add Row} button and right clicking gives further options for adding and removing rows. -->
<!-- \ -->
<!-- \noindent -->
<!-- \colorbox{NavyBlue}{\color{white} \textsf{Load Data}} \fbox{Is this option available - I can't see a Save option?} -->
## Spatial plot {#SectionSpatialPlot}
The GWSDAT spatial plot (see Figure \@ref(fig:GWSDATSpatialPlot)) is for the analysis of spatial trends in solute concentrations, groundwater flow and, if present, NAPL thickness. It displays the locations of the monitoring wells (black solid dots) together with the well names and actual measured solute concentration values (detect data is displayed in a red font; non-detect in a black font). The date interval for the displayed data is indicated above the spatial plot. If a GIS shapefile has been supplied then the major site features (roads, tanks, etc) are overlaid on the spatial plot as light blue lines.
A key feature of GWSDAT is the ability to produce estimates of contaminant concentrations over space and time simultaneously. This gives a more effective and efficient method of analysis than the examination of concentration maps at isolated time points, or of time trends at isolated locations. The simultaneous use of information over space and time allows estimates at particular locations and times to 'borrow strength' from neighbouring data, see @Mclean2019. Use the slider at the foot of the page to explore how the estimates of concentration changes through time. Note that the slider box at the foot of the page can be moved to any convenient position by clicking and dragging with the mouse. The 'Play' symbol (forward-arrow) in the bottom right hand corner of the slider activates a 'movie', which can be paused by pressing the button again. Select a file format (one of `png`, `jpg`, `pdf`, `ps`, `pptx` ,`tif`) from *Image format* and click the *Save plot* button to export individual spatial image plots. The *Generate PPT Animation* function exports the full series of spatial plots directly to Microsoft PowerPoint.
```{r, fig.cap = "GWSDAT Spatial Plot", label="GWSDATSpatialPlot",out.width = '100%', echo = FALSE}
include_graphics("figures/analysis-1.png")
```
The *Settings* tab located to the left hand side of the spatial plot gives control over many aspects of the display:
* **Aggregate by**: provides a drop-down menu which allows the temporal plotting resolution to be altered (Day, Month, Quarter, Year). In the example in Figure \@ref(fig:GWSDATSpatialPlot), a monthly model output interval has been selected and the displayed actual solute concentration values were sampled between the 2nd Oct 2009 and the 1st Nov 2009. This functionality is identical to the 'Model Output Interval' detailed in Section \@ref(ExcelAddinMenuDataProcessingOptions).
* **Substance**: Drop-down listbox to select the different solutes to be inspected.
* **Solute Conc. Unit**: allows the units to be changed between one of 'ng/l', 'ug/l' or 'mg/l'.
* **Plot Type**: Drop-down listbox with the following choices:
+ **Conc-Terrain**: This option overlays the predictions of the spatiotemporal solute concentration smoother for a particular model output interval using a 'terrain' colour scheme - see example in Figure \@ref(fig:GWSDATSpatialPlot). Please note that the output of the spatiotemporal trend smoother is always given for the latest date in the displayed output interval.
The dark green colours indicate low solute concentration and the colours are gradated through yellow and brown
to almost white, to illustrate increasing estimated solute concentrations.The concentration values can be read off from the key on the right hand side of the plot.
As the user iterates through time steps, it may be noticed that the area covered by the spatiotemporal solute concentration smoother changes. This is due to the fact that spatiotemporal predictions are only generated between interpolated data and are not extrapolated to regions where no data exists, which could potentially lead to erroneous results. For each time step, the area of the contour is calculated only from the collection of wells for which the monitoring period spans the current model output interval. GWSDAT generates predictions in the convex hull region dictated by these wells. The convex hull
(see `http://en.wikipedia.org/wiki/Convex_hull`) may be visualised as the expected boundary if an elastic band was placed around the locations of these wells.
+ **Conc-Topo**: This function is identical to Conc-Terrain but uses a topograghic colour scheme which gradates increasing solute concentrations through blue, green, yellow and beige.
+ **Conc-GreyScale**: This function is identical to Conc-Terrain but uses a grey scale colour scheme which gradates increasing solute concentrations through light grey to black. This is useful for printing on black and white printers!
+ **Conc-Terrain-Circles**: This selection overlays (terrain) colour coded circles located at the wells which have been
monitored within the current model output interval. The size of the circles scales with the log of the observed solute concentration values and the solute concentration range can be read off from the colour key to the right of the plot.
+ **Conc-Topo-Circles**:This selection is identical to Conc-Terrain-Circles but uses a topographic colour scheme.
+ **Conc-GreyScale-Circles**: This selection is identical to Conc-Terrain-Circles but uses a grey scale colour scheme.
+ **NAPL-Circles**: This selection displays the observed NAPL thicknesses within the current model output interval as
size scaled and colour coded circles. NAPL thickness ranges are read off from the colour key on the right hand side of the plot.
Colours are gradated from dark red through yellow to almost pure white to illustrate increasing NAPL thickness.
The location of wells which have recorded NAPL in any part of their monitoring history are coloured with red solid dots instead of the usual black solid dots.
\begin{center}
\setlength{\fboxrule}{1.5pt}
\fcolorbox{blue}{gray!10}{
\parbox{450pt}{{%\fontfamily{phv}\selectfont
\textbf{Hint:} In the presence of poor well location network design or limited data then it is recommended the user select
either the `Terrain-Circles' or `Topo-Circles' plot type.
%This alternative, displays colour coded circles
%located at the wells which have been monitored within the current time slice. The size of the circles scales
%with the log of the observed solute concentration values.
}
}
}
\end{center}
\newpage
* **Plot Options**:
+ **Show Well Labels**: This controls whether to display well names/labels immediately below the well locations.
+ **Scale colours to Data**: By default the colour key of solute concentrations is subdivided as shown in Figure \@ref(fig:GWSDATSpatialPlot). By using the same subdivisions the spatiotemporal solute concentration smoother plots can be directly compared between different model output intervals. This control will produce a new colour key whose subdivisions span the concentration predictions for the current model output interval only.
+ **Show Conc. Values**: This controls whether to display actual sampled concentration values immediately above the well locations. If the data is identified as a NAPL measurement the value will be displayed as 'NAPL' in a red font.
+ **Show GW Contour**: To add contour lines of groundwater level data. This superposes isobars of smoothed groundwater elevation data on top of the solute concentration plot. This is achieved through a 2D extension of the local linear regression method described in Appendix \@ref(smregressCalc).
+ **Overlay Shapefiles**: This controls whether to overlay a site plan.
+ **Plume Diagnostics**: This controls whether to calculate and display plume diagnostic quantities from the predictions of the spatiotemporal solute concentration smoother (please refer to insert box below and example in Figure \@ref(fig:GWSDATSpatialPlot2)). The delineated plume is displayed with a solid red contour line which also includes a label displaying the plume boundary threshold value. If the plume boundary lies completely within the area covered by the spatiotemporal solute concentration smoother (i.e. forms a closed loop) then the plume centre of mass is displayed with a red cross and the plume mass and area printed at the bottom left margin of the spatial plot.
Note: in order for the correct plume diagnostics units to be used the *CoordUnits* field in the *Well Coordinates* table must be specified, see Section \@ref(WellCoordinatesTable). More details about plume diagnostics can be found in Section \@ref(GWSDATPlumeDiagnostics) and Appendix \@ref(AppendixPlumeDiagnostics).
* **Groundwater Flows**: The blue arrows in Figure \ref{fig:GWSDATSpatialPlot2} display the estimated direction and (relative) hydraulic gradient of groundwater flow at monitoring points across the site. This is calculated from the combination of well coordinates and recorded groundwater elevations for this particular model output interval (see Appendix \@ref(GWCalc) for more details). This radiogroup allows the user to choose either 'not to display groundwater arrows' or 'direction only arrows' or 'both direction and relative strength arrows' (default).
\begin{center}
\setlength{\fboxrule}{1.5pt}
\fcolorbox{blue}{gray!10}{
\parbox{450pt}{{%\fontfamily{phv}\selectfont
Note: The spatiotemporal solute concentration smoother is a function which simultaneously estimates both the spatial and
time series trend in site solute concentrations. By smoothing the data in both space and time
it provides a clearer interpretation of site solute concentration dynamics than would otherwise be gleaned
from the raw data.
\uline{However, it is important to note that it is a smoother function and as such, the predictions
do not necessarily lie on the observed data points}.
In the event that a sampled concentration value is significantly larger
than the predictions of the spatiotemporal smoother, the well label is coloured red and surrounded by braces,
e.g. \textcolor{red}{`$<$MW-1$>$'}. This serves as a very useful method for outlier detection.
In addition, the analysis may be skewed if data are input from monitoring wells with disparate construction or
screened in different aquifer systems.
Another important point to consider is that the quality of the spatiotemporal smoother is directly influenced
by quality of the underlying data. In general, data originating from sites with many evenly spatially
distributed wells with a long time history leads to better quality smoother predictions.
The converse of a small number of wells or poor well location network design
(e.g. wells located in almost a straight line), or short monitoring history,
will lead to less reliable smoother predictions, particularly at the edges.
%In summary, the `spatiotemporal solute concentration smoother' plot is provided to
%help the user visualise the distribution of solutes and as an aid to risk-based decision-making.
%However, for the reasons stated above, the predictions should be interpreted with care and
%a more detailed evaluation may be necessary to understand observed trends and outliers.
For the reasons stated above, the predictions should be interpreted with care and a more detailed evaluation may be necessary to understand observed trends and outliers. Further methods for assessing the goodness of fit of the spatiotemporal smoother can be found in Section \ref{SpatiotemporalPredictions}. For more details on the spatiotemporal smoothing algorithm, please see Appendix \ref{SSCS}.
}
}
}
\end{center}
```{r, fig.cap = "GWSDAT Spatial plot with plume diagnostics.", label="GWSDATSpatialPlot2",out.width = '75%', echo = FALSE}
include_graphics("figures/spatial_plot2.png")
```
## Plume Diagnostics {#GWSDATPlumeDiagnostics}
As described in the previous section, clicking the *Plume Diagnostic* checkbox automatically delineates a plume concentration boundary and displays the plume diagnostic quantities underneath the spatial plot, see example in Figure \@ref(fig:GWSDATSpatialPlot2). The *Plume Mass, Area \& Conc.* and *Estimate Boundary* tabs located to the right of the *Spatial Image* tab, see Figure \@ref(fig:GWSDATSpatialPlot), provide options for further evaluating plume stability.
```{r, fig.cap = "Time series of estimated Plume Mass, Area and Average concentration.", label="GWSDATPlumeStats",out.width = '75%', echo = FALSE,fig.pos="!h"}
include_graphics("figures/plume_stats.png")
```
* **Plume Mass, Area \& Conc**:
This function attempts to calculate, for each time slice, the plume metrics of mass, area and average concentration as described in Appendix \@ref(AppendixPlumeDiagnostics). A time series plot of these quantities, for each time slice where a closed delineated plume can be formed, is displayed, see example in Figure \ref{fig:GWSDATPlumeStats}. The user can also select to export the complete time series of plume diagnostics data to a Microsoft Excel csv file. The *Plume Threshold* value (in ug/l), for the currently selected solute, can be adjusted from the numeric input control located at the bottom of this display. The individual *Plume Threshold* values for the complete set of solutes can be set in the *Options* menu, see Section \@ref(GWSDATEditOptions).
Note: Plume metrics are calculated based on the units of length entered in the CoordUnits field in the Well Coordinates table (Section \ref{WellCoordinatesTable}). If no units are entered then relative changes in plume parameters are plotted in dimensionless units. Note also that plume mass is calculated per unit of plume depth (e.g. kg/m in Figure \ref{fig:GWSDATPlumeStats}). To estimate total plume mass the user must multiply this value by the estimated plume thickness (using same units as those entered in the CoordUnits field). By default the effective (interconnected) porosity of the subsurface is assumed to be 25%. See Section \@ref(GWSDATEditOptions) for details on how to modify this value. Additional information on how plume parameters are calculated can be found in Appendix \ref{AppendixPlumeDiagnostics}.
```{r, fig.cap = "Example Estimate Plume Boundary plot. The grey shaded area defines a region where plume metrics (mass, area, average concentration) can be estimated", label="EstimatePlumeBoundary",out.width = '75%', echo = FALSE,fig.pos="!h"}
include_graphics("figures/estimate_plume_boundary.png")
```
* **Estimate (Plume) Boundary**:
This function provides a graphic to assist the user in selecting an appropriate solute concentration value that will yield a closed plume, which is an essential requirement for the estimation of plume metrics (i.e. mass, area and average concentration). The plume boundary contour is determined to be closed when it does not extend outside the area bounded by monitoring data. The function works by iterating through each time step of the spatiotemporal model and plotting minimum and maximum solute concentrations at the edge of the area bounded by the monitoring data (see Figure \ref{fig:EstimatePlumeBoundary}). The grey shaded area between the minimum and maximum lines defines the region where plume metrics can be calculated. The user-defined value of the plume threshold concentration value is displayed as a horizontal red dashed line. The user should select a solute concentration value that is just above the minimum line, for the time period within which calculation of plume parameter is required. It is clear from Figure \ref{fig:EstimatePlumeBoundary} that a value of 10 ug/l works well in this example. The selection of a higher solute concentration value within the grey area, while still producing a closed plume, would exclude part of the plume from the plume mass/ area analysis. The selection of a lower solute concentration value (e.g. 2 ug/l) would, in this example, greatly reduce the time period over which the plume was closed.
<!-- \textbf{Edit Plume Thresholds:} -->
<!-- This opens a data editor where the user can manually change the plume boundary -->
<!-- threshold concentration limits (in ug/l) for the different solutes. There is no need to -->
<!-- save the changes, simply close down the data editor to automatically update the values. -->
<!-- \textbf{Set Ground Porosity:} -->
<!-- This opens a data editor panel where the user can enter the effective (interconnected) porosity of the subsurface (default=0.25). This value is used in the calculation of plume mass (see Appendix \ref{AppendixPlumeDiagnostics}). -->
<!-- Note: in order for the correct plume diagnostics units to be used the *CoordUnits* field in the *Well Coordinates* table must be specified, see Section \ref{WellCoordinatesTable}. -->
<!-- The user can select to automatically delineate a plume based on a user-defined concentration threshold. This %functionality, which can also be accessed via the Plume Diagnostics menu (Section \ref{SpatialPlotOptions}), allows the user to evaluate plume stability based on changes in the plume area, centre of mass and plume mass through time. The plume diagnostics %analysis is performed on whichever solute is selected in the solute listbox (see Section \ref{CCGFP} and Figure \ref{fig:VisOptions}). -->
<!-- In GWSDAT v2.2 the user can select to automatically delineate a plume based on a user-defined concentration threshold. This functionality, which is accessed via the Plume Diagnostics menu (top right in Figure \ref{fig:VisOptions}), allows the user to evaluate plume stability based on changes in the plume area, centre of mass and plume mass through time. The plume diagnostics analysis is performed on whichever solute is selected in the solute listbox (see Section \ref{CCGFP} and Figure \ref{fig:GWSDAT GUI}). -->
<!-- **Note**: Before using the plume diagnostics functions the user must first ensure that the vertical extent of the plume is adequately delineated by the site monitoring -->
<!-- %Plume diagnostics can only be calculated if the delineated plume is closed (i.e. forms a loop) and no part protrudes over the boundary of the spatiotemporal solute concentration smoother. -->
<!-- %This function provides a graphic to assist the user in selecting the most appropriate plume concentration threshold value which will maximise the coverage of plume diagnostics for the complete site history. -->
<!-- %The function works by iterating through each time step and plotting the minimum and maximum solute concentration value from the spatiotemporal solute concentration smoother (see Figure %\ref{fig:EstimatePlumeBoundary}). -->
<!-- %Obviously, if the boundary threshold value is above the maximum or below the minimum then it will not be possible to calculate plume diagnostics. -->
<!-- %Thus, the area between the minimum and maximum defines a feasible region (grey shaded area in Figure \ref{fig:EstimatePlumeBoundary}) where plume diagnostics can (potentially) be calculated. -->
<!-- %The current value of plume threshold concentration value is displayed as a horizontal red dashed line. The user should select the lowest possible value whilst still remaining in the grey region such as to maximise the %coverage of plume analytics through time. -->
<!-- %It is clear from Figure \ref{fig:EstimatePlumeBoundary} that a value of 5ug/l works well in this example. -->
<!-- % Figure \ref{fig:EstimatePlumeBoundary} is an example of such a plot. -->
<!-- %If the plume concentration threshold value is set too high or low then it will not be possible to calculate plume diagnostics. -->
<!-- %Hence, it is necessary to tune the plume concentration threshold value for the problem in hand. -->
<!-- %This selection produces a series of spatial plots (similar to a Contour Animation, see Section \ref{GWAnis}) with plume diagnostics from the first to the last model output interval. -->
<!-- %In addition, a time series plot of the plume mass, plume area and average plume concentration (see Figure \ref{fig:PlumeStats}) is generated. -->
<!-- %If desired the complete time series of plume diagnostics can be outputted to a Microsoft Excel csv file. -->
<!-- %\textbf{Note: the plume mass is calculated on a mass per unit aquifer depth basis (e.g. kg/m in Figure \ref{fig:PlumeStats}). To calculate the total plume mass the user must multiply this value by the aquifer depth.} -->
<!-- This function produces a series of spatial plots incorporating plume diagnostics data from the first to the last spatiotemporal model output interval. In addition, a time series plot of plume mass, plume area and average plume concentration (see Figure \ref{fig:PlumeStats}) is generated. The user can also select to export the complete time series of plume diagnostics data to a Microsoft Excel csv file. -->
<!-- #\item \textbf{Plume Animation -$>$ PPT:} -->
<!-- #This selection exports a series of spatial plots incorporating the plume diagnostics data directly to Microsoft PowerPoint. -->
<!-- Fo produces a series of spatial plots incorporating plume diagnostics data from the first to the last spatiotemporal model output interval. In addition, a time series plot of plume mass, plume area and average plume concentration (see Figure \ref{fig:GWSDATPlumeStats}) is generated. The user can also select to export the complete time series of plume diagnostics data to a Microsoft Excel csv file. -->
\begin{center}
\setlength{\fboxrule}{1.5pt}
\fcolorbox{blue}{gray!10}{
\parbox{450pt}{{%\fontfamily{phv}\selectfont
Note: The plume diagnostics functions provide insight into relative changes in plume mass, area and average concentration for a given site and monitoring well network. Plume mass estimates are provided in units of kg/m or kg/ft to reflect this uncertainty. Absolute values of plume mass cannot be calculated because the model does not define the vertical concentration distribution inside the plume. The assumptions made in plume mass estimation are that:
\begin{itemize}
\item Vertical variation in plume concentration is averaged across monitoring well screen intervals.
\item The monitoring well network samples the full depth and extent of the plume and is also representative of concentration variation across the site.
\end{itemize}
The assumptions are similar to those presented in the paper by Ricker (2008).
}
}
}
\end{center}
## Well Redundancy Analysis {#WellRedundancy}
```{r, fig.cap = "Well redundancy analysis for Spatial plot using the basic example data set having omitted monitoring well MW-04 and using Xylene as the current selection of solute.", label="GWSDATWellRedundancyAnalysis",out.width = '80%', echo = FALSE,fig.pos = "!h"}
include_graphics("figures/well_redundancy1.png")
```
The *Well Redundancy Analysis* tab, located next to the *Settings* tab (top left of Figure \@ref(fig:GWSDATSpatialPlot)), is a feature introduced in GWSDAT version 3.1. It allows the user to very conveniently drop a well or a combination of wells from the analysis and investigate the resultant impact. The primary intent of this tool is to understand which wells may have the most influence and also provide supporting evidence that the conclusions of the analysis would not be significantly different with the omission of some certain wells. Figure \@ref(fig:GWSDATWellRedundancyAnalysis) displays an example Well Redundancy Analysis for the Spatial plot. The listbox *Select wells to be omitted from analysis* allows the user to select any combination of wells from the complete list of wells.
<!-- **Note**: Once the candidate set of wells have been selected the user must manually update the models by clicking the *Update Model* button. The calculation of the underlying reduced well data set models can be computationally expensive. Hence the manual decision to update the model when desired rather than automatically updating the model once any change has been detected in the listbox. -->
\begin{center}
\setlength{\fboxrule}{1.5pt}
\fcolorbox{blue}{gray!10}{
\parbox{450pt}{{%\fontfamily{phv}\selectfont
Note: Once the candidate set of wells have been selected the user must manually update the models by clicking the \emph{Update Model} button. This step applies the same spatiotemporal model to each solute as described in Section \ref{SSCS} but with a reduced input data set. The calculation of the underlying reduced well data set models can be computationally expensive. Hence the manual decision to update the model when desired, rather than automatically updating the model once any change has been detected in the listbox.
}
}
}
\end{center}
The *Use reduced set of wells?* checkbox enables the user to toggle between the full model and the model using the reduced well data set. The updated predictions of spatiotemporal concentration smoother are plotted and the omitted wells 'greyed' out. The groundwater elevation and flow strength and direction estimates are also updated to the reflect the omission of selected wells. A title is added to the top left of the Spatial plot to notify users that *Well Redundancy Analysis* has been activated.
```{r, fig.cap = "Well redundancy analysis on estimated plume metrics using the basic example data set having omitted monitoring well MW-04 and using Xylene as the current selection of solute. Note: full well data set is color-coded black; reduced well data set is color-coded green.", label="GWSDATWellRedundancyAnalysis2",out.width = '80%', echo = FALSE,fig.pos = "!h"}
include_graphics("figures/well_redundancy2.png")
```
The plume diagnostic metric quantities as described in Section \@ref(GWSDATPlumeDiagnostics) are calculated for both the full (coloured black) and reduced (coloured green) well data set spatiotemporal solute concentration smoother models. Both sets of estimates for plume mass, area and average concentration are overlaid on the same plot, as shown in Figure \@ref(fig:GWSDATWellRedundancyAnalysis2). This allows for a direct side by side comparison. The *Estimate (Plume) Boundary* functionality is also updated to reflect the reduced well data set and a title added to remind the user of this fact.
## Time Series {#SectionWellTrendPlot}
The Time Series plot enables the user to investigate time series historical trends of solute concentrations in individual wells. Figure \@ref(fig:GWSDATTimeSeriesPlot) displays an example GWSDAT Time Series plot of' 'Benzene' in well 'MW-01' using an illustrative example data set. The actual sampled concentration values are plotted against sampling date and are represented as black solid points. Orange points represent the substituted non-detect values according to the selection chosen in Section \@ref(ExcelAddinMenuDataProcessingOptions). Red points represent the NAPL substituted solute concentration values.
To switch between different solutes and monitoring wells, simply select from the *Substance* and *Select Monitoring Well* listboxes. The *Solute Conc. Unit* radiogroup allows the units to be changed between one of 'ng/l', 'ug/l' or 'mg/l'. The *Display Threshold* checkbox allows the user to overlay threshold value used to colour code the Trend and Threshold Indicator plot - see Section \@ref(TRendTHreshMat).
```{r, fig.cap = "GWSDAT Time Series Plot", label="GWSDATTimeSeriesPlot",out.width = '80%', echo = FALSE,fig.pos="!h"}
include_graphics("figures/time-series-plot.png")
```
The *Time Series Plot Options* checkbox control includes:
* **Conc. Trend Smoother**:
This displays the estimated time series trend in solute concentration using a nonparametric smoother (see Figure \@ref(fig:GWSDATTimeSeriesPlot). The solid blue line displays the estimate of the mean trend level at a particular point in time. The upper and lower dashed blue lines depict a 95\% confidence interval around this estimate. This is interpreted as *'one is 95\% confident that the actual mean trend level lies within this region'*. The smaller the 95\% confidence interval, the more confidence one has in the estimated time series trend. Areas of the trend smoother fit in which the 95\% confidence intervals are very large (i.e. very low confidence in the trend smoother fit) are coloured grey instead of blue and are disregarded from the 'Trend' and 'Threshold - Statistical' matrix plot calculations, see Section \@ref(TRendTHreshMat).
The advantage of this nonparametric method is that the trend estimate is not constrained to be monotonic, i.e. the trend can change direction. More details of this nonparametric smoothing algorithm are given in Appendix \@ref(smregressCalc)
* **Conc. Linear Trend**:
This displays a traditional linear time series trend estimate (green solid line) together with 95\% confidence intervals (green dashed lines) to the log of historical solute concentrations values. This is equivalent to fitting an exponential decay/growth model on a linear scale. The statistical significance of this trend is assessed by means of the well established Mann-Kendall trend test @MannKendall. The Mann-Kendall p-value and the estimated solute concentration half-life is displayed immediately below the main title of the *Time Series* plot. Users should be aware that individual well half-life values should not be used to estimate the plume half-life.
\definecolor{MyGray}{rgb}{0.96,0.97,0.98}
\begin{center}
\setlength{\fboxrule}{1.5pt}
\fcolorbox{blue}{MyGray}{
\parbox{440pt}{{%\fontfamily{phv}\selectfont
If the Mann-Kendall p-value is below 0.05, then the estimated trend is deemed statistically significantly different from 0, i.e. there
is indeed trend present in the data. A p-value above 0.05 should be interpreted as there is no evidence to suggest
that trend is present.
}
}
}
\end{center}
* **Show Legend**: This controls whether to display a legend in the top right hand side of the plot
giving a key of the plotting symbols.
* **Scale to Conc. Data**: By default the *Time Series* plot x-axis is scaled such that it spans the sampling dates of all data. The y-axis is scaled to span the current data concentrations and the user-specified trend threshold limit, see Section \ref{TRendTHreshMat}. By checking this control the x and y axes are scaled to the span of the current combination of well and solute concentration data only.
* **Log Scale**: Controls whether to use a logarithmic or linear scale for the y-axis, i.e. solute concentration values.
* **Overlay GW levels**: Allows the user to overlay the corresponding groundwater level measurements on the time series plot. The scale is read from the right hand axis. This function is useful for assessing correlations between groundwater levels and solute concentrations.
* **Overlay NAPL Thickness**: Allows the user to overlay the corresponding NAPL thickness level measurements on the time series plot. The scale is read from the right hand axis. This function is useful for assessing correlations between NAPL thickness and groundwater levels.
<!-- Wayne: Check for 'Well trend plot' and replace with *Time Series* plot. -->
## Trends \& Thresholds {#TRendTHreshMat}
```{r, fig.cap = "GWSDAT Trends and Thresholds plot.", label="GWSDATTrendsThresholdsPlot",out.width = '75%', echo = FALSE}
include_graphics("figures/trends_thresholds.png")
```
The *Trends and Thresholds* plot (a.k.a. Traffic Light Plot) is a summary of the strength and direction of the current trend or exceedance relative to a user defined threshold in solute concentrations at a particular model output interval, see Figure \@ref(fig:GWSDATTrendsThresholdsPlot). It uses the fitted nonparametric time series trend smoother described in Section \@ref(SectionWellTrendPlot). The rows correspond to each well and the columns correspond to the different solutes. The options are as follows:
* **Display Table**: This drop-down listbox allows the user to select from the following options:
+ **Trend**: This reports the concentration trend for each solute in every well within the selected model output interval. The *Trends Thresholds* plot looks at the instantaneous gradient of the trend smoother (solid blue line) where it crosses the end of the current model output interval in the *Time Series* Plot, see Figure \@ref(fig:GWSDATTimeSeriesPlot). The cells of the *Trends Thresholds* plot are coloured to indicate the strength and direction of the current trend. White cells indicate a generally flat trend where the solute concentration is estimated to no more than double or half in the next two years. Light red and light green indicate that solute concentrations will no more than double or half in the next year, respectively. Dark red and dark green indicate stronger upward and downward trends, respectively. In the event that the trend cannot be calculated, e.g. no data or our confidence in the trend smoother estimate is poor then the corresponding cell is coloured grey. Blue cells represent non-detect data.
As an example consider Figures \@ref(fig:GWSDATTimeSeriesPlot) and \ref{fig:GWSDATTrendsThresholdsPlot}. It can be seen that the trend at the end of the current model output interval (01-Feb-2006) for 'Benzene' at monitoring well 'MW-01' is decreasing. The corresponding cell in Figure \@ref(fig:GWSDATTrendsThresholdsPlot) (top left) has been coloured light green to illustrate this.
+ **Threshold - Absolute**: This assesses if the **observed** solute concentration values for all well and solute combinations are below a user-specified threshold value (default value of 500 ug/l) within any given model output interval. The threshold value is displayed as a horizontal dashed red line in the *Time Series* Plot, see Figure \@ref(fig:GWSDATTimeSeriesPlot) when the *Display Threshold* checkbox has been selected, see Section \@ref(SectionWellTrendPlot). The 'Threshold - Absolute' option compares the observed concentration values with the threshold value. If any observed concentration values within a model output interval are above the threshold value then the corresponding cell is coloured dark red. If the concentration values within a model output interval are all below the threshold value then the corresponding cell is coloured dark green. In the event that no data exists then the cell is coloured grey. If the current concentration value is classified as non-detect, then the corresponding cell is coloured blue. See Section \@ref(GWSDATEditOptions) for details on how to edit the threshold values for each solute.
+ **Threshold - Statistical**:
This assesses if current solute concentration levels for all well and solute combinations are below a user-specified threshold value **with a statistical degree of confidence**. Again the threshold value is displayed as a horizontal dashed red line in the *Time Series* Plot, see Figure \@ref(fig:GWSDATTimeSeriesPlot) when the *Display Threshold* checkbox has been selected, see Section \@ref(SectionWellTrendPlot).The 'Threshold - Statistical' option looks at the intersection of the end of the current model output interval (vertical grey line) and the trend smoother (solid blue line). If the upper 95\% confidence interval (upper dashed blue line) is below the user-specified threshold value, the cell is coloured dark green. If the upper 95\% confidence interval is not below the threshold value, the corresponding cell is coloured dark red. In the event that this cannot be calculated, e.g. no data or our confidence in the trend smoother estimate is poor then the cell is coloured grey. If the current concentration value is classified as non-detect, then the corresponding cell is coloured blue. See Section \@ref(GWSDATEditOptions) for details on how to edit the threshold values for each solute.
* **Show colour**: this drop-down listbox allows the user to filter the *Trends and Thresholds* plot according to the different colours. For example, if the user selects red then the plot will only display the corresponding rows and columns which contain a red entry. This function is particularly useful when there exists a large number of wells and/or solutes.
* **Aggregate by**: provides a drop-down menu which allows the temporal plotting resolution to be altered (Day, Month, Quarter, Year). This functionality is identical to the 'Aggregate by' option detailed in Section \@ref(SectionSpatialPlot).
* **Colour Key**: A graphic displaying the colour key explained above for the *Trends and Thresholds* plot. Note that this graphic can be moved to any convenient position by clicking and dragging with the mouse.
* **Temporal Slider**:
Use the slider (see bottom left of Figure \@ref(fig:GWSDATTrendsThresholdsPlot) to explore trends and thresholds across different time slices of the data. Note that this slider box can be moved to any convenient position by clicking and dragging with the mouse. The 'Play' symbol (forward-arrow) in the bottom right hand corner of the slider activates a 'movie', which can be paused by pressing the button again.
## Well Report {#WellReportPlot}
```{r, fig.cap = "GWSDAT Well Report plot.", label="GWSDATWellReportPlot",out.width = '75%', echo = FALSE}
include_graphics("figures/well_report.png")
```
This selection, which can be found under the tab named 'More', generates a matrix of graphs displaying time series solute concentration values on a well by well basis. In contrast to the *Time Series* plot (Section \@ref(SectionWellTrendPlot)), it is possible to overlay different solute concentration values within the same graph. Figure \@ref(fig:GWSDATWellReportPlot) is an example 'Well Reporting' output. The colour key at the top identifies each solute and the name of each well is displayed in a banner at the top of each of the individual time series graphs. The 'Well Reporting' output provides a very concise method of visualising a lot of data.
The choice of which solutes and wells to include, together with the choice of whether to use a log-scale for the solute concentration values, is selected by the user from the controls on the left hand side of the plot.
If only one solute is selected, then the plotting behaviour is modified such that the detect and non-detect data points are coloured black and orange, respectively. Furthermore, if the 'Conc. Trend Smoother' is checked in Figure \@ref(fig:GWSDATTimeSeriesPlot) then the corresponding
trend smoother with 95\% confidence intervals are overlaid as thin black lines onto each graph.
## Spatiotemporal Predictions {#SpatiotemporalPredictions}
```{r, fig.cap = "GWSDAT Spatiotemporal Predictions plot.", label="GWSDATSpatiotemporalPredictionsPlot",out.width = '75%', echo = FALSE}
include_graphics("figures/spatiotemporal_predictions.png")
```
This selection, located under the 'More' tab, is a visualisation to help assess the goodness of fit of spatiotemporal solute concentration smoother (see Section \@ref(SectionSpatialPlot) and \@ref(SSCS)) to the observed concentration data. A matrix of graphs displaying time series solute concentration values are generated on a well by well basis and the predictions of spatiotemporal solute concentration smoother are overlaid as solid grey lines, see example in Figure \@ref(fig:GWSDATSpatiotemporalPredictionsPlot). The choice of which solute and wells to include, together with the choice of units and whether to use a log-scale for the solute concentration values, is selected by the user from the controls on the left hand side of the plot.
## Customise Colour Key {#customisecolourkey}
This selection, located under the 'More' tab, is a function introduced in version 3.1 to customise the colour key in the *Spatial* plot (see Figure \@ref(fig:GWSDATSpatialPlot) and Section \@ref(SectionSpatialPlot)). Using the data editor, Figure \@ref(fig:GWSDATcustomisecolourkey), the colour key threshold values can be edited for each solute. Note the save button, located in the bottom right, needs to be clicked in order for the colour key to be updated.
```{r, fig.cap = "Customising the Spatial plot Colour Key.", label="GWSDATcustomisecolourkey",out.width = '45%', echo = FALSE}
include_graphics("figures/customise_colour_key.png")
```
## Save Session {#GWSDATSaveSession}
This selection, located under the 'More' tab, allows the user to save and download the current analysis session to a '.rds' file format. This is particularly useful for large data sets which may take a long time to fit the underlying models. The current display settings, e.g. Colour Scheme, Plot Options, Current Solute, are saved. This '.rds' file can be forwarded to another user and viewed once again exactly as it was saved.
If using the Excel Add-in data input interface then the *Restore Session* option (see Section \@ref(DataInputExcelAddinMenu)) can be used to open a previously saved '.rds' session. Alternatively, use the *Load Data* function, see Section \@ref(DataInputviaGUI).
## Options {#GWSDATEditOptions}
This selection, located under the 'More' tab, allows the user to specify the following settings:
* **Concentration Thresholds**: Edit and set concentration threshold values in ug/l for each solute. This is used for colour coding in the Trends and Thresholds visualisation, see Section \@ref(TRendTHreshMat).
* **Plume Diagnostic Settings**: Edit and set plume concentration threshold values in ug/l for each solute. This is used for plume diagnostics, see Section \@ref(GWSDATPlumeDiagnostics). Also set the ground porosity to a value ranging from 0-100% (default=25%). See Section \@ref(AppendixPlumeDiagnostics) for details on how this is used.
* **Image Export**: Allows the user to change various image export resolution settings, including *jpeg \% quality* and pixel dimensions.
* **Model Settings**: This option controls the resolution of the spatiotemporal solute concentration smoother (see Appendix \@ref(SSCS)). In an identical fashion to the Excel Add-in interface (Section \@ref(ExcelAddinMenuDataProcessingOptions)) the user can select between either a default resolution or a higher resolution model fit. In most instances there will be only small differences in the modelling results between the two settings. However, in some rare circumstances with complex data sets, it may well be necessary to use the higher resolution setting. A default resolution model corresponds to a model *Number of segments*=6 and a higher resolution model corresponds to 8. The user can select up to a value of 12. Please note for each unit increase *Number of segments* the model will take 3-4 times longer to fit.
<!-- ## Reporting -->
<!-- <!-- \label{sec:reporting} -->
<!-- In addition to providing visualisation of groundwater monitoring data, GWSDAT is also able to export displays in a variety of file formats, for inclusion in reports. The map displays in the *Spatial Plot* tab of the *Analyse* section are used to illustrate this. At the foot of the main map display there are three buttons. -->
<!-- * **Image format** provides a drop-down menu of the file type used when a spatial plot at a particular time point is created. The available file types `png`, `jpg`, `pdf`, `ps` and `pptx`. -->
<!-- * **Generate PPT Animation** creates a downloads a sequence of plots which display concentration maps across the whole time course. Paging through these slides provides a very simple but effective means of animation. -->