SWAN GIS Post Processing

From TUFLOW FV Wiki
Jump to navigation Jump to search
USEFUL LINKS
Wiki Links Help Downloads
TUFLOW FV Wiki Main Page Products Support/Contact TUFLOW FV Downloads
TUFLOW FV Tutorials Requesting a Licence Tutorial Module Data
TUFLOW Classic/HPC Wiki TUFLOW FV Glossary Manuals

Introduction

This page describes how to use the post processing tools in the SWAN GIS plugin. The plugin offers an interface for basic post processing of SWAN model results. With the standard SWAN distribution, grid files can be output as either MAT or text files. The interface offers a tool for processing the MAT file output format to a more user friendly netCDF4 output format. It also offers a tool for extracting point time series files from a netCDF4 output file.

Converting SWAN MAT Outputs to NetCDF4

Start QGIS (version 3.16.3 or later). Under the plugins menu, navigate to the plugins/TUFLOW/SWAN GIS Tools/Post Processing tab:

SWAN POST PROCESSING 000b.PNG
Select your SWAN MAT result file path (if using the suggested paths it should be Moreton_Bay_Waves\SWAN\04_results) and simply press the 'Convert' button:

SWAN POST PROCESSING 001.PNG

Note: The tutorial module uses non-rotated model domains in a spherical coordinate system and therefore the 'MAT is Rotated?' and 'MAT is Non-Spherical?' toggle buttons are left unticked. If processing your own non-tutorial model results please select the 'MAT is Rotated?' and/or 'MAT is Non-Spherical?' toggle boxes if your model domain is rotated or uses cartesian coordinates.

By default the output NetCDF will be saved where the original MAT result file was output by SWAN. The SWAN GIS plugin automatically post processes the NetCDF4 file to the same location and uses the same name, just replacing the file extension. For example:

SWAN POST PROCESSING 002rev1.png

Following conversion to NetCDF we can review our SWAN results by opening them in the TUFLOW Viewer for QGIS.

To open the TUFLOW Viewer click the icon in the plugin toolbar.

TUFLOW Viewer In Toolbar.png


To load the SWAN simulation results select File >> Load Results - Map Outputs from the TUFLOW Viewer drop down menu.

TUFLOW Viewer Load Results.png


Navigate to the ../SWAN/04_results/ folder and select the REGIONAL_20180901_20181001.nc file.


Open REGIONAL results.png


Your QGIS window will now appear similar to that shown below:


View REGIONAL results.png


Within the TUFLOW Viewer window click on the small down arrow on the Plot Time Series From Map Output icon Plot Time Series From Map Output icon.png.

Select the significant wave height checkbox.


Time series select Hs.png


Click again on the Plot Time Series From Map Output icon but this time to the left of the down arrow Plot Time Series From Map Output icon.png, and use the cursor to select on the map output the desired location for plotting.


Time series select location.png


The TUFLOW Viewer window should now display a time series of significant wave height at the chosen location, similar to that shown in the example below:


Time series Hs example.png

Extracting a Time Series from a SWAN NetCDF File

Please note this section is optional if completing Tutorial Module 08.

As an optional extension item, to investigate wave conditions at different locations in our model we can extract a timeseries from our SWAN output results.

  1. input the SWAN NetCDF4 result file noting that if you have MAT files you will need to use the converter first.
    SWAN POST PROCESSING 003.PNG

  2. Input the output file path for the CSV file time series.
    SWAN POST PROCESSING 004.PNG

  3. Create a new CSV file in C:\Tutorial_Module_SWAN_GIS_Tools\Moreton_Bay_Waves\QGIS called POINTS_XTR_000.csv.
    SWAN POST PROCESSING 005.PNG

  4. Open the CSV file in a text editor and add the below entries as shown. These are the points where time series will be extracted.
    Name X Y
    POINT_01 153.637 -27.477
    POINT_02 153.283 -26.877

    SWAN POST PROCESSING 006.PNG

  5. Set the points file input to the newly created CSV file.
    SWAN POST PROCESSING 007.PNG

  6. Press the 'Extract' button to execute the time series extraction. Once complete, navigate to the output path. Separate files would have been output for each input point.
    SWAN POST PROCESSING 007.PNG


Extracting a Time Series from Gridded ERA5 Wind Data

Please note this section is optional if completing Tutorial Module 08.

Wind time series can be extracted from ERA5 using the ERA5 Time Series Extractor Tool. Extracting time series from ERA5 is analogous to extracting time series data using the SWAN Time Series Extractor.

Resultant wind time series are saved in the following format:
153.250000,-27.000000
TIME,U10,V10
01/09/2018 00:00:00,3.64,0.27
01/09/2018 01:00:00,3.06,0.04
01/09/2018 02:00:00,2.12,-0.39
...
...

Where the date and time format is dd/mm/yyyy HH:MM:SS and U10 and V10 vector components are output in cartesian convention. i.e. the direction to where the vector points, measured counter-clockwise from due East. For example <-1U, 0V> will be wind coming from the east and heading west.

If a spatially constant wind field is preferred over a gridded ERA5 dataset the csv output by the ERA5 Time Series Extractor Tool can be used as wind input to the SWAN GIS Model Builder.

Conclusion

You have now worked through the post-processing options available in the SWAN GIS Tools. You can now return back to the main tutorial page.