Changeset 7271


Ignore:
Timestamp:
Jun 29, 2009, 10:45:27 AM (15 years ago)
Author:
rwilson
Message:

Changes to track requirements.

Location:
DVD_images
Files:
3 edited

Legend:

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

    r7265 r7271  
    2424  <a name="modifications"><h2><b>Modifying a simulation</b></h2></a>
    2525
    26   [some introductory text here]
     26  Here we talk about how you change a simulation.  Why would you need to change a simulation?  Well,
     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 of different events.
     29  <p>
     30  First we describe the uses of the script files you might change, then we walk through a few examples
     31  of changes you might make.
    2732  <p>
    2833
     
    3237  <table class="code">
    3338    <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>
    3440    <tr><td><font color="red">setup_model.py</font></td><td>Prepares the simulation before actually running it</td></tr>
    3541    <tr><td><font color="red">run_model.py</font></td><td>Runs the simulation</td></tr>
     
    3743
    3844  <a name="project.py"><h4><b>project.py</b></h4></a>
    39   [text about project.py]
     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
     48  these files, we can use the power of the language to speed up our development.  We use this by <i>parameterising</i>
     49  data as much as possible.
     50  <p>
     51  As an example, let's look at the <b>model</b> variable we define in <font color="red">project.py</font>:
     52  <table class="code">
     53    <tr><td>model = 'small'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# different size model - 'small' or 'large'</td></tr>
     54  </table>
     55  <p>
     56  We define this variable solely to quickly change other input filenames.  Where we want a different input file
     57  depending on whether we want a 'small' or 'large' model, we build the filenames using the <b>model</b> variable.
     58  Some examples are:
     59  <p>
     60  <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>
     64  </table>
     65  <p>
     66  We must, of course, ensure that there are input files <font color="red">bounding_polygon_small.csv</font>
     67  and <font color="red">bounding_polygon_large.csv</font>, and so on.
     68  <p>
     69  Now, if we need to change the simulation model from 'small' to 'large', we need only change the
     70  value of the <b>model</b> variable, and all the input files that depend on the model will change.
     71  This speeds up development and make errors less likely.  If you want to add another model to the two
     72  we show above, just set <b>model</b> to 'medium' and create appropriate input files with the string
     73  'medium' in the filename.
     74
     75  <a name="build_boundary.py"><h4><b>build_boundary.py</b></h4></a>
     76
     77  [text about build_boundary.py]<br>
     78  [In particular, need to run this if elevation data changes.]
    4079  <p>
    4180
    4281  <a name="setup_model.py"><h4><b>setup_model.py</b></h4></a>
     82
    4383  [text about project.py]
    4484  <p>
    4585
    4686  <a name="run_model.py"><h4><b>run_model.py</b></h4></a>
     87
    4788  [text about project.py]
    4889  <p>
    4990
    50   <a name="events"><h3><b>Changing events</b></h3></a>
     91  <a name="change"><h3><b>Making changes to a simulation</b></h3></a>
     92
     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.
     95  <p>
     96
     97  <a name="events"><h4><b>Changing events</b></h4></a>
    5198
    5299  [some events text here]
    53100  <p>
    54101
    55   <a name="elevation"><h3><b>Changing elevation data</b></h3></a>
     102  <a name="elevation"><h4><b>Changing elevation data</b></h4></a>
    56103
    57104  [some elevation text here]
  • DVD_images/update_DVD_images.py

    r7266 r7271  
    4040 'data_src_path':   'data/tasmania/hobart_tsunami_scenario_2009/anuga',
    4141 'arcgis_src_path': 'data/tasmania/hobart_tsunami_scenario_2009/ArcGIS',
    42  'proj_src_path':   'sandpits/kvanputten/ANUGA/anuga_work/production/hobart_2009',
     42 'viz_src_path':    'data/tasmania/hobart_tsunami_scenario_2009/visualisations',
     43 'proj_src_path':   'sandpits/kvanputten/ANUGA/anuga_work/production/hobart_2009/For_DVD',
    4344
    4445 # paths to destination directories (under 'jurisdiction' root)
    4546 'data_dst_path':   'data/tasmania/hobart_tsunami_scenario_2009/anuga',
    4647 'proj_dst_path':   'project',
     48 'viz_dst_path':    'documents',
    4749 'arcgis_dst_path': 'data/tasmania/hobart_tsunami_scenario_2009/ArcGIS',
    4850
    4951 # copy or create whole directories
    50  'make_dst_dirs':   ['meshes', 'gauges', 'outputs', 'topographies/elevation_fix'],
    51  'copy_data_dirs':  ['boundaries', 'polygons'],
     52 'make_dst_dirs':   ['outputs', 'topographies'],
     53 'copy_data_dirs':  ['gauges','boundaries', 'polygons'],
    5254
    5355 # copy 'data' files or directories
    54  'copy_data_files': ['gauges/schema.ini', 'gauges/tsunamipointsMGA.csv',
     56 'copy_data_files': ['outputs/Event1_HAT',
     57                     'outputs/Event1_MSL',
     58                     'outputs/Event2_HAT',
     59                     'outputs/Event2_MSL',
     60                     'outputs/Event3_MSL',
    5561                     'topographies/hobart_combined_elevation.pts',
    56                      'topographies/hobart_combined_elevation.txt',
    57                      'topographies/elevation_fix/topo_grid_notsw.pts',
    58                      'topographies/elevation_fix/topo_grid_notsw.dem',
    59                      'topographies/elevation_fix/topo_grid_notsw.asc',
    60                      'topographies/elevation_fix/topo_grid_notsw.prj'],
     62                     'topographies/hobart_combined_elevation.txt'],
    6163
    6264 # copy 'project' files or directories
    63  'copy_proj_files': ['build_elevation.py', 'build_urs_boundary.py', 'combine_gauges.py',
    64                      'export_results_max.py', 'file_length.py', 'get_runup_v2.py',
    65                      'get_timeseries.py', 'project.py', 'run_model.py', 'setup_model.py'],
     65 'copy_proj_files': ['build_elevation.py', 'project.py', 'run_model.py',
     66                     'export_results_max.py',  'get_timeseries.py',
     67                     'setup_model.py'],
     68
     69 # copy 'visualisations' files or directories
     70 'copy_viz_files': ['Figures'],
    6671
    6772 # copy 'arcgis' files or directories
     
    7580 'data_src_path':   'data/new_south_wales/batemans_bay_tsunami_scenario_2009/anuga',
    7681 'arcgis_src_path': 'data/new_south_wales/batemans_bay_tsunami_scenario_2009/ArcGIS',
     82 'viz_src_path':    'data/tasmania/hobart_tsunami_scenario_2009/visualisations',
    7783 'proj_src_path':   'sandpits/jgriffin/ANUGA/anuga_work/production/new_south_wales/batemans_bay',
    7884
     
    8086 'data_dst_path':   'data/new_south_wales/batemans_bay_tsunami_scenario_2009/anuga',
    8187 'proj_dst_path':   'project',
     88 'viz_dst_path':    'documents',
    8289 'arcgis_dst_path': 'data/new_south_wales/batemans_bay_tsunami_scenario_2009/ArcGIS',
    8390
     
    101108                     'outputs/New_Hebrides_1000yr',
    102109                     'outputs/New_Hebrides_2000yr',
    103                      'outputs/New_Hebrides_5000yr'],
     110                     'outputs/New_Hebrides_5000yr',
     111                     'outputs/elevation'],
     112
     113 # copy 'visualisations' files or directories
     114 'copy_viz_files': ['Figures'],
    104115
    105116 # copy 'project' files or directories
     
    119130 'data_src_path':   'data/new_south_wales/gosford_tsunami_scenario_2009/anuga',
    120131 'arcgis_src_path': 'data/new_south_wales/gosford_tsunami_scenario_2009/ArcGIS',
     132 'viz_src_path':    'data/tasmania/hobart_tsunami_scenario_2009/visualisations',
    121133 'proj_src_path':   'sandpits/jgriffin/ANUGA/anuga_work/production/new_south_wales/gosford',
    122134
     
    124136 'data_dst_path':   'data/new_south_wales/gosford_tsunami_scenario_2009/anuga',
    125137 'proj_dst_path':   'project',
     138 'viz_dst_path':    'documents',
    126139 'arcgis_dst_path': 'data/new_south_wales/gosford_tsunami_scenario_2009/ArcGIS',
    127140
     
    140153                     'outputs/Puysegur_500yr',
    141154                     'outputs/Puysegur_1000yr',
    142                      'outputs/Puysegur_5000yr'
     155                     'outputs/Puysegur_5000yr',
     156                     'outputs/elevation'
    143157                    ],
     158
     159 # copy 'visualisations' files or directories
     160 'copy_viz_files': ['Figures'],
    144161
    145162 # copy 'project' files or directories
     
    159176 'data_src_path':   'data/queensland/gold_coast_tsunami_scenario_2009/anuga',
    160177 'arcgis_src_path': 'data/queensland/gold_coast_tsunami_scenario_2009/ArcGIS',
     178 'viz_src_path':    'data/tasmania/hobart_tsunami_scenario_2009/visualisations',
    161179 'proj_src_path':   'sandpits/lfountain/anuga_work/production/gold_coast_2009',
    162180
     
    164182 'data_dst_path':   'data/queensland/gold_coast_tsunami_scenario_2009/anuga',
    165183 'proj_dst_path':   'project',
     184 'viz_dst_path':    'documents',
    166185 'arcgis_dst_path': 'data/queensland/gold_coast_tsunami_scenario_2009/ArcGIS',
    167186
    168187 # copy or create whole directories
    169  'make_dst_dirs':   ['meshes', 'outputs', 'polygons', 'topographies', 'gauges'],
     188 'make_dst_dirs':   ['outputs', 'polygons', 'topographies', 'gauges'],
    170189 'copy_data_dirs':  ['boundaries'],
    171190
     
    180199                     'gauges/gauges.csv',
    181200                     'polygons/images.csv',
    182                      'topographies/gold_coast_combined_elevation_250m.pts'
     201                     'topographies/gold_coast_combined_elevation.pts'
    183202                    ],
     203
     204 # copy 'visualisations' files or directories
     205 'copy_viz_files': ['Figures'],
    184206
    185207 # copy 'project' files or directories
     
    190212
    191213 # copy 'arcgis' files or directories
    192  'copy_arc_files':  ['gold_coast.mxd']
     214 'copy_arc_files':  ['gold_coast.mxd', 'gold_coast.gdb']
    193215}
    194216
     
    241263    proj_src_path = os.path.join(main_path, j_dict['proj_src_path'])
    242264    proj_dst_path = os.path.join(os.getcwd(), j_name, j_dict['proj_dst_path'])
     265    viz_src_path = os.path.join(main_path, j_dict['viz_src_path'])
     266    viz_dst_path = os.path.join(os.getcwd(), j_name, j_dict['viz_dst_path'])
    243267    arcgis_src_path = os.path.join(main_path, j_dict['arcgis_src_path'])
    244268    arcgis_dst_path = os.path.join(os.getcwd(), j_name, j_dict['arcgis_dst_path'])
     
    274298        src_file = os.path.join(data_src_path, copy_file)
    275299        new_file = os.path.join(data_dst_path, copy_file)
     300        log('Copying: %s' % copy_file)
     301        copy_file_or_dir(src_file, new_file)
     302
     303    # copy required visualisation files
     304    log('Creating directory: %s' % viz_dst_path)
     305    os.makedirs(viz_dst_path)
     306    for copy_file in j_dict['copy_viz_files']:
     307        src_file = os.path.join(viz_src_path, copy_file)
     308        new_file = os.path.join(viz_dst_path, copy_file)
    276309        log('Copying: %s' % copy_file)
    277310        copy_file_or_dir(src_file, new_file)
Note: See TracChangeset for help on using the changeset viewer.