source: DVD_images/extra_files/GoldCoast/analysis.html @ 7301

Last change on this file since 7301 was 7301, checked in by rwilson, 15 years ago
File size: 6.9 KB
4  <title>Geoscience Australia</title>
5  <link rel="stylesheet" href="browser_files/style.css">
6  <link REL="SHORTCUT ICON" HREF="browser_files/favicon.ico">
9  <table cellspacing="10" border="0">
10    <tr>
11      <td>
12        <img src="browser_files/logo.jpg" alt="Australian Government, Geoscience Australia" width="327" height="80" border="0"/>
13      </td>
14      <td width="50">
15        &nbsp;
16      </td>
17      <td>
18        <H1>Tsunami Inundation Models for the GOLD COAST region</H1>
19      </td>
20    </tr>
21  </table>
22  <hr>
24  <a name="analysis scripts"><h2><b>Analysis Scripts</b></h2></a>
25  There are number of analysis scripts on this disk that you can use to extract information from the SWW files
26  produced by a simulation run.  These scripts are not meant to be the definitive answer on how to get information
27  from SWW files, but are offered as an example of one way to do it.
28  <p>
29  This page describes the scripts and shows how to use them.  Note that due to the ad-hoc nature of the scripts,
30  you <b>must</b> modify these scripts before they can be used to extract information from any SWW files you
31  generate.
33  <a name=" scripts"><h3><b></b></h3></a>
34  The <font color="red"></font> script can be used to create an ASC file that contains the maximum
35  of an ANUGA variable or expression for each point in a user-defined raster on the simulation region.
36  <p>
37  You must change certain values within the <font color="red"></font> file to get what you want:
38  <ul>
39    <li> You must determine how many SWW files your simulation produced and create as many lines like this:
40<pre><font color="brown">    time_dir1 = '20090505_150430_run_final_0.8_58292_None_kvanputt'
41    time_dir2 = '20090505_150517_run_final_0_58292_None_kvanputt'</font></pre>
42         as necessary.  Then modify the line:
43<pre><font color="brown">    time_dirs = [time_dir1, time_dir2]</font></pre>
44         to include each of the variables you defined above.
45         <p>   
46    <li> Your SWW output will have a name like <font color="red">gold_coast.sww</font>. For a large model you
47         may have more than one output file with extra filenames like <font color="red">gold_coast_37860_0.sww</font>,
48         where the <b>37860</b> tells us that the timestep at the start of this file is 37860 sec. The 
49         <font color="red"></font> script needs to examine all SWW output files, so we specify
50         all the files produced by the model run to create a maximum over the entire time.
51         We do this by specifying the start times of all the extra SWW files:
52         <p>   
53<pre><font color="brown">    times = [37860]</font></pre>
54         <p>
55         Note we do not have to specify the first SWW file, only the extra file start times. If there are no extra SWW files,
56         just do:
57         <p>   
58<pre><font color="brown">    times = []</font></pre>
59         <p>
60    <li> Modify the <b>cellsize</b> value to set the size of the raster you require.  For example:
61<pre><font color="brown">    cellsize = 20              # raster cell size in metres</font></pre>
62         <p>   
63    <li> You can get the maximum of a variable or expression over the entire model time, or for a single time in the simulation.
64         Set <b>timestep</b> to the required time you want the maximum for, or set it to <b>None</b> to indicate that you want
65         the maximum values in the raster over all timesteps:
66<pre><font color="brown">    timestep = None  # over all timesteps
67    #timestep = 0</font></pre>
68         <p>         
69         Note that if you want the elevation use <b>timestep = 0</b>. Elevation does not change over time and you only need the
70         first SWW file.               
71         <p>
72    <li> If you want to clip the raster to one or more small regions then put the names of the regions of interest
73         into the <b>area</b> list:
74<pre><font color="brown">    area = ['Gold_Coast', 'NW', 'South']</font></pre>
75         Note that the name strings you put into the <b>area</b> list must match the names used in the
76         <font color="red"></font> file.  That is, if you use a name such as 'NW', then the
77         <font color="red"></font> file must have lines like:
78<pre><font color="brown">    xminNW = 548000
79    xmaxNW = 561000
80    yminNW = 5250000
81    ymaxNW = 5258000</font></pre>
82         which set the maximum and minimum eastings and northings that define a rectangular region.
83         <p>
84         If you don't want to clip to a region of interest, then do this:
85<pre><font color="brown">    area = ['All']             # no region of interest</font></pre>
86         <p>
87    <li> Finally you must decide which variable or expression values you want sampled on your raster.
88         Define a list <b>var</b> that contains strings defining the required variable or expression:
89<pre><font color="brown">    var = ['depth', 'speed']</font></pre>
90         Note that the strings you supply must be defined in the <b>var_equations</b> dictionary
91         prior to your definition of <b>var</b>:
92<pre><font color="brown">    var_equations = {'stage':     'stage',
93                     'momentum':  '(xmomentum**2 + ymomentum**2)**0.5',
94                     'depth':     'stage-elevation',
95                     'speed':     '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6)',
96                     'elevation': 'elevation' }</font></pre>
97         This dictionary maps your <b>var</b> strings to a variable or expression.
98  </ul>
100  <a name=""><h3><b></b></h3></a>
101  The <font color="red"></font> script is used to get timeseries data for a selection of variable
102  data at one or more gauge points in a simulation.
103  <p>
104  You must change certain values within the <font color="red"></font> file to get what you want:
105  <ul>
106    <li> You must determine how many SWW files your simulation produced and create as many lines like this:
107<pre><font color="brown">    time_dir1 = '20090505_150430_run_final_0.8_58292_None_kvanputt'
108    time_dir2 = '20090505_150517_run_final_0_58292_None_kvanputt'</font></pre>
109         as necessary.  Then modify the line:
110<pre><font color="brown">    time_dirs = [time_dir1, time_dir2]</font></pre>
111         to include each of the variables you defined above.
112         <p>
113    <li> Make sure that the <b>gauges</b> list in <font color="red"></font> contains one or more CSV files
114         defining the gauges within the simulation that you want the timeseries data for.
115         The gauge file must have this format:
116<pre><font color="brown">    easting,northing,name,elevation
117    559134.8963,5251176.875,Connelly,2
118    532441.5164,5239639.686,Opossum,2</font></pre>
119  </ul>
Note: See TracBrowser for help on using the repository browser.