Difference between revisions of "TUFLOW Viewer"

From Tuflow
Jump to navigation Jump to search
Line 15: Line 15:
 
<ol>
 
<ol>
 
<li> '''Date-time format within TUFLOW Viewer''' - QGIS 3.14 introduced the '''temporal controller'''<br>
 
<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 and the user could display as date-time by changing '''zero time''' in '''Settings >> Options'''
+
* prior to QGIS 3.14, TUFLOW Viewer stored all results internally as relative time and the user could display as date-time and the reference time by changing '''zero time''' in '''Settings >> Options'''
 
* QGIS 3.14, TUFLOW Viewer tried to mimmick 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 and behaviour wasn't fully fleshed out yet. Users may experience strange behaviour when using TUFLOW Viewer with the version if using date-time format. It is recommended to upgrade to later versions of QGIS if date-time format is required.
 
* QGIS 3.14, TUFLOW Viewer tried to mimmick 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 and behaviour wasn't fully fleshed out yet. Users may experience strange behaviour when using TUFLOW Viewer with the version 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. Zero time now only changes how the relative time is displayed in TUFLOW Viewer and doesn't change the mesh layer reference time.
+
* 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 time now only changes how the relative time is displayed in TUFLOW Viewer and doesn't change the mesh layer reference time.
 
</ol><br><br>
 
</ol><br><br>
  

Revision as of 01:08, 21 April 2021

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.



Getting Started

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, read the following wiki page:

How to install the TUFLOW 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

QGIS Version

A note on QGIS version:
Although TUFLOW Viewer has been developed in an attempt to have consistent behaviour across QGIS versions, it is not always possible and / or QGIS developments and behaviour changes have lead 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 and the user could display as date-time and the reference time by changing zero time in Settings >> Options
    • QGIS 3.14, TUFLOW Viewer tried to mimmick 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 and behaviour wasn't fully fleshed out yet. Users may experience strange behaviour when using TUFLOW Viewer with the version 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 time now only changes how the relative time is displayed in TUFLOW Viewer and doesn't change the mesh layer reference time.



Opening TUFLOW Viewer

Once the TUFLOW plugin is installed, the TUFLOW Viewer tool can be opened by clicking the following icon in the plugin toolbar:
TUFLOW Viewer In Toolbar.PNG

Upgrading The Plugin

It's recommended to upgrade the plugin whenever a new version is released. The upgrade process is typically done via the Plugin Manager.

Error While Upgrading the Plugin

Error_While_Upgrading_Plugin

Getting a Python Error

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

What Does This Mean?

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.

What To Do

  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 in order of severity:
    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 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 nuclear option - Restart QGIS and load a new workspace from scratch (do not load a saved workspace)



Loading Results

Results can be loaded several ways:

Option 1

File >> Load Results

Option 2

Right Click in Open Results >> Load Results


The following options are available for loading into TUFLOW Viewer:

  1. 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)
  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 time series output results (*.tpc)
  4. Load Results - Time Series FM --> Load Flood Modeller results. This requires a .gxy and result .csv file to be exported from Flood Modeller.
  5. Load Results - Particles --> Select output from particle module (*.nc) which will typically be suffixed with _ptm
  6. Import 1D Hydraulic Tables --> Select a _1d_ta_tables_check.csv check file
  7. 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)


File:LoadResults Eg img.PNG

If I Receive an Error?
If you receive an error similar to that below when trying to load results from a TCF:

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

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).
TUFLOW_Message_0060

Map Outputs

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:

  1. Change Results --> changing between different simulation results is done by selecting the result name(s) in the 'Open Results' widget
  2. Change Result Type --> changing between different result types is done using the 'Result Type' widget
  3. Display Maximum --> if available, maximums can be toggled on/off for the different result types
  4. 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
  5. 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.
  6. Style Vector Map Outputs --> similar to the styling the scalar map outputs, there are a range of options for styling the vector layers.
  7. 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.
  8. Display The Mesh --> the quickest way to toggle the mesh is to click the grid box in TUFLOW Viewer.
  9. 3D to 2D Depth Averaging --> For 3D map output results, the 3D to 2D depth averaging method can be changed in the layer propertes.
  10. Locking Output Timesteps to Map Output Only


MapOutputs HeaderImg.PNG

Time Series Outputs

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.

  1. ESTRY Time Series Results
  2. ESTRY Time Series Results - 2013 TUFLOW Release
  3. Flood Modeller Time Series Results And Cross-Sections
  4. Viewing All Available Output Timesteps


TimeSeries HeaderImg.PNG

Particle Outputs

Outputs from the particles module can be loaded into TUFLOW Viewer and viewed along side hydrodynamic the results. The below lists the basic interaction with particle outputs:

  1. Particle Outputs
  2. Viewing All Available Output Timesteps


Particles HeaderImg.PNG

Plotting Results

TUFLOW Viewer supports numerous plotting options to help users interrogate results.

  1. Summary of Plotting Toolbar
  2. Map Output - Plotting Time Series
  3. Map Output - Plotting Cross-Sections and Longitudinal Profiles
  4. Map Output - Plotting Flow
  5. Map Output - Curtain Plot
  6. Map Output - Vertical Profile
  7. Map Output - Plotting 3D to 2D Depth Averaged Time Series
  8. Map Output - Plotting 3D to 2D Depth Averaged Cross-Sections
  9. Map Output - Plotting Multiple Locations
  10. Map Output - Plotting From Vector a Layer (e.g. shp file)
  11. Time Series Output - Plotting Time Series
  12. Time Series Output - Plotting Longitudinal Profiles
  13. Showing Selected Elements and Selecting Sub-Sets
  14. Plotting 1D Cross-Section Inputs (with / without results)
  15. Plotting 1D Hydraulic Table Check Files
  16. Importing a User Defined Time Series To Display On The Plot
  17. Using a Secondary Axis
  18. Using a Date Axis
  19. Showing the Current Time
  20. Plotting 1D Flow Regime
  21. Exporting and Copying A Plot
  22. Exporting The Drawn GIS Plot Points / Lines
  23. Customising The Legend
  24. Customising The Plotting Styles
  25. Customising The Plot Axes
  26. Toggling Plot Grid Lines
  27. Importing a Custom Colour Ramp For The Curtain Plot
  28. Navigating And Querying The Plot
  29. Batch Exporting Plots
  30. Extracting Median and Mean Time Series - Australian Rainfall and Runoff
  31. Auto Update Plot From Cursor Location
  32. Viewing the Vertical Mesh


Plotting HeaderImg.PNG

Working With Absolute Time (Date-Time)

Coming soon

Customising Dock Appearance

  1. Displaying Time in Absolute Date-Time Format
  2. Hiding the Plotting Window
  3. Customising the Plot Background Colour
  4. Toggling Output Timesteps


650px

Summary of Options

Coming soon

Creating an Animation

Coming soon

Batch Exporting Maps

Coming soon