Ignore:
Timestamp:
Jul 3, 2009, 4:47:17 PM (15 years ago)
Author:
rwilson
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • DVD_images/extra_files/BatemansBay/modifications.html

    r7271 r7300  
    2626  Here we talk about how you change a simulation.  Why would you need to change a simulation?  Well,
    2727  you might have some better elevation data, you want to run the simulation on a finer mesh in certain
    28   areas, or maybe you want to see the result of different events.
     28  areas, or maybe you want to see the result for different events.
    2929  <p>
    3030  First we describe the uses of the script files you might change, then we walk through a few examples
     
    3737  <table class="code">
    3838    <tr><td><font color="red">project.py</font></td><td>Defines the input data used, where to place output, etc.</td></tr>
    39     <tr><td><font color="red">build_boundary.py</font></td><td>Builds ...</td></tr>
     39    <tr><td><font color="red">build_elevation.py</font></td><td>Builds a PTS file of all elevation data specified by <font color="red">project.py</font></td></tr>
    4040    <tr><td><font color="red">setup_model.py</font></td><td>Prepares the simulation before actually running it</td></tr>
    4141    <tr><td><font color="red">run_model.py</font></td><td>Runs the simulation</td></tr>
     
    4444  <a name="project.py"><h4><b>project.py</b></h4></a>
    4545
    46   This file is the heart of the simulation.  Here we specify many things, including the tide level, the simulation
    47   star and stop times, input data files, and so on.  Because we are using python as the programming language in
     46    This file is the heart of the simulation. The project script introduces all files that are necessary to run all accompanying scripts.
     47    By changing one of the variables in this script the output could be completely different.
     48    For further details on changing parameters see <a href="#change">Making changes to a simulation</a>.
     49
     50<!--  This file is the heart of the simulation.  Here we specify many things, including the tide level, the simulation
     51  start and stop times, input data files, and so on.  Because we are using python as the programming language in
    4852  these files, we can use the power of the language to speed up our development.  We use this by <i>parameterising</i>
    4953  data as much as possible.
    5054  <p>
    51   As an example, let's look at the <b>model</b> variable we define in <font color="red">project.py</font>:
     55  Parameters that you might change
     56  As an example, let's look at the <b>scenario_name</b> variable we define in <font color="red">project.py</font>:
    5257  <table class="code">
    53     <tr><td>model = 'small'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# different size model - 'small' or 'large'</td></tr>
     58    <tr><td>scenario_name = 'hobart'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# name of the scenario</td></tr>
    5459  </table>
    5560  <p>
    56   We define this variable solely to quickly change other input filenames.  Where we want a different input file
     61  We define this variable solely to quickly change other input filenames.  Where we want a different input files for
     62  a different scenario,
    5763  depending on whether we want a 'small' or 'large' model, we build the filenames using the <b>model</b> variable.
    5864  Some examples are:
    5965  <p>
    6066  <table class="code">
    61     <tr><td>bounding_polygon_filename = 'bounding_polygon_'+ model + '.csv'</td></tr>
    62     <tr><td>land_initial_conditions_filename = [['initial_conditions_' + model +'.csv', 0]]</td></tr>
    63     <tr><td>landward_boundary_filename = 'landward_boundary_'+ model +'.csv'</td></tr>
     67    <tr height="25"><td>bounding_polygon_filename = 'bounding_polygon_'+ model + '.csv'</td></tr>
     68    <tr height="25"><td>land_initial_conditions_filename = [['initial_conditions_' + model +'.csv', 0]]</td></tr>
     69    <tr height="25"><td>landward_boundary_filename = 'landward_boundary_'+ model +'.csv'</td></tr>
    6470  </table>
    6571  <p>
     
    7177  This speeds up development and make errors less likely.  If you want to add another model to the two
    7278  we show above, just set <b>model</b> to 'medium' and create appropriate input files with the string
    73   'medium' in the filename.
     79  'medium' in the filename. -->
    7480
    75   <a name="build_boundary.py"><h4><b>build_boundary.py</b></h4></a>
     81  <a name="build_elevation.py"><h4><b>build_elevation.py</b></h4></a>
    7682
    77   [text about build_boundary.py]<br>
    78   [In particular, need to run this if elevation data changes.]
     83  This script combines all input elevation files into one PTS file.
     84  We have provided you with the PTS file used to create the outputs on this DVD.
     85  If you would like to change the elevation see <a href="#change">Making changes to a simulation</a>.
    7986  <p>
    8087
    8188  <a name="setup_model.py"><h4><b>setup_model.py</b></h4></a>
    8289
    83   [text about project.py]
     90  This script is used to transform data into a specific format for <font color="red">run_model.py</font>,
     91  if required, and to generate warning messages if you are missing data.
    8492  <p>
    8593
    8694  <a name="run_model.py"><h4><b>run_model.py</b></h4></a>
    8795
    88   [text about project.py]
     96  This script runs a tsunami inundation scenario.  It relies on the parameters set in <font color="red">project.py</font>
     97  as well as the PTS and STS files.
     98  An STS file has been generated for each event listed in the boundaries directory. For further details on events see
     99  <a href="#change">Making changes to a simulation</a>.
    89100  <p>
    90101
    91102  <a name="change"><h3><b>Making changes to a simulation</b></h3></a>
    92103
    93   Now we walk through some examples of changes you might make.  There are many ways to change a simulation - here
    94   we discuss just a few.
     104  There are many parameters that you can change within the <font color="red">project.py</font> script,
     105  but the following four parameters are those most commonly changed.
    95106  <p>
    96107
    97   <a name="events"><h4><b>Changing events</b></h4></a>
     108  <a name="tide"><h4><b>Tide</b></h4></a>
    98109
    99   [some events text here]
     110  The <b>tide</b> parameter is used to change the mean stage of the simulation.  When <b>tide</b> is set to 0
     111  the initial water level will be at Mean Sea Level.  If you increase the <b>tide</b> value the water level will become deeper.
     112  However land is masked out using initial conditions.  Within ANUGA <b>tide</b> is modelled as a constant.
    100113  <p>
    101114
    102   <a name="elevation"><h4><b>Changing elevation data</b></h4></a>
     115  <a name="events"><h4><b>Events</b></h4></a>
    103116
    104   [some elevation text here]
     117  The <b>event_number</b> variable contains the event number that initiates the tsunami we are modelling.
     118  You can change <b>event_number</b> to any event number in the anuga/boundaries directory.
     119  As we said above, a new STS file must be generated for <font color="red">run_model.py</font> to work.
     120  <p>
     121  The event numbers correspond to a quake ID from the probabilistic tsunami hazard map of Australia.
     122  <table class="code">
     123    <tr><td><pre>event_number = 51436    # 1 in 10000 yr event from New Hebrides</pre></td></tr>
     124  </table>
    105125  <p>
    106126
     127  <a name="elevation"><h4><b>Elevation</b></h4></a>
     128
     129  Elevation data can be changed in the <font color="red">project.py</font> elevation script.
     130  Elevation data can be read as either a point file, comma delimited, or as an ASCII grid file
     131  (ASC) with an accompanying projection file (PRJ). All elevation input must be projected in the correct UTM zone.
     132  <p>
     133
     134  A header for a CSV file has the format:
     135  <table class="code">
     136    <tr><td><pre>x,y,elevation</pre></td></tr>
     137  </table>
     138  <p>
     139
     140  An ASC file header has the format:
     141  <table class="code">
     142    <tr><td><pre>ncols         868
     143nrows         856
     144xllcorner     418933.86055096
     145yllcorner     5151810.6668096
     146cellsize      250
     147NODATA_value  -9999</pre></td></tr>
     148  </table>
     149  <p>
     150
     151  The header of a PRJ file has the format:
     152  <table class="code">
     153    <tr><td><pre>Projection    UTM
     154Zone          55
     155Datum         D_GDA_1994
     156Zunits        NO
     157Units         METERS
     158Spheroid      GRS_1980
     159Xshift        500000
     160Yshift        10000000
     161Parameters</pre></td></tr>
     162  </table>
     163  <p>
     164
     165  The elevation filenames must be listed in either <b>point_filenames</b> or <b>ascii_grid_filenames</b>
     166  depending on their format. Point files need to have their extension shown however the ascii grid files have the .asc extension assumed:
     167  <table class="code">
     168    <tr><td><pre>point_filenames = ['SD100031996_jgriffin_clip.csv',
     169                   'tomaga_offshore_AHD_MGA_1997.csv',
     170                   'Batemans_BBHD_MGA_1995.csv',
     171                   'moruya_AHD_MGA_2000.csv']
     172
     173ascii_grid_filenames = ['sd100031996_p',
     174                        'sd100031996_p2',
     175                        'sd100031996_p3',
     176                        'sd100031996_p4']</pre></td></tr>
     177  </table>
     178  <p>
     179
     180  For further information on ANUGA file formats please see the ANUGA User Manual, section 6.1.
     181  <p>
     182
     183  <a name="interior_regions"><h4><b>Interior regions</b></h4></a>
     184
     185  The <b>interior_regions</b> parameter allows you to change the mesh of the model.
     186  <p>
    107187</body>
    108188</html>
Note: See TracChangeset for help on using the changeset viewer.