wiki:AnalysingResultQuestions

Version 10 (modified by rwilson, 16 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.

  1. 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.
  1. 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 ExportResults.py 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.