Difference between revisions of "TUFLOW Viewer"

From Tuflow
Jump to navigation Jump to search
(369 intermediate revisions by 7 users not shown)
Line 1: Line 1:
=TUFLOW Viewer=
+
TUFLOW Viewer replaces Crayfish and TUPLOT as the TUFLOW result viewer for <u>[[QGIS_Tips | QGIS]]</u> (version 3.6 onwards). It uses the Mesh Data Abstraction Library (MDAL) available in QGIS to display and interact with TUFLOW map output results, and the TUFLOW results python library (the same library used by TUPLOT in earlier versions of QGIS) for viewing TUFLOW time series results.<br>
TUFLOW Viewer replaces Crayfish and TUPLOT as the TUFLOW result viewer for QGIS for version 3.6 onwards. It uses the Mesh Data Abstraction Library (MDAL) available in QGIS to display and interact with TUFLOW map output results, and the TUFLOW results python library (the same library used by TUPLOT in earlier versions of QGIS) for viewing TUFLOW time series results.<br>
+
<br>
 +
__TOC__
 +
 
 +
 
 +
 
 
=Getting Started=
 
=Getting Started=
==Installation==
+
==QGIS Version==
TUFLOW Viewer is a free tool that comes as part of the TUFLOW plugin in QGIS. For instructions on how to install the plugin, read the following wiki page:<br><br>
+
<b>''A few notes on the recommended QGIS version:''</b><br>
[[TUFLOW_QGIS_Plugin#Installation_of_Plugin | How to install the TUFLOW plugin]]<br><br>
 
There are also instructions on installing plugins in the QGIS documentation - if you choose to follow the QGIS documentation, the plugin is called "TUFLOW" in the repository:<br><br>
 
[https://docs.qgis.org/3.16/en/docs/training_manual/qgis_plugins/fetching_plugins.html Link to QGIS Documentation - Installing and Managing Plugins]<br><br>
 
  
==Opening TUFLOW Viewer==
+
It is recommended to use the latest version of QGIS. The reasons for this are:
Once the TUFLOW plugin is installed, the TUFLOW Viewer tool can be opened by clicking the following icon in the plugin toolbar:<br>
+
* TUFLOW Viewer is developed using the latest version, and although backwards compatibility is maintained as best as possible, TUFLOW Viewer is tested more frequently on the latest QGIS version.
[[File: TUFLOW_Viewer_In_Toolbar.PNG]]<br><br>
+
* The mesh data provider (MDAL) and the temporal controller (which now underpins the mesh datasets in QGIS) are both relatively new in comparison to other libraries (e.g. GDAL) and are therefore more regularly updated with new features, enhancements, and bug fixes by the QGIS developers. TUFLOW Viewer takes advantage of these updates.<br>
  
==Upgrading The Plugin==
+
Although TUFLOW Viewer has been developed to be consistent across QGIS versions, it is not always possible. Some QGIS developments and behaviour changes have led to TUFLOW Viewer behaviour also changing either through necessity or to keep in-line with the QGIS development direction. The below is a current list of known behaviour changes due to QGIS version:<br>
It's recommended to upgrade the plugin whenever a new version is released. The upgrade process is done in the Plugin Manager.<br>
+
<ol>
 +
<li> '''Date-time format within TUFLOW Viewer''' - QGIS 3.14 introduced the '''temporal controller'''<br>
 +
* Prior to QGIS 3.14, TUFLOW Viewer stored all results internally as relative time. The user could display as date-time and the reference time by changing '''Zero Date''' in '''Settings >> Options'''.
 +
* QGIS 3.14, TUFLOW Viewer tried to mimic the behaviour of previous versions but the reference time could also be altered natively in the mesh layer '''Properties'''. Note on this version, this is the first QGIS release with the '''temporal controller''' and as a consequence some of the functionality matured and changed in subsequent versions. Users may experience strange behaviour when using TUFLOW Viewer with the QGIS 3.14 if using date-time format. It is recommended to upgrade to later versions of QGIS if date-time format is required.
 +
* Post QGIS 3.14 TUFLOW Viewer stores all results internally as absolute time and the user must change the reference time in the native properties of the mesh layer to alter the dates being displayed. '''Zero Date''' now only changes how the relative time is displayed in TUFLOW Viewer and doesn't change the mesh layer reference time.
 +
* Please follow the link below on how to use isodate (date-time) format in TUFLOW Viewer in QGIS 3.16+ (recommended minimum version if using date-time format): <u>[[TUFLOW_Viewer_-_Isodate_(Date-Time)_Format | Working With Isodate (Date-Time) format]]</u>.
 +
</ol><br>
  
===Error While Upgrading the Plugin===
+
'''Other Known Issues'''<Br>
[[ TUFLOW_QGIS_Plugin#Error_While_Upgrading_Plugin | Error_While_Upgrading_Plugin ]]<br>
+
* QGIS 3.24 uses Matplotlib v3.5.1 which contains the following known bug which may affect users when re-labelling datasets within the TUFLOW Viewer plot window:<Br>
<br>
+
: [[TUFLOW_Viewer_Matplotlib_v3.5.1_Bug | TUFLOW Viewer - Matplotlib v3.5.1 bug]]<br>
 +
* "ValueError: Failed to find font DejaVu Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0, and fallback to the default font was disabled"
 +
: [[TUFLOW_Viewer_Matplotlib_Font_Error | TUFLOW Viewer - Matplotlib Font Error]]<br>
  
 +
==Installation or Version Upgrade==
 +
===Installation===
 +
TUFLOW Viewer is a free tool that comes as part of the TUFLOW plugin in QGIS. For instructions on how to install the plugin, please follow these steps: <u>[[TUFLOW_QGIS_Plugin#Installation_of_Plugin |Installation of Plugin]]</u>.<br>
 +
There are also instructions on installing plugins in the QGIS documentation - if you choose to follow the QGIS documentation, the plugin is called "TUFLOW" in the repository: <u> [https://docs.qgis.org/3.16/en/docs/training_manual/qgis_plugins/fetching_plugins.html Link to QGIS Documentation - Installing and Managing Plugins]</u>.<br>
  
=How To Use=
+
===Plugin Upgrades===
==Basics==
+
It's recommended to upgrade the plugin whenever a new version is released. The upgrade process is typically done via the Plugin Manager ('''QGIS Drop Menu: Plugins >> Manage and Install Plugins''').<br>
Some of the basic functionality are listed below this section and describe how to:<br>
+
[[File: TUFLOW Plugin Update.JPG||600px]]<br><br>
<ol>
+
If you encounter an error while upgrading the plugin please follow these steps: <u>[[ TUFLOW_QGIS_Plugin#Error_While_Upgrading_Plugin | Error While Upgrading Plugin ]]</u>.
<li> [[ #Loading_Results | Load Results ]]
 
<li> [[ #Map_Outputs | Interact with Map Outputs ]]
 
<li> [[ #Plotting_From_Map_Outputs | Plot From Map Outputs ]]
 
<ol>
 
<li> [[ #Time_Series | Time Series ]]
 
<li> [[ #2D_Cross_Sections_and_Long_Sections | Cross Section / Long Plot ]]
 
<li> [[ #Plotting_Flow | Flow ]]
 
<li> [[ #Clear_Plot | Clear the Plot and Graphic Layers (coming soon) ]]
 
</ol>
 
<li> [[ #Plotting_From_Time_Series_Outputs | Plot From Time Series Output ]]
 
<li> [[ #Plotting_1D_Long_Sections | 1D Long Plot ]]
 
<li> [[ #Using_a_Secondary_Axis | Use a Secondary Axis ]]
 
<li> [[ #Changing_Plot_Properties | Change Plot Properties ]]
 
<li> [[ #Export_Plot | Export The Plot as an Image or CSV (coming soon) ]]
 
</ol>
 
  
==Advanced==
+
==Development Version==
Some more advanced use is described in the following pages:
+
It's possible to test out the latest development version of the plugin and TUFLOW Viewer by following the instructions below:<br>
<ol>
+
<b><u>[[Installing_the_Latest_Development_Version_of_the_TUFLOW_Plugin | Installing the Latest Development Version of the TUFLOW Plugin]]</u></b>
<li> Animations (coming soon)
+
<br><Br>
<li> Maps (coming soon)
 
<li> Using a Date Axis (coming soon)
 
<li> Importing Calibration Data (coming soon)
 
<li> Batch Exporting Plots (coming soon)
 
</ol>
 
  
==Getting a Python Error==
+
=Using TUFLOW Viewer=
Occasionally the TUFLOW plugin will throw an exception and this will produce a '''Python Error''' which is displayed either as a yellow banner at the top of the map window or a window may appear stating than an 'Error has occurred while executing Python code'.<br>
+
==Opening the TUFLOW Viewer==
[[File: PythonError.PNG]]<br>
+
After installing the QGIS TUFLOW plugin, the TUFLOW Viewer tool can be opened by clicking the following icon in the plugin toolbar:<br>
===What Does This Mean?===
+
[[File: TUFLOW_Viewer_In_Toolbar.PNG]].<br>
This means that the TUFLOW plugin has encountered something unusual or a situation that it does not know how to handle i.e. it has reached a line in the code that has failed to execute and as a consequence Python has bailed out. This means that all the code below this point that was meant to be executed has not. This can have knock on consequences as variables may not exist or be set to incorrect values and signal handling (e.g. what happens when a menu item is clicked) may be broken. So a python error can lead to further python errors that would normally not have occurred, so the first python error is usually the most important.<br>
 
  
===What To Do===
+
==Loading Results==
 +
TUFLOW simulation results can be loaded several ways:<br>
 
<ol>
 
<ol>
<li> Email the '''Stack Trace''' to [mailto:support@tuflow.com support@tuflow.com] with a description of the steps that produced the python error (as best you can describe it). This is to help us identify bugs and fix the plugin so that it catches this exception in the future.
+
<li> Select '''File >> Load Results''' from the TUFLOW Viewer drop down menu.<br>
<li> If you find that you are now experiencing further python errors (probably caused by the initial error) you can try the following in order of severity:
+
[[File:TUFLOW Plugin Load 1.jpg||800px]]<br>
<ol>
+
<li> Right Click in the '''Open Results''' panel and select '''Load Results'''.<br>
<li> On the TUFLOW Viewer menu bar '''File >> Reload TUFLOW Viewer''' - this will reload TUFLOW Viewer, resetting all variables and signals. You will be required to load in any time series results again and other settings may also be reset. Map output results will remain in the workspace and be reloaded into TUFLOW Viewer.
+
[[File:TUFLOW Plugin Load 2.jpg||800px]]<br>
<li> Save the workspace (.qgz) and restart QGIS
 
<li> Restart QGIS - you can save the workspace (.qgz), however you should first select on the TUFLOW Viewer menu bar '''File >> Close TUFLOW Viewer Completely''' - this will close the viewer and also remove all settings associated with it from the workspace so that the problematic variable is not accidentally reloaded with the workspace
 
<li> The nuclear option - Restart QGIS and load a new workspace from scratch (do not load a saved workspace)
 
 
</ol>
 
</ol>
</ol><br><Br>
+
Using either of the above methods, the following result load options are available:
 
 
=Loading Results=
 
Results can be loaded several ways:<br><br>
 
'''Option 1'''
 
: '''File >> Load Results'''<br>
 
'''Option 2'''
 
: Right Click in '''Open Results >> Load Results'''<Br>
 
<br>
 
The following options are available for loading into TUFLOW Viewer:
 
 
<ol>
 
<ol>
<li> '''[[TUFLOW_Viewer_-_Load_Results | Load Results]]''' --> This is done via a TCF, TLF, or FVC (TUFLOW FV) file and will load in all results (Map Outputs and ESTRY Time Series)
+
<li> <u>'''[[TUFLOW_Viewer_-_Load_Results | Load All Results]]'''</u> --> This is done via a TCF, TLF, or FVC (TUFLOW FV) file and will load in all results (Map Outputs and ESTRY Time Series).
<li> '''[[TUFLOW_Viewer_-_Load_Results_-_Map_Outputs | Load Results - Map Outputs]]'''  --> Select map output mesh results file (*.xmdf, *.dat, *.2dm, *.xmdf.sup, *.dat.sup, *.nc ''(supports netCDF format from TUFLOW FV output only)'')
+
<li> <u>'''[[TUFLOW_Viewer_-_Load_Results_-_Map_Outputs | Load Results - Map Outputs]]'''</u> --> Select map output mesh results file ('''*.xmdf, *.dat, *.2dm, *.xmdf.sup, *.dat.sup, *.nc''' ''(supports netCDF format from TUFLOW FV output only)'').
<li> '''[[TUFLOW_Viewer_-_Load_Results_-_Time_Series | Load Results - Time Series]]'''  --> Select ESTRY time series output results (*.tpc)
+
<li> <u>'''[[TUFLOW_Viewer_-_Load_Results_-_Time_Series | Load Results - Time Series]]'''</u> --> Select ESTRY / SWMM time series output results ('''*.tpc *.gpkg''').
<li> '''[[TUFLOW_Viewer_-_Load_Results_-_Time_Series_FM | Load Results - Time Series FM]]'''  --> Load Flood Modeller results. This requires a .gxy and result .csv file to be exported from Flood Modeller.
+
<li> <u>'''[[TUFLOW_Viewer_-_Load_Results_-_Time_Series_FM | Load Results - Flood Modeller Time Series]]'''</u> --> Load Flood Modeller results. This requires a '''*.gxy''' and result '''*.csv''' file to be exported from Flood Modeller.
<li> '''[[TUFLOW_Viewer_-_Load_Results_-_Particles | Load Results - Particles]]'''  --> Select output from particle module (*.nc) which will typically be suffixed with '''_ptm'''
+
<li> <u>'''[[TUFLOW_Viewer_-_Load_Results_-_Particles | Load Results - Particle Tracking Module]]'''</u> --> Select output from particle module ('''*.nc''') which will typically be suffixed with '''_ptm'''.
<li> '''[[TUFLOW_Viewer_-_Import_1D_Hydraulic_Tables | Import 1D Hydraulic Tables]]'''  --> Select a '''_1d_ta_tables_check.csv''' check file
+
<li> <u>'''[[TUFLOW_Viewer_-_Load_Results_-_NetCDF_Grid | Load Results - NetCDF Grid]]'''</u>  --> Load TUFLOW NC or HRNC map output results.
<li> '''[[TUFLOW_Viewer_-_Import_1D_ESTRY_Cross_-_Sections | Import 1D ESTRY Cross-Sections]]'''  --> This will automatically happen if an appropriate TUFLOW input is opened in QGIS while TUFLOW Viewer is open (e.g. 1d_xs)
+
<li> <u>'''[[TUFLOW_Viewer_-_Import_1D_Hydraulic_Tables | Import 1D Hydraulic Tables]]'''</u> --> Select a '''_1d_ta_tables_check.csv''' check file.
 +
<li> <u>'''[[TUFLOW_Viewer_-_Import_2D_BC_Tables | Import 2D BC Tables]]'''</u> --> Select a '''_2d_bc_tables_check.csv''' check file.
 +
<li> <u>'''[[TUFLOW_Viewer_-_Import_1D_ESTRY_Cross_-_Sections | Import 1D ESTRY Cross-Sections]]'''</u> --> This will automatically happen if an appropriate TUFLOW input is opened in QGIS while TUFLOW Viewer is open (e.g. 1d_xs).
 +
<li> <u>'''[[TUFLOW_Viewer_-_Importing_a_User_Defined_Time_Series_To_Display_On_The_Plot | Importing a User Defined Time Series Dataset To Display In The Plot Window]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Loading_Results_While_TUFLOW_is_Running | Loading Results While TUFLOW is Running]]'''</u>
 
</ol>
 
</ol>
<br>
 
[[File: LoadResults_Eg_img.PNG]]<br>
 
  
'''If I Receive an Error?'''<br>
+
'''Troubleshooting'''<br>
If you receive an error similar to that below when trying to load results from a TCF:<br>
+
If you receive an error similar to that shown below when attempting to load results from a TCF you will need to fix the encoding of your TUFLOW control files:<br>
 
<pre>
 
<pre>
 
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 626: invalid start byte
 
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 626: invalid start byte
 
</pre>
 
</pre>
This usually results from inconsistent encoding of the TUFLOW control files. You can fix this by changing the encoding of all your control files to a single type - typically UTF-8. You can do this using Notepad++, please see below link for how to do this (refer last image).<br>
+
This error is caused by incompatible encoding of the TUFLOW control files. You can resolve this issue by changing the encoding of all your TUFLOW control files to a single type (typically UTF-8). You can do this using Notepad++. Please see the following link for instructions on how to do this (refer last image): <u>[[TUFLOW_Message_0060 | TUFLOW Message 0060]]</u>.<br>
[[TUFLOW_Message_0060]]<br>
+
 
 +
== TUFLOW-SWMM Results ==
 +
Results from a linked TUFLOW-SWMM model can be loaded via the standard menu options (available from the TUFLOW plugin version 3.10):
 +
* <u>'''[[TUFLOW_Viewer_-_Load_Results_-_Time_Series | Load Results - Time Series]]'''</u> to load the GPKG time series format (_swmm_ts.gpkg) by itself. The GPKG time series format is a new format similar to the .tpc with some additional functionality. More information can be found in the <b><u>[[#GPKG_Time_Series_Format | GPKG Time Series Format]]</u></b> section.
 +
* <u>'''[[TUFLOW_Viewer_-_Load_Results_-_Map_Outputs | Load Results - Map Outputs]]'''</u> to load in 2D map output results
 +
* <u>'''[[TUFLOW_Viewer_-_Load_Results | Load Results]]'''</u> to load all available results from the model. This includes .xmdf, .tpc, and .gpkg results which could all be available for a given model run. Note that .tpc and .gpkg are both time series type results and will load separate GIS _PLOT_ layers.
 +
 
 +
== GPKG Time Series Format ==
 +
The GPKG time series format is a new format similar to the .tpc with enhanced temporal functionality. Currently the GPKG time series format is only supported as an output from SWMM in TUFLOW-SWMM linked models and only supported in TUFLOW Plugin version 3.10+ and QGIS 3.16+.<Br>
 
<br>
 
<br>
 +
The GPKG format is different from the TPC format as it supports temporal styling in QGIS. As an example, the line width of the channels can be varied by both time and flow, with wider lines showing higher flow than thinner lines at a particular timestep. The format is fully compatible with the QGIS temporal controller and reacts dynamically as the temporal controller is updated. This results in a dynamic, and intuitive, method of showing the user the flood progression in the 1D system. Another benefit of being compatible with the core QGIS temporal capabilities is that the styling will also be dynamically updated if included in an animation export. TUFLOW Viewer's animation export tool has been updated to enable GPKG results to be exported with 2D results or even by itself.<br>
 +
<br>
 +
The layer's styling can be automatically set using the TUFLOW Plugin via the layer's right-click context menu (under the TUFLOW submenu) or will automatically by styled if the results are loaded via TUFLOW Viewer. Examples of this format in QGIS are linked below:
 +
* <b><u>[[Automatically_Styling_GPKG_Time_Series | Styling layers from the GPKG time series output]]</u></b>
 +
* <b><u>[[TUFLOW_Viewer_-_Load_Results_-_GPKG_Time_Series | Loading results via TUFLOW Viewer]]</u></b>
 +
The GPKG time series format is an open format and the specification is detailed at the below link:
 +
* <b><u>[[GPKG_Time_Series_Format_Specification | GPKG Time Series Format Specification]]</u></b>
  
=Map Outputs=
+
== Data Selection, Display and Styling==
Map outputs are the 2D result outputs from TUFLOW (or 3D outputs from TUFLOW FV). Basic interaction with the map output results in TUFLOW Viewer are described below:
+
===Map Output===
 +
Map Outputs are the time varying 2D result outputs from TUFLOW (or 3D outputs from TUFLOW FV). Data selection, display, styling and plotting instructions for Map Output results in TUFLOW Viewer are described below:
 
<ol>
 
<ol>
<li> '''[[TUFLOW_Viewer_-_Map_Outputs_-_Changing_Results | Change Results]]''' --> changing between different simulation results is done by selecting the result name(s) in the 'Open Results' widget
+
<li> Load Map Output results either via:
<li> '''[[TUFLOW_Viewer_-_Map_Outputs_-_Changing_Result_Type | Change Result Type]]''' --> changing between different result types is done using the 'Result Type' widget
+
<ol>
<li> '''[[TUFLOW_Viewer_-_Map_Outputs_-_Displaying_Maximum | Display Maximum]]''' --> if available, maximums can be toggled on/off for the different result types
+
<li> <u>'''[[TUFLOW_Viewer_-_Load_Results | Load All Results]]'''</u>, or
<li> '''[[TUFLOW_Viewer_-_Map_Outputs_-_Displaying_Vectors | Display Vectors]]''' --> vector results can be displayed in combination with any of the scalar result types e.g. velocity vectors can be displayed with depth
+
<li> <u>'''[[TUFLOW_Viewer_-_Load_Results_-_Map_Outputs | Load Results - Map Outputs]]'''</u>
<li> '''[[TUFLOW_Viewer_-_Map_Outputs_-_Styling_Scalar_Types | Style Scalar Map Outputs]]''' --> styling scalar map output results is similar to styling raster layers in QGIS and can be done via QGIS properties (right click >> properties) or pressing F7 to open the properties docking window.
+
</ol>
<li> '''[[TUFLOW_Viewer_-_Map_Outputs_-_Styling_Vector_Types | Style Vector Map Outputs]]''' --> similar to the styling the scalar map outputs, there are a range of options for styling the vector layers.
+
<li> <u>'''[[TUFLOW_Viewer_-_Reload_Results | Reload Results]]'''</u> --> Reload and update results
<li> '''[[TUFLOW_Viewer_-_Map_Outputs_-_Saving_Default_Styles | Save Default Styles]]''' --> users can save default styles for result types so that they are automatically applied each time results are imported using TUFLOW Viewer.
+
<li> <u>'''[[TUFLOW_Viewer_-_Map_Outputs_-_Change_Result_Selection | Change Simulation Result Selection]]'''</u> --> Changing between different simulation results is done by selecting the result name(s) in the 'Open Results' widget.
<li> '''[[TUFLOW_Viewer_-_Map_Outputs_-_Displaying_The_Mesh | Display The Mesh]]''' --> the quickest way to toggle the mesh is to click the grid box in TUFLOW Viewer.
+
<li> <u>'''[[TUFLOW_Viewer_-_Map_Outputs_-_Changing_Result_Type | Change Result Type Selection]]'''</u> --> Changing between different result types is done using the 'Result Type' widget.
 +
<li> <u>'''[[TUFLOW_Viewer_-_Map_Outputs_-_Displaying_Maximum | Display Result Maximum]]'''</u> --> If available, maximums can be toggled on/off for the different result types.
 +
<li> <u>'''[[TUFLOW_Viewer_-_Map_Outputs_-_Displaying_Vectors | Display Vectors]]'''</u> --> Vector results can be displayed in combination with any of the scalar result types (e.g. velocity vectors can be displayed with depth).
 +
<li> <u>'''[[TUFLOW_Viewer_-_Map_Outputs_-_Styling_Scalar_Types | Style Scalar Map Outputs]]'''</u> --> Styling scalar map output results is similar to styling raster layers in QGIS.
 +
<li> <u>'''[[TUFLOW_Viewer_-_Map_Outputs_-_Styling_Vector_Types | Style Vector Map Outputs]]'''</u> --> Similar to the styling the scalar map outputs, there are a range of options for styling the vector layers.
 +
<li> <u>'''[[TUFLOW_Viewer_-_Map_Outputs_-_Saving_Default_Styles | Save Default Styles]]'''</u> --> Users can save default styles for result types so they are automatically applied each time results are imported using TUFLOW Viewer.
 +
<li> <u>'''[[TUFLOW_Viewer_-_Map_Outputs_-_Displaying_The_Mesh | Display The Mesh]]'''</u> --> The quickest way to toggle the mesh is to click the grid box in TUFLOW Viewer.
 +
<li> <u>'''[[TUFLOW_Viewer_-_Map_Outputs_-_3D_to_2D_Depth_Averaging_Method | 3D to 2D Depth Averaging]]'''</u> --> For 3D map output results, the 3D to 2D depth averaging method can be changed in the layer properties.
 +
<li> <u>'''[[TUFLOW_Viewer_-_Toggling_Between_Output_Timesteps | Lock/Unlock Output Time Steps from Different Result Datasets]]'''</u> --> Locking Plot Output Timesteps to the Map Output Interval.
 +
<li> <u>'''[[TUFLOW_Viewer_-_Isodate_(Date-Time)_Format | Working With Isodate (Date-Time) Format]]'''</u> --> View results using absolute time format (dd/mm/yyyy hh:mm:ss) instead of relative time format (hh:mm:ss).
 +
<li> <u>'''[[TUFLOW_Viewer_-_Map_Outputs_-_Plotting_Time_Series | Map Output Plot - Plotting Time Series]]'''</u> --> Plotting Map Output results.
 +
<li> <u>'''[[TUFLOW_Viewer_-_Map_Outputs_-_Plotting_Cross-Sections_And_Longitudinal_Profiles | Map Output Plot - Plotting Cross-Sections and Longitudinal Profiles]]'''</u> --> Plotting Map Output results.
 +
<li> <u>'''[[TUFLOW_Viewer_-_Map_Outputs_-_Plotting_Flow | Map Output Plot - Plotting Flow]]'''</u> --> Plotting Map Output results.
 +
<li> <u>'''[[TUFLOW_Viewer_-_Map_Outputs_-_Curtain_Plot | Map Output Plot - 3D Curtain Plot]]'''</u> --> Plotting Map Output results.
 +
<li> <u>'''[[TUFLOW_Viewer_-_Map_Outputs_-_Vertical_Profile | Map Output Plot - 3D Vertical Profile]]'''</u> --> Plotting Map Output results --> Plotting Map Output results.
 +
<li> <u>'''[[TUFLOW_Viewer_-_Map_Outputs_-_3D_to_2D_Depth_Averaged_Time_Series | Map Output Plot - Plotting 3D to 2D Depth Averaged Time Series]]'''</u> --> Plotting Map Output results.
 +
<li> <u>'''[[TUFLOW_Viewer_-_Map_Outputs_-_3D_to_2D_Depth_Averaged_Cross-Sections | Map Output Plot - Plotting 3D to 2D Depth Averaged Cross-Sections]]'''</u> --> Plotting Map Output results.
 +
<li> <u>'''[[TUFLOW_Viewer_-_Map_Outputs_-_Plotting_From_Vector_Layer | Map Output Plot - Plotting From Vector a Layer (e.g. shp file)]]'''</u> --> Plotting Map Output results.
 +
 
 
</ol>
 
</ol>
 
<br>
 
<br>
Line 113: Line 130:
 
<br>
 
<br>
  
=Time Series Outputs=
+
===Time Series Output===
Time series outputs are typically 1D result outputs from TUFLOW but can also include 2D time series results (plot outputs or reporting locations) if any exist. Time series results consist of a GIS layer that the user can interact with to plot the results in TUFLOW Viewer, and of course the results themselves.
+
Time series outputs are typically 1D result outputs or 2D time series results (plot outputs or reporting locations). Time series results consist of two elements, the result datasets and GIS layers that the user can interact with to customise the plot selection in TUFLOW Viewer.
 
<ol>
 
<ol>
<li> '''[[TUFLOW_Viewer_-_ESTRY_Time_Series_Outputs | ESTRY Time Series Results]]'''
+
<li> Load time series output results either via:
<li> '''[[TUFLOW_Viewer_-_ESTRY_Time_Series_Outputs_-_2013_TUFLOW_Release | ESTRY Time Series Results - 2013 TUFLOW Release]]'''
+
<ol>
<li> '''[[TUFLOW_Viewer_-_Flood_Modeller_Time_Series_Outputs_And_Cross-Sections | Flood Modeller Time Series Results And Cross-Sections]]'''
+
<li> <u>'''[[TUFLOW_Viewer_-_Load_Results | Load All Results]]'''</u>, or
 +
<li> <u>'''[[TUFLOW_Viewer_-_Load_Results_-_Time_Series | Load Results - Time Series]]'''</u> for TUFLOW models, or:
 +
<li> <u>'''[[TUFLOW_Viewer_-_Load_Results_-_Time_Series_FM | Load Results - Time Series Flood Modeller]]'''</u> for TUFLOW linked Flood Modeller 1D models.
 
</ol>
 
</ol>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Time_Series_Outputs_GIS_Data | Time Series Output - GIS Data]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Time_Series_Outputs_-_Plotting_Time_Series | Time Series Output - Plotting Time Series]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Time_Series_Outputs_-_Plotting_Longitudinal_Profiles | Time Series Output - Plotting Longitudinal Profiles]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Showing_Selected_Elements_And_Selecting_Sub-Sets | Identifying Selected Elements and Selecting Sub-Sets]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Time_Series_Outputs_-_Plotting_1D_Cross-Section_Inputs | Plotting 1D Cross-Section Inputs (with / without results)]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Time_Series_Outputs_-_Plotting_1D_Hydraulic_Table_Check_Files | Plotting 1D Hydraulic Table Check Files]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Extracting_Median_And_Mean_Time_Series | Extracting Median and Mean Time Series - Australian Rainfall and Runoff]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Plotting_1D_Flow_Regime | Plotting 1D Flow Regime]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Import_2D_BC_Tables | Plotting 2D Boundary Condition Tables]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Toggling_Between_Output_Timesteps | Lock/Unlock Output Time Steps from Different Result Datasets]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Isodate_(Date-Time)_Format | Working With Isodate (Date-Time) Format]]'''</u>
 +
</ol><br>
 +
[[File: TimeSeries_HeaderImg.PNG|650px]]<br>
 
<br>
 
<br>
  
=Plotting From Map Outputs=
+
===Particle Tracking Output===
==Time Series==
 
You can plot one or multiple temporal map output results as a time series.
 
 
<ol>
 
<ol>
<li> Choose which map outputs to plot --> click on the time series graph down arrow under '''Map Output Plotting''' >> Check on desired result types
+
<li> <u>'''[[TUFLOW_Viewer_-_Particle_Outputs | Particle Tracking Outputs]]'''</u>  
<li> Click off the menu
+
<li><u>'''[[TUFLOW_Viewer_-_Isodate_(Date-Time)_Format | Working With Isodate (Date-Time) Format]]'''</u>
<li> Click the time series graph again (not the down arrow)
+
<li> <u>'''[[TUFLOW_Viewer_-_Toggling_Between_Output_Timesteps | Lock/Unlock Output Time Steps from Different Result Datasets]]'''</u>
<li> Click somewhere on your results
 
 
</ol>
 
</ol>
<br>
+
[[File: Particles HeaderImg.PNG|650px]]<br>
[[File:MapOutputPlotting TS.gif]]<br>
+
 
<br>
+
==General Plot Display Options==
== 2D Cross Sections and Long Sections==
 
You can plot one or multiple map output results as a cross section for the current time step.
 
 
<ol>
 
<ol>
<li> Choose which map outputs to plot --> click on the cross-section graph down arrow under '''Map Output Plotting''' >> Check on desired result types
+
<li> <u>'''[[TUFLOW_Viewer_-_Summary_of_Plotting_Toolbar | Summary of Plotting Toolbar Options]]'''</u><br>
<li> Click off the menu
+
<li> <u>'''[[TUFLOW_Viewer_-_Using_A_Secondary_Axis | Using a Secondary Axis]]'''</u>
<li> Click the cross-section graph again (not the down arrow)
+
<li> <u>'''[[TUFLOW_Viewer_-_Using_A_Date_Axis | Using a Date Axis]]'''</u>
<li> Left click somewhere on your results to start the cross-section
+
<li> <u>'''[[TUFLOW_Viewer_-_Showing_The_Current_Time | Displaying the Current Time]]'''</u>
<li> Left click to add vertices to your cross-section polyline
+
<li> <u>'''[[TUFLOW_Viewer_-_Customising_The_Plot_Legend | Customising The Legend]]'''</u>
<li> Right click to finish
+
<li> <u>'''[[TUFLOW_Viewer_-_Customising_The_Plotting_Styles | Customising The Plotting Styles]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Customising_The_Plot_Axes | Customising The Plot Axes]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Toggling_Plot_Grid_Lines | Plot Grid Line Display]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Importing_a_Custom_Colour_Ramp_For_The_Curtain_Plot | Importing a Custom Colour Ramp For The Curtain Plot]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Navigating_And_Querying_The_Plot | Navigating And Querying The Plot]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Auto_Update_Plot_From_Cursor_Location | Auto Update Plot From Cursor Location]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Viewing_The_Vertical_Mesh | 3D Mesh Vertical Layer Display]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Hiding_The_Plotting_Window | Hiding the Plot Window]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Customising_The_Plot_Background_Colour | Customising the Plot Background Colour]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Setting_The_Plot_Default_Font_Size | Setting the Default Font Size For the Plot]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Toggling_Between_Output_Timesteps | Lock/Unlock Output Time Steps from Different Result Datasets]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Changing_Icon_Size | Changing the Icon Size]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Summary_Of_Options | Settings Options]]'''</u>
 
</ol>
 
</ol>
<br>
 
[[File:MapOutputPlotting CS.gif]]<br>
 
  
Follow the steps above in the direction of flow to plot long sections.
+
[[File: Plotting_HeaderImg.PNG | 650px ]]<br>
 
<br>
 
<br>
  
==Plotting Flow==
+
==Exporting Data, Plots, Maps and Animations==
You can post calculate flow from the map output results. Note that this approach should be used for approximation only. The preferred method is to use a PO line in TUFLOW.
+
TUFLOW Viewer offers the ability to export data interegation points/lines, maps, plots and animations:<br>
<ol>
+
<ol>  
<li> Click on the '''Plot Flux''' button down arrow under '''Map Output Plotting'''
+
<li> <u>'''[[TUFLOW_Viewer_-_Exporting_An_Animation | Exporting An Animation]]'''</u><br>
<li> Left click somewhere on your results to start the flux line
+
: [[File: Animation_cover.gif]]<br>
<li> Left click to add vertices to your flux line
+
<li> <u>'''[[TUFLOW_Viewer_-_Exporting_And_Copying_A_Plot | Exporting and Copying a Plot]]'''</u>
<li> Right click to finish
+
<li> <u>'''[[TUFLOW_Viewer_-_Exporting_The_Drawn_GIS_Plot_Features | Exporting The Drawn GIS Plot Points / Lines]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Batch_Exporting_Maps | Batch Exporting Maps]]'''</u>
 +
<li> <u>'''[[TUFLOW_Viewer_-_Batch_Exporting_Plots | Batch Exporting Plots]]'''</u>
 
</ol>
 
</ol>
The direction convention is the same as PO lines in TUFLOW - the positive direction of flow is from left bank to right bank looking downstream
+
: [[File: Maps_Cover_Image.PNG | 550px]]<br><br>
<br>
+
 
[[File:MapOutputPlotting Q.gif]]<br>
+
= Python Error Troubleshooting =
<br>
+
Occasionally the TUFLOW plugin will throw an exception and this will produce a '''Python Error''' which is displayed either as a yellow banner at the top of the map window or a window may appear stating than an 'Error has occurred while executing Python code'.<br>
 +
[[File: PythonError.PNG]]<br>
 +
When this occurs it means that the TUFLOW plugin has encountered something unusual or a situation that it does not know how to handle (i.e. it has reached a line in the code that has failed to execute and as a consequence Python has bailed out). This means all the code below this point that was meant to execute has not. This can have knock-on consequences as variables may not exist or be set to incorrect values and signal handling (e.g. what happens when a menu item is clicked) may be broken. As such, a python error can lead to further python errors that would normally not have occurred. Because of this flow-on effect the first python error is usually the most important.<br><br>
  
==Plotting Long Section From Shape File==
+
If you encounter a python error please:
It's possible to plot time series, flow, cross sections, and long plots using an existing shape file (or other vector formats supported by QGIS). Example below using a shape file to plot a long section:
 
 
<ol>
 
<ol>
<li> Select polyline used for plotting (time series will use point object)
+
<li> Email the '''Stack Trace''' to <u>[mailto:support@tuflow.com support@tuflow.com]</u> with a description of the steps that produced the python error (as best you can describe it). This is to help us identify bugs and fix the plugin so that it catches this exception in the future.
<li> Choose '''Layer Selection''' under '''Map Output Plotting'''
+
<li> If you find that you are now experiencing further python errors (probably caused by the initial error) you can try the following alternative in order of severity (least to worst):
<li> Choose which map outputs to plot --> click on the cross-section graph down arrow under '''Map Output Plotting''' >> Check on desired result types
 
<li> Click the cross-section graph again (not the down arrow)
 
</ol>
 
<br>
 
[[File:2D long plot from selection.gif]]<br>
 
<br>
 
 
 
=Plotting From Time Series Outputs=
 
If time series results are loaded in (e.g. 1D results) you can plot from the outputted types.
 
 
<ol>
 
<ol>
<li> Select result type e.g '''Flow''' under the ''Time Series'' section in the '''Result Types'''
+
<li> On the TUFLOW Viewer menu bar '''File >> Reload TUFLOW Viewer''' - this will reload TUFLOW Viewer, resetting all variables and signals. You will be required to load in any time series results again and other settings may also be reset. Map output results will remain in the workspace and be reloaded into TUFLOW Viewer.
<li> Use QGIS ''Select Tool'' and select one of the '''PLOT''' GIS features
+
<li> Save the QGIS workspace (.qgz) and restart QGIS.
 +
<li> Restart QGIS - you can save the workspace (.qgz), however you should first select on the TUFLOW Viewer menu bar '''File >> Close TUFLOW Viewer Completely''' - this will close the Viewer and also remove all settings associated with it from the workspace so that the problematic variable is not accidentally reloaded with the workspace.
 +
<li> The last resort option is to restart QGIS and load and create a new workspace from scratch (do not load a saved workspace).
 
</ol>
 
</ol>
<br>
 
[[File:TimeSeriesPlotting Q.gif]]<br>
 
<br>
 
 
=Plotting 1D Long Sections=
 
If time series results are loaded in (e.g. 1D results) you can plot long sections from the results. Example below plotting a long section from stormwater pipes:
 
<ol>
 
<li> Select single channel (pipe) from the '''PLOT_L''' GIS layer
 
<li> Select a long section result type e.g '''Water Level''' and/or '''Culverts and Pipes''' (Long section result types have the icon with a light blue line)
 
<li> Selecting a second channel downstream of the first will plot the long section between the selected channels (if no second channel is selected, the long section will plot until the outlet)
 
 
</ol>
 
</ol>
 
<br>
 
<br>
[[File:1D long plot from selection.gif]]<br>
+
{{Tips Navigation
<br>
+
|uplink=[[TUFLOW_QGIS_Plugin#Usage| Back to TUFLOW QGIS Plugin Main Page]]
 
+
}}
=Using a Secondary Axis=
 
If you are plotting multiple result types at once, you may want to plot one or more of the lines on a secondary axis. This can be done 2 ways:<br>
 
'''Option 1'''
 
: Click the ''Secondary Axis'' icon on the appropriate result type in the '''Result Types Panel'''<br>
 
'''Option 2'''
 
: '''Right Click''' on the appropriate result type in the '''Result Types Panel''' and check on '''Secondary Axis'''<br>
 
<br>
 
[[File:ToggleSecondaryAxis.gif]]<br>
 
<Br>
 
 
 
=Changing Plot Properties=
 
Plot properties can be changed via<br>
 
'''Option 1'''
 
: TUFLOW Viewer '''Settings >> Customise'''<br>
 
'''Option 2'''
 
: '''Customise''' tool icon in the plot toolbar<br>
 
<br>
 
Using this, properties such as the plot axis, item name in legend, and line / point styling can be modified. The styling is saved in the session and will be used the next time the same plot type (e.g. depth time series) is plotted.<br>
 
<br>
 
===Changing the default colours===
 
The default colours are randomly generated when TUFLOW Viewer is opened and can be re-generated by selecting '''Settings >> Reset Plotting Colours'''. This will also reset any custom line properties the user may have set.<br>
 
<br>
 
===Changing the axis limits and names===
 
The same process can be used to set the axis limits and axis names. The axis names will be saved in the session and can be reset to default by selecting '''Settings >> Reset Plot Axis Names'''. Changing the axis limits will cause the plot axis to become frozen (depending on which axis limits was changed). The axis limits can be unfrozen by unchecking the relevant axis icon in the plot toolbar.<br>
 
[[File:axis_limits_frozen.png]]<br>
 
<br>
 
[[File:PlotProperties 1.gif]]<br>
 
<br>
 
[[File:PlotProperties 2.gif]]<br>
 
 
<br>
 
<br>
[[File:PlotProperties 3.gif]]<br>
 
 
<br>
 
<br>
[[File:PlotProperties 4.gif]]<br>
 
 
<br>
 
<br>
 +
{{Tips Navigation
 +
|uplink=[[Main_Page| Back to Wiki Main Page]]
 +
}}

Revision as of 10:25, 5 April 2024

TUFLOW Viewer replaces Crayfish and TUPLOT as the TUFLOW result viewer for QGIS (version 3.6 onwards). It uses the Mesh Data Abstraction Library (MDAL) available in QGIS to display and interact with TUFLOW map output results, and the TUFLOW results python library (the same library used by TUPLOT in earlier versions of QGIS) for viewing TUFLOW time series results.


Getting Started

QGIS Version

A few notes on the recommended QGIS version:

It is recommended to use the latest version of QGIS. The reasons for this are:

  • TUFLOW Viewer is developed using the latest version, and although backwards compatibility is maintained as best as possible, TUFLOW Viewer is tested more frequently on the latest QGIS version.
  • The mesh data provider (MDAL) and the temporal controller (which now underpins the mesh datasets in QGIS) are both relatively new in comparison to other libraries (e.g. GDAL) and are therefore more regularly updated with new features, enhancements, and bug fixes by the QGIS developers. TUFLOW Viewer takes advantage of these updates.

Although TUFLOW Viewer has been developed to be consistent across QGIS versions, it is not always possible. Some QGIS developments and behaviour changes have led to TUFLOW Viewer behaviour also changing either through necessity or to keep in-line with the QGIS development direction. The below is a current list of known behaviour changes due to QGIS version:

  1. Date-time format within TUFLOW Viewer - QGIS 3.14 introduced the temporal controller
    • Prior to QGIS 3.14, TUFLOW Viewer stored all results internally as relative time. The user could display as date-time and the reference time by changing Zero Date in Settings >> Options.
    • QGIS 3.14, TUFLOW Viewer tried to mimic the behaviour of previous versions but the reference time could also be altered natively in the mesh layer Properties. Note on this version, this is the first QGIS release with the temporal controller and as a consequence some of the functionality matured and changed in subsequent versions. Users may experience strange behaviour when using TUFLOW Viewer with the QGIS 3.14 if using date-time format. It is recommended to upgrade to later versions of QGIS if date-time format is required.
    • Post QGIS 3.14 TUFLOW Viewer stores all results internally as absolute time and the user must change the reference time in the native properties of the mesh layer to alter the dates being displayed. Zero Date now only changes how the relative time is displayed in TUFLOW Viewer and doesn't change the mesh layer reference time.
    • Please follow the link below on how to use isodate (date-time) format in TUFLOW Viewer in QGIS 3.16+ (recommended minimum version if using date-time format): Working With Isodate (Date-Time) format.


Other Known Issues

  • QGIS 3.24 uses Matplotlib v3.5.1 which contains the following known bug which may affect users when re-labelling datasets within the TUFLOW Viewer plot window:
TUFLOW Viewer - Matplotlib v3.5.1 bug
  • "ValueError: Failed to find font DejaVu Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=10.0, and fallback to the default font was disabled"
TUFLOW Viewer - Matplotlib Font Error

Installation or Version Upgrade

Installation

TUFLOW Viewer is a free tool that comes as part of the TUFLOW plugin in QGIS. For instructions on how to install the plugin, please follow these steps: Installation of Plugin.
There are also instructions on installing plugins in the QGIS documentation - if you choose to follow the QGIS documentation, the plugin is called "TUFLOW" in the repository: Link to QGIS Documentation - Installing and Managing Plugins.

Plugin Upgrades

It's recommended to upgrade the plugin whenever a new version is released. The upgrade process is typically done via the Plugin Manager (QGIS Drop Menu: Plugins >> Manage and Install Plugins).
TUFLOW Plugin Update.JPG

If you encounter an error while upgrading the plugin please follow these steps: Error While Upgrading Plugin .

Development Version

It's possible to test out the latest development version of the plugin and TUFLOW Viewer by following the instructions below:
Installing the Latest Development Version of the TUFLOW Plugin

Using TUFLOW Viewer

Opening the TUFLOW Viewer

After installing the QGIS TUFLOW plugin, the TUFLOW Viewer tool can be opened by clicking the following icon in the plugin toolbar:
TUFLOW Viewer In Toolbar.PNG.

Loading Results

TUFLOW simulation results can be loaded several ways:

  1. Select File >> Load Results from the TUFLOW Viewer drop down menu.
    TUFLOW Plugin Load 1.jpg
  2. Right Click in the Open Results panel and select Load Results.
    TUFLOW Plugin Load 2.jpg

Using either of the above methods, the following result load options are available:

  1. Load All Results --> This is done via a TCF, TLF, or FVC (TUFLOW FV) file and will load in all results (Map Outputs and ESTRY Time Series).
  2. Load Results - Map Outputs --> Select map output mesh results file (*.xmdf, *.dat, *.2dm, *.xmdf.sup, *.dat.sup, *.nc (supports netCDF format from TUFLOW FV output only)).
  3. Load Results - Time Series --> Select ESTRY / SWMM time series output results (*.tpc *.gpkg).
  4. Load Results - Flood Modeller Time Series --> Load Flood Modeller results. This requires a *.gxy and result *.csv file to be exported from Flood Modeller.
  5. Load Results - Particle Tracking Module --> Select output from particle module (*.nc) which will typically be suffixed with _ptm.
  6. Load Results - NetCDF Grid --> Load TUFLOW NC or HRNC map output results.
  7. Import 1D Hydraulic Tables --> Select a _1d_ta_tables_check.csv check file.
  8. Import 2D BC Tables --> Select a _2d_bc_tables_check.csv check file.
  9. Import 1D ESTRY Cross-Sections --> This will automatically happen if an appropriate TUFLOW input is opened in QGIS while TUFLOW Viewer is open (e.g. 1d_xs).
  10. Importing a User Defined Time Series Dataset To Display In The Plot Window
  11. Loading Results While TUFLOW is Running

Troubleshooting
If you receive an error similar to that shown below when attempting to load results from a TCF you will need to fix the encoding of your TUFLOW control files:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 626: invalid start byte

This error is caused by incompatible encoding of the TUFLOW control files. You can resolve this issue by changing the encoding of all your TUFLOW control files to a single type (typically UTF-8). You can do this using Notepad++. Please see the following link for instructions on how to do this (refer last image): TUFLOW Message 0060.

TUFLOW-SWMM Results

Results from a linked TUFLOW-SWMM model can be loaded via the standard menu options (available from the TUFLOW plugin version 3.10):

  • Load Results - Time Series to load the GPKG time series format (_swmm_ts.gpkg) by itself. The GPKG time series format is a new format similar to the .tpc with some additional functionality. More information can be found in the GPKG Time Series Format section.
  • Load Results - Map Outputs to load in 2D map output results
  • Load Results to load all available results from the model. This includes .xmdf, .tpc, and .gpkg results which could all be available for a given model run. Note that .tpc and .gpkg are both time series type results and will load separate GIS _PLOT_ layers.

GPKG Time Series Format

The GPKG time series format is a new format similar to the .tpc with enhanced temporal functionality. Currently the GPKG time series format is only supported as an output from SWMM in TUFLOW-SWMM linked models and only supported in TUFLOW Plugin version 3.10+ and QGIS 3.16+.

The GPKG format is different from the TPC format as it supports temporal styling in QGIS. As an example, the line width of the channels can be varied by both time and flow, with wider lines showing higher flow than thinner lines at a particular timestep. The format is fully compatible with the QGIS temporal controller and reacts dynamically as the temporal controller is updated. This results in a dynamic, and intuitive, method of showing the user the flood progression in the 1D system. Another benefit of being compatible with the core QGIS temporal capabilities is that the styling will also be dynamically updated if included in an animation export. TUFLOW Viewer's animation export tool has been updated to enable GPKG results to be exported with 2D results or even by itself.

The layer's styling can be automatically set using the TUFLOW Plugin via the layer's right-click context menu (under the TUFLOW submenu) or will automatically by styled if the results are loaded via TUFLOW Viewer. Examples of this format in QGIS are linked below:

The GPKG time series format is an open format and the specification is detailed at the below link:

Data Selection, Display and Styling

Map Output

Map Outputs are the time varying 2D result outputs from TUFLOW (or 3D outputs from TUFLOW FV). Data selection, display, styling and plotting instructions for Map Output results in TUFLOW Viewer are described below:

  1. Load Map Output results either via:
    1. Load All Results, or
    2. Load Results - Map Outputs
  2. Reload Results --> Reload and update results
  3. Change Simulation Result Selection --> Changing between different simulation results is done by selecting the result name(s) in the 'Open Results' widget.
  4. Change Result Type Selection --> Changing between different result types is done using the 'Result Type' widget.
  5. Display Result Maximum --> If available, maximums can be toggled on/off for the different result types.
  6. Display Vectors --> Vector results can be displayed in combination with any of the scalar result types (e.g. velocity vectors can be displayed with depth).
  7. Style Scalar Map Outputs --> Styling scalar map output results is similar to styling raster layers in QGIS.
  8. Style Vector Map Outputs --> Similar to the styling the scalar map outputs, there are a range of options for styling the vector layers.
  9. Save Default Styles --> Users can save default styles for result types so they are automatically applied each time results are imported using TUFLOW Viewer.
  10. Display The Mesh --> The quickest way to toggle the mesh is to click the grid box in TUFLOW Viewer.
  11. 3D to 2D Depth Averaging --> For 3D map output results, the 3D to 2D depth averaging method can be changed in the layer properties.
  12. Lock/Unlock Output Time Steps from Different Result Datasets --> Locking Plot Output Timesteps to the Map Output Interval.
  13. Working With Isodate (Date-Time) Format --> View results using absolute time format (dd/mm/yyyy hh:mm:ss) instead of relative time format (hh:mm:ss).
  14. Map Output Plot - Plotting Time Series --> Plotting Map Output results.
  15. Map Output Plot - Plotting Cross-Sections and Longitudinal Profiles --> Plotting Map Output results.
  16. Map Output Plot - Plotting Flow --> Plotting Map Output results.
  17. Map Output Plot - 3D Curtain Plot --> Plotting Map Output results.
  18. Map Output Plot - 3D Vertical Profile --> Plotting Map Output results --> Plotting Map Output results.
  19. Map Output Plot - Plotting 3D to 2D Depth Averaged Time Series --> Plotting Map Output results.
  20. Map Output Plot - Plotting 3D to 2D Depth Averaged Cross-Sections --> Plotting Map Output results.
  21. Map Output Plot - Plotting From Vector a Layer (e.g. shp file) --> Plotting Map Output results.


MapOutputs HeaderImg.PNG

Time Series Output

Time series outputs are typically 1D result outputs or 2D time series results (plot outputs or reporting locations). Time series results consist of two elements, the result datasets and GIS layers that the user can interact with to customise the plot selection in TUFLOW Viewer.

  1. Load time series output results either via:
    1. Load All Results, or
    2. Load Results - Time Series for TUFLOW models, or:
    3. Load Results - Time Series Flood Modeller for TUFLOW linked Flood Modeller 1D models.
  2. Time Series Output - GIS Data
  3. Time Series Output - Plotting Time Series
  4. Time Series Output - Plotting Longitudinal Profiles
  5. Identifying Selected Elements and Selecting Sub-Sets
  6. Plotting 1D Cross-Section Inputs (with / without results)
  7. Plotting 1D Hydraulic Table Check Files
  8. Extracting Median and Mean Time Series - Australian Rainfall and Runoff
  9. Plotting 1D Flow Regime
  10. Plotting 2D Boundary Condition Tables
  11. Lock/Unlock Output Time Steps from Different Result Datasets
  12. Working With Isodate (Date-Time) Format


TimeSeries HeaderImg.PNG

Particle Tracking Output

  1. Particle Tracking Outputs
  2. Working With Isodate (Date-Time) Format
  3. Lock/Unlock Output Time Steps from Different Result Datasets

Particles HeaderImg.PNG

General Plot Display Options

  1. Summary of Plotting Toolbar Options
  2. Using a Secondary Axis
  3. Using a Date Axis
  4. Displaying the Current Time
  5. Customising The Legend
  6. Customising The Plotting Styles
  7. Customising The Plot Axes
  8. Plot Grid Line Display
  9. Importing a Custom Colour Ramp For The Curtain Plot
  10. Navigating And Querying The Plot
  11. Auto Update Plot From Cursor Location
  12. 3D Mesh Vertical Layer Display
  13. Hiding the Plot Window
  14. Customising the Plot Background Colour
  15. Setting the Default Font Size For the Plot
  16. Lock/Unlock Output Time Steps from Different Result Datasets
  17. Changing the Icon Size
  18. Settings Options

Plotting HeaderImg.PNG

Exporting Data, Plots, Maps and Animations

TUFLOW Viewer offers the ability to export data interegation points/lines, maps, plots and animations:

  1. Exporting An Animation
    Animation cover.gif
  2. Exporting and Copying a Plot
  3. Exporting The Drawn GIS Plot Points / Lines
  4. Batch Exporting Maps
  5. Batch Exporting Plots
Maps Cover Image.PNG

Python Error Troubleshooting

Occasionally the TUFLOW plugin will throw an exception and this will produce a Python Error which is displayed either as a yellow banner at the top of the map window or a window may appear stating than an 'Error has occurred while executing Python code'.
PythonError.PNG
When this occurs it means that the TUFLOW plugin has encountered something unusual or a situation that it does not know how to handle (i.e. it has reached a line in the code that has failed to execute and as a consequence Python has bailed out). This means all the code below this point that was meant to execute has not. This can have knock-on consequences as variables may not exist or be set to incorrect values and signal handling (e.g. what happens when a menu item is clicked) may be broken. As such, a python error can lead to further python errors that would normally not have occurred. Because of this flow-on effect the first python error is usually the most important.

If you encounter a python error please:

  1. Email the Stack Trace to support@tuflow.com with a description of the steps that produced the python error (as best you can describe it). This is to help us identify bugs and fix the plugin so that it catches this exception in the future.
  2. If you find that you are now experiencing further python errors (probably caused by the initial error) you can try the following alternative in order of severity (least to worst):
    1. On the TUFLOW Viewer menu bar File >> Reload TUFLOW Viewer - this will reload TUFLOW Viewer, resetting all variables and signals. You will be required to load in any time series results again and other settings may also be reset. Map output results will remain in the workspace and be reloaded into TUFLOW Viewer.
    2. Save the QGIS workspace (.qgz) and restart QGIS.
    3. Restart QGIS - you can save the workspace (.qgz), however you should first select on the TUFLOW Viewer menu bar File >> Close TUFLOW Viewer Completely - this will close the Viewer and also remove all settings associated with it from the workspace so that the problematic variable is not accidentally reloaded with the workspace.
    4. The last resort option is to restart QGIS and load and create a new workspace from scratch (do not load a saved workspace).


Up
Go-up.png Back to TUFLOW QGIS Plugin Main Page




Up
Go-up.png Back to Wiki Main Page