8. Output Visualisation with QSWAT+
8.8.1 Collecting plot data
As with other visualisation options, start by selecting a scenario and SWAT+ output table. Then reduce the period if you wish. Next you can select an observed data file if you have one, and we have observedFlow.csv in the Robit/Observed directory (Figure 33). The structure of observed data files is described later.
table is selected, e.g. channel_sd_mon, and clicking Add plot. This adds a row to the table, and already shows the chosen scenario and table. The Unit field is empty and so is the Variable. This first row is also the currently selected row, and this is important. Whenever we change the scenario, output table, unit or variable settings through their pull-down menus we will immediately change values in the currently selected row. When you have more than one row you can select a row by clicking in it.
Suppose we want to compare the main monthly outlet flows from two scenarios. Then we could choose for each scenario the table channel_sd_mon. We need to find the channel number of the outlet channel. There are several ways of doing this.
1. When we use the Unit pull down menu, as each potential choice is highlighted when we move the mouse over it, the corresponding channel, LSU, or HRU is highlighted in the map canvas. This is a good way to check we have the right item if we think we know the unit number, but a rather slow method to find a unit by location, like the watershed outlet channel.
2. We make sure that the Show Map Tips QGIS button (Figure 41) is pressed, select the appropriate map in the layer panel (rivs1, gridstreams or drainstreams for channels; Inlets/outlets for points marked in the inlets/outlets file; Pt sources and reservoirs for point sources and reservoirs added by QSWAT+; lsus2 or lsus for LSUs; hrus2 or hrus for HRUs; aquifers for aquifers) and hover the mouse over the feature. A map tool tip will be displayed showing the unit type (e,g, Channel) and number.
3. We select the appropriate map in the layers panel, as in the previous method 2. We click the Identify Features QGIS button (Figure 41), and click on the intended feature, such as the outlet channel (Figure 42). We see from the Identify Results panel that the channel number is 17, so we select 1 as the Unit.
Figure 41: Identify Features and Show Map Tips buttons
We select flo_out as the Variable. Now we want to add a second row to the table for the other scenario. A convenient way to do this is the Copy plot button. This copies the current row to a new row, and makes it current. Then all we have to do is choose a new scenario and the
Figure 42: Identifying the outlet channel
It is also possible to move the current row up or down: this just affects the ordering of the plots in the output.
To add observed data we select an observed data file, and use the button Add observed.
observed is used as the scenario name, '-' is used for Table, and Unit, and we can select a
variable name from the file.
We use the observed data file observedFlow.csv from Robit/Observed. There is only one variable, in this file, Flow, so it is already selected in the observed row.
Figure 43: Plot screen
When we have completed the plot selections we click Plot. This invites us first to choose a .csv file to save the data. We can if we wish later import this into, for example, Excel if we wish to do further manipulations or use Excel’s graphing tools.
graphically: see Figure 44. The data has been displayed as line graphs. We can change the display to bar chart using the Chart Type pull-down box and clicking Update Graph. Figure 34 shows a plot of the flow out of channel 1 against the observed data file observedFlow.csv supplied with the Robit example. .
Other SWATGraph options include importing another (similarly created) .csv file, using New File to Plot, and using the buttons immediately below the graph. These include zooming and panning the graph, saving the graph in a variety of image formats (the rightmost button) and a number of editing options (rightmost button but one). You can add a title, add a label to the vertical axis, change the colours of the plots, and (for line graphs only) change the vertical axis from linear to log scale, which is useful when there is a wide variation in values. The data from the .csv file is also displayed. The column headings, also shown in the graph legend, take the form Scenario-Table-Unit-Variable, where Unit is the aquifer, channel, LSU or HRU number as appropriate for the table. For an observed plot the form is observed- Variable.
At the bottom of the screen some statistics are displayed. These are correlation coefficients for each pair of plots, and Nash coefficients for each pair of plots where one is observed. Some of these may be meaningless, of course, if for example you choose to plot four things that are really two pairs, but it is quicker as well as simpler to calculate them all than it is to ask the users what they want.
SWATGraph may also be run as a stand-alone tool. Double click on runSWATGraph.bat (Windows) or runSWATGraph.sh (Linux and Mac) to start it, or use this as the command in a command shell. In the latter case you can optionally add the path to a .csv file to plot the csv file automatically at the start. runSWATGraph is in SWATPlus/Tools/SWATGraph if you installed it with QSWAT+, else, in Windows if you had it from QSWAT, in
C:/SWAT/SWATEditor.