Changeset 7300 for DVD_images/extra_files/BatemansBay/modifications.html
- Timestamp:
- Jul 3, 2009, 4:47:17 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DVD_images/extra_files/BatemansBay/modifications.html
r7271 r7300 26 26 Here we talk about how you change a simulation. Why would you need to change a simulation? Well, 27 27 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 ofdifferent events.28 areas, or maybe you want to see the result for different events. 29 29 <p> 30 30 First we describe the uses of the script files you might change, then we walk through a few examples … … 37 37 <table class="code"> 38 38 <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> 40 40 <tr><td><font color="red">setup_model.py</font></td><td>Prepares the simulation before actually running it</td></tr> 41 41 <tr><td><font color="red">run_model.py</font></td><td>Runs the simulation</td></tr> … … 44 44 <a name="project.py"><h4><b>project.py</b></h4></a> 45 45 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 48 52 these files, we can use the power of the language to speed up our development. We use this by <i>parameterising</i> 49 53 data as much as possible. 50 54 <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>: 52 57 <table class="code"> 53 <tr><td> model = 'small' # different size model - 'small' or 'large'</td></tr>58 <tr><td>scenario_name = 'hobart' # name of the scenario</td></tr> 54 59 </table> 55 60 <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, 57 63 depending on whether we want a 'small' or 'large' model, we build the filenames using the <b>model</b> variable. 58 64 Some examples are: 59 65 <p> 60 66 <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> 64 70 </table> 65 71 <p> … … 71 77 This speeds up development and make errors less likely. If you want to add another model to the two 72 78 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. --> 74 80 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> 76 82 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>. 79 86 <p> 80 87 81 88 <a name="setup_model.py"><h4><b>setup_model.py</b></h4></a> 82 89 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. 84 92 <p> 85 93 86 94 <a name="run_model.py"><h4><b>run_model.py</b></h4></a> 87 95 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>. 89 100 <p> 90 101 91 102 <a name="change"><h3><b>Making changes to a simulation</b></h3></a> 92 103 93 Now we walk through some examples of changes you might make. There are many ways to change a simulation - here94 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. 95 106 <p> 96 107 97 <a name=" events"><h4><b>Changing events</b></h4></a>108 <a name="tide"><h4><b>Tide</b></h4></a> 98 109 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. 100 113 <p> 101 114 102 <a name="e levation"><h4><b>Changing elevation data</b></h4></a>115 <a name="events"><h4><b>Events</b></h4></a> 103 116 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> 105 125 <p> 106 126 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 143 nrows 856 144 xllcorner 418933.86055096 145 yllcorner 5151810.6668096 146 cellsize 250 147 NODATA_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 154 Zone 55 155 Datum D_GDA_1994 156 Zunits NO 157 Units METERS 158 Spheroid GRS_1980 159 Xshift 500000 160 Yshift 10000000 161 Parameters</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 173 ascii_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> 107 187 </body> 108 188 </html>
Note: See TracChangeset
for help on using the changeset viewer.