Version 19 (modified by ole, 14 years ago) (diff)



Analysing Results

How do I easily plot "tide gauge" timeseries graphs from a SWW file?

There are two ways to do this.

Create .csv files from the .sww file using {anuga.abstract_2d_finite_volumes.util sww2csv_gauges and then use anuga.abstract_2d_finite_volumes.util csv2timeseries_graphs to create the plots. This code is newer, has unit tests and might be easier to use. Read doc strings for more information and review the "Exploring the Model Output" section of the User Manual.
Use anuga.abstract_2d_finite_volumes.util sww2timeseries to do the whole thing, however this doesn't have a much control on the file name and plots. Plus there are no unit tests yet.

Read the doc string for more information.

How do I extract elevation and other quantities from a SWW file?

The function sww2dem can extract any quantity, or expression using quantities, from a SWW file as used in the Cairns example described earlier. This function is used in in the Cairns demo folder where stage, absolute momentum, depth, speed and elevation can be exported from the input .sww file. Note that depth, absolute momentum and speed are expressions and stage and elevation are quantities. In addition to extracting a particular quantity or expression, the user can define a region to extract these values by defining the minimum and maximum of both the easting and northing coordinates. The function also calls for a grid resolution, or cell size, to extract these values at. It is recommended to align this resolution with the mesh resolution in the desired region and to not generate a fine grid where the model output cannot support that resolution.

The viewer can't open the sww files anymore

Since July 2009, ANUGA has moved towards a new NetCDF library that, amongst other things, allows larger output files and removes reliance on the old no longer supported Numeric package. A new viewer is on its way, but meanwhile it is possible to convert the sww files to the old format by following the instructions provided below:

This link to the NetCDF FAQ explains how to convert a 'classic' NetCDF file to 'large' model is at The command to see what type of NetCDF format a file is:

ncdump -k [filename]

This is documented at:

There is a new directory in the ANUGA repository misc/tools/n2o that has a converion program based on the above.

Does the sww file viewer (animate) work under Linux

Unfortunately, the viewer that comes with ANUGA (animate.exe) has only been compiled for Windows. However, the source code is Open Source and the library it is using, Open Scene Graph, is also Open Source and known to work under Linux. The source code for the viewer is available at and the ANUGA team would be delighted if someone were to volunteer compiling it under Linux and providing the details to the ANUGA community. Please contact Ole.Nielsen@… if you are interested.