TuPlot: Difference between revisions
Content deleted Content added
No edit summary |
No edit summary |
||
| (14 intermediate revisions by 3 users not shown) | |||
Line 1:
=Introduction=
The TuPlot functionality is a python based tool for plotting inputs and output from TUFLOW. For the 2016 version of TUFLOW a new output format was made available, this has the following changes from previous versions:
Line 7 ⟶ 5:
* .tpc (<u>T</u>UFLOW <u>P</u>lot <u>C</u>ontrol file links to data in csv and gis folders
* Has additional Node and Channel information files contain connectivity information
This is the default approach for the 2016 version but can be modified with the TUFLOW command "<tt>Output Approach == Pre 2016</tt>" (refer to the <u>[https://docs.tuflow.com/classic-hpc/manual/latest/ TUFLOW Manual]</u> for more information on this command.
<br>
The TuPlot utility is currently available as part of a QGIS plugin
=Installation=
TuPlot is contained within the [[TUFLOW_QGIS_Plugin | TUFLOW QGIS Plugin]]. Refer to the [[TUFLOW_QGIS_Plugin | Plugin]] page for installation details.
=TUFLOW Python Results Library=
The TuPlot plotting utility relies on a python library '''TUFLOW_results2016.py''' for loading the TUFLOW results. This python based library can also be used to access TUFLOW results from python (outside of TuPlot). Please refer to [[
=QGIS TuPlot=
This plotting functionality is currently accessed via QGIS
Once this has been installed successfully QGIS can be open and the plugin accessed via the '''Plugin >> TUFLOW >> TuPlot''' menu item, or via the TuPlot button in the toolbar. The toolbar icon is shown below.<br>
[[File:TuPlot Icon 01.JPG]]
Line 51 ⟶ 52:
<li>matplotlib toolbar - this contains options for changing the zoom and customising the plot window.</li>
<li>Selected elements view. This contains a list of the ID's of the selected elements (1D, 2D or RL). This is for display only. Changing the selection here does not alter the plot</li>
<li>Time step selection. This is only valid for '''Long Profile''' viewing, see
<li>Status dialogue. This contains information on the status of the TuPlot utility. If there are any warnings or errors these should be displayed in the status window.</li>
<li>Clear Status. This can be used to clear previous messages to the status dialogue</li>
Line 84 ⟶ 85:
The annotated image below, shows the workflow.<br>
[[File:TuPlot Timeseries 01A.PNG]]
===Dual Axis===
A secondary y-axis is available to plot data. For example flows and velocities are likely to have quite different ranges. In the image below, two GIS locations are selected:
* '''q1''' is a reporting location which sums the flows from the main channel as well as over-bank areas. This RL only has flow data available and not velocity data.
* '''FC01.14''' is a 1D channel and has both flow and velocity results available.
In the case below the 2nd axis is enabled with the highlighted check box, and the data to be plotted on the secondary axis is velocity. The primary data is the flow data. The legend has been enabled in the '''Options''' tab.<br>
Three lines are plotted in the image below, flows for both the reporting location and channel and velocities only for the 1D channel.<br>
[[File:TuPlot Timeseries 02A.PNG]]
===Multiple Results Files===
Multiple results files can be opened, see Loading Results above.<br>
In the image two results files have been opened (the 1st using '''Add Res + GIS''' and the second with the '''Add Results''' button. These are:
* M02_5m_001_LowN - A low Manning's n case of Tutorial Module 2 with Manning's decreased by 20% with the .tcf command "<font color="blue"><tt>Read Materials File </tt></font> <font color="red"><tt>==</tt></font><tt> ..\model\materials.csv | 0.8 </tt><font color="green"><tt>!Decrease Roughness by 20%</tt></font>"
* M02_5m_001_HighN - A high Manning's n case of Tutorial Module 2 with Manning's increased by 20% with the .tcf command "<font color="blue"><tt>Read Materials File </tt></font> <font color="red"><tt>==</tt></font><tt> ..\model\materials.csv | 1.2 </tt><font color="green"><tt>!Increase Roughness by 20%</tt></font>"<br>
With both sets of results loaded a reporting location has been used to plot the water levels for both the low and high Manning's n scenarios. As expected the higher Manning's n results in an increased water level.<br>
[[File:TuPlot Timeseries 03A.PNG]]
==Long Profiles==
Long profiles can be plotted using the TuPlot utility for 1D sections only. When dealing with 1D long profile data, if a single 1D channel is specified the data for all channels downstream will be plotted. If two channels are specified, long profile data will only be returned for the channels between the specified channels (an error occurs if the channels are not connected). If more than 2 channels are selected, a warning is given and only the 1st two channels are used.<br>
=Plotting 1d_ta (tabular data)=▼
<br>
To plot a long profile, the steps are:
* Ensure that a results file is open
* Ensure that that plot lines are selected in the layer control
* Select '''Long Profile''' in the Plot Type dropbox.
* Select one or two 1D channels.
This workflow is outlined in the image below.<br>
[[File:TuPlot LongProfile 01B.PNG]]
Once a profile has been created (or before) the user can select the type of results to be plotted in the '''Results Type''' list. In the plot above the plotted results are, maximum water level, maximum energy level, water level at time and bed level. If this is changed the '''Update Plot''' will need to be selected to redraw the plot, or the selection in the can be changed as this will trigger a re-draw.<br>
If plotting a water level or energy level at a time, the '''Time''' list can be used to change the currently plotted time. When this is changed the plot is automatically re-drawn.
===Adverse Gradients===
When TuPlot determines the channels to be plotted, a check is performed that the water levels or energy levels (if they have been output) decrease as you go downstream. If there are adverse gradients detected TuPlot will issue a warning in the '''Status Dialogue'''.<br>
It could be that an adverse gradient is normal, i.e. a storm surge into a drainage channel. However, it could also indicate that a channel is digitised incorrectly or that an instability has occurred. <br>
The '''Adverse gradient''' results type can be enabled to see where on the long profile these occur, and if the legend is turned on the 1D node ID's. This can be seen in the image below.<br>
[[File:TuPlot LongProfile 02A.PNG]]
===Animate Long Profile===
The TuPlot utility can save out a series of images (in the .png format) of each of the timesteps in the long profile data. These are saved out to the .tpc folder and are given a sequential number. These can be converted into a video using software such as Windows movie maker or ffmpeg.<br>
[[File:TuPlot LongProfile 03.PNG]]
▲==Plotting 1d_ta (tabular data)==
To plot 1d tabular data (1d cross sections, 1d losses, 1D nodal area), the step in TuPlot are:
* Open the relevant 1d_xs or 1d_ta GIS layer. This should be in the format outlined in the <u>[https://docs.tuflow.com/classic-hpc/manual/latest/ TUFLOW Manual]</u>.
* Select feature(s) to plot
This workflow is shown in the image below.<br>
[[File:TuPlot TabularData 01A.PNG]]
<br>
If the cross-section has roughness data (the '''Flags''' attribute includes '''M''' [material ID] or '''n''' [Manning's n]) this can be visualised by navigating to the options tab and checking the box for '''Display Roughness''' (see TuPlot window above). An example is shown in the image below.<br>
[[File:TuPlot TabularData 02.PNG]]
| |||