Changeset 6756


Ignore:
Timestamp:
Apr 8, 2009, 8:32:34 AM (15 years ago)
Author:
myall
Message:

standardising scripts and adding run_multiple_events.py

Location:
anuga_work/production/australia_ph2
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/australia_ph2/bundaberg/project.py

    r6743 r6756  
    77from anuga.utilities.system_tools import get_user_name, get_host_name
    88from time import localtime, strftime, gmtime
    9 #from anuga.lib.add_csv_header import add_csv_header
    10 from add_csv_header import add_csv_header
    119from os.path import join, exists
    12 
     10from anuga.lib.add_csv_header.add_csv_header import add_csv_header
    1311
    1412#-------------------------------------------------------------------------------
     
    2018state = 'australia_ph2'
    2119scenario_name = 'bundaberg'
    22 scenario_folder = scenario_name
    2320
    2421#-------------------------------------------------------------------------------
     
    2825# Model specific parameters.
    2926# One or all can be changed each time the run_model script is executed
    30 tide = 0                # difference between MSL and HAT
    31 zone = 56               # specify zone of model
    32 ##central_meridian = 143.5 # nonstandard projection
    33 
    34 
     27
     28central_meridian = 153.0 # Central meridian for projection (optional)
     29#zone = 56
    3530import sys
    3631if len(sys.argv) > 1:
     
    3833else:   
    3934    event_number = 31756    # the event number or the mux file name
    40    
     35
    4136event_number_list = [31756, 51469, 62840] # To piggy back multiple events
    42                                           # using run_multiple_events.py
    43 
     37
     38tide = 0                # difference between MSL and HAT
    4439alpha = 0.1             # smoothing parameter for mesh
    4540friction=0.01           # manning's friction coefficient
    4641starttime=0             # start time for simulation
    47 finaltime=80000          # final time for simulation
    48 
    49 # index is only used when wave = Tb
    50 index = 1889            # index from the PTHA
    51 wave = 'Tb'             # Bf (sts wave) Tb (index wave)
    52 
     42finaltime=1000   #60000 # final time for simulation
    5343setup = 'trial'         # This can be one of three values
    5444                        #    trial - coarsest mesh, fast
    5545                        #    basic - coarse mesh
    5646                        #    final - fine mesh, slowest
     47
     48# index is only used when wave = Tb
     49index = 3274            # index from the PTHA - Y2000 0.257m
     50wave = 'Tb'             # Bf (sts wave) Tb (index wave)
     51
    5752
    5853internal_polygon = False
     
    7267    internal_poly_comment = 'internal'
    7368else:
    74     internal_poly_comment = None
     69    internal_poly_comment = ''
    7570
    7671output_comment = [setup, tide, event_number, index, wave, internal_poly_comment]
     
    8580ascii_grid_filenames = ['grid250m_pro'] # 250m grid 2005
    8681
    87 # Format for point is x,y,elevation (with header)
    88 ##point_filenames = []
     82# Format for points is x,y,elevation (with header)
    8983point_filenames = ['ahs100_0.txt',
    9084                   'ahs100_1.txt',
     
    10296                   'ahs100_13.txt'] # LADS data
    10397
     98### Add csv header list to all files in point_filenames
     99##headerlist = ['x', 'y', 'elevation']
     100##for f in point_filenames:
     101##    add_csv_header(join(topographies_folder, f), headerlist)
     102
    104103# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
    105104# Used in build_elevation.py
    106 # Format for points easting,northing (no header)
     105# Format for points: easting,northing (no header)
    107106bounding_polygon_filename = 'bounding_polygon.csv'
    108107bounding_polygon_maxarea = 125000
     
    133132# Used in run_building_inundation.py
    134133# Format latitude,longitude etc (geographic)
    135 building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
     134building_exposure_filename = '.csv' # from NEXIS
    136135
    137136# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
     
    151150# If a meta-file from EventSelection is used, set 'multi-mux' to True.
    152151# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
    153 ##mux_input_filename = event_number # to be found in event_folder
    154                                     # (ie boundaries/event_number/)
     152##mux_input_filename = 'Java-0016-z.grd'
    155153##multi_mux = False
    156154mux_input_filename = 'event.list'
    157155multi_mux = True
     156
     157# Specify if share cache is to be used
     158# Whatever is specified here will be relative to INUNDATION_HOME/.cache
     159# If nothing is specified, local cache will be used.
     160cachedir = '.python_cache_phII'
    158161
    159162
     
    178181
    179182#-------------------------------------------------------------------------------
     183# Output Elevation Data
     184#-------------------------------------------------------------------------------
     185
     186# Output filename for elevation
     187# this is a combination of all the data generated in build_elevation.py
     188combined_elevation_basename = scenario_name + '_combined_elevation'
     189
     190#-------------------------------------------------------------------------------
    180191# Directory Structure
    181192#-------------------------------------------------------------------------------
     
    190201home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
    191202muxhome = os.getenv(ENV_MUXHOME)
     203
     204# Create absolute pathname for cache directory
     205# and change caching to use it
     206if 'cachedir' in dir():
     207    cachedir = join(os.getenv(ENV_INUNDATIONHOME), '.cache', cachedir)
     208    from anuga.caching import caching
     209    caching.set_option('cachedir', cachedir)
    192210   
    193211# check various directories/files that must exist
    194 anuga_folder = join(home, state, scenario_folder, 'anuga')
     212anuga_folder = join(home, state, scenario_name, 'anuga')
    195213topographies_folder = join(anuga_folder, 'topographies')
    196214polygons_folder = join(anuga_folder, 'polygons')
     
    206224
    207225#-------------------------------------------------------------------------------
    208 # Output Elevation Data
    209 #-------------------------------------------------------------------------------
    210 
    211 # Output filename for elevation
    212 # this is a combination of all the data generated in build_elevation.py
    213 combined_elevation_basename = scenario_name + '_combined_elevation'
    214 
    215 #-------------------------------------------------------------------------------
    216226# Location of input and output data
    217227#-------------------------------------------------------------------------------
  • anuga_work/production/australia_ph2/bundaberg/run_multiple_events.py

    r6743 r6756  
    11"""This script executes models for a range of event numbers.
    22
    3 Events must have been created first
     3Events folders and event.list must have been created first from
     4the event selection program
    45"""
    56
  • anuga_work/production/australia_ph2/cairns/project.py

    r6744 r6756  
    88from time import localtime, strftime, gmtime
    99from os.path import join, exists
    10 
     10from anuga.lib.add_csv_header.add_csv_header import add_csv_header
    1111
    1212#-------------------------------------------------------------------------------
     
    1818state = 'australia_ph2'
    1919scenario_name = 'cairns'
    20 scenario_folder = scenario_name
    2120
    2221#-------------------------------------------------------------------------------
     
    2625# Model specific parameters.
    2726# One or all can be changed each time the run_model script is executed
    28 tide = 0                # difference between MSL and HAT
    29 zone = 55               # specify zone of model
    30 ##central_meridian = 143.5 # nonstandard projection
    31 
    32 
     27
     28central_meridian = 147 # Central meridian for projection (optional)
     29#zone = 55
    3330import sys
    3431if len(sys.argv) > 1:
    3532    event_number = int(sys.argv[1])
    3633else:   
    37     event_number = 31975    # the event number or the mux file name
    38    
    39 event_number_list = [31975, 51469, 63767] # To piggy back multiple events
    40                                           # using run_multiple_events.py
    41 
     34    event_number =     # the event number or the mux file name
     35
     36event_number_list = [] # To piggy back multiple events
     37
     38tide = 0                # difference between MSL and HAT
    4239alpha = 0.1             # smoothing parameter for mesh
    4340friction=0.01           # manning's friction coefficient
    4441starttime=0             # start time for simulation
    45 finaltime=80000          # final time for simulation
    46 
    47 # index is only used when wave = Tb
    48 index = 1889            # index from the PTHA
    49 wave = 'Tb'             # Bf (sts wave) Tb (index wave)
    50 
     42finaltime=1000   #60000 # final time for simulation
    5143setup = 'trial'         # This can be one of three values
    5244                        #    trial - coarsest mesh, fast
    5345                        #    basic - coarse mesh
    5446                        #    final - fine mesh, slowest
     47
     48# index is only used when wave = Tb
     49index =             # index from the PTHA - Y2000 0.257m
     50wave = 'Tb'             # Bf (sts wave) Tb (index wave)
     51
    5552
    5653internal_polygon = False
     
    7067    internal_poly_comment = 'internal'
    7168else:
    72     internal_poly_comment = None
     69    internal_poly_comment = ''
    7370
    7471output_comment = [setup, tide, event_number, index, wave, internal_poly_comment]
     
    8380ascii_grid_filenames = ['grid250m_pro'] # 250m grid 2005
    8481
    85 # Format for point is x,y,elevation (with header)
    86 ##point_filenames = []
     82# Format for points is x,y,elevation (with header)
    8783point_filenames = ['ahs100_0.txt',
    8884                   'ahs100_1.txt',
     
    10096                   'ahs100_13.txt'] # LADS data
    10197
     98### Add csv header list to all files in point_filenames
     99##headerlist = ['x', 'y', 'elevation']
     100##for f in point_filenames:
     101##    add_csv_header(join(topographies_folder, f), headerlist)
     102
    102103# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
    103104# Used in build_elevation.py
    104 # Format for points easting,northing (no header)
     105# Format for points: easting,northing (no header)
    105106bounding_polygon_filename = 'bounding_polygon.csv'
    106107bounding_polygon_maxarea = 125000
     
    131132# Used in run_building_inundation.py
    132133# Format latitude,longitude etc (geographic)
    133 building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
     134building_exposure_filename = '.csv' # from NEXIS
    134135
    135136# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
     
    149150# If a meta-file from EventSelection is used, set 'multi-mux' to True.
    150151# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
    151 ##mux_input_filename = event_number # to be found in event_folder
    152                                     # (ie boundaries/event_number/)
     152##mux_input_filename = 'Java-0016-z.grd'
    153153##multi_mux = False
    154154mux_input_filename = 'event.list'
    155155multi_mux = True
     156
     157# Specify if share cache is to be used
     158# Whatever is specified here will be relative to INUNDATION_HOME/.cache
     159# If nothing is specified, local cache will be used.
     160cachedir = '.python_cache_phII'
    156161
    157162
     
    196201home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
    197202muxhome = os.getenv(ENV_MUXHOME)
     203
     204# Create absolute pathname for cache directory
     205# and change caching to use it
     206if 'cachedir' in dir():
     207    cachedir = join(os.getenv(ENV_INUNDATIONHOME), '.cache', cachedir)
     208    from anuga.caching import caching
     209    caching.set_option('cachedir', cachedir)
    198210   
    199211# check various directories/files that must exist
    200 anuga_folder = join(home, state, scenario_folder, 'anuga')
     212anuga_folder = join(home, state, scenario_name, 'anuga')
    201213topographies_folder = join(anuga_folder, 'topographies')
    202214polygons_folder = join(anuga_folder, 'polygons')
     
    235247event_sts = join(event_folder, scenario_name)
    236248
    237 
    238 
    239249# The absolute pathname for the output folder names
    240250# Used for build_elevation.py
  • anuga_work/production/australia_ph2/cairns/run_multiple_events.py

    r6744 r6756  
    11"""This script executes models for a range of event numbers.
    22
    3 Events must have been created first
     3Events folders and event.list must have been created first from
     4the event selection program
    45"""
    56
  • anuga_work/production/australia_ph2/cooktown/project.py

    r6745 r6756  
    88from time import localtime, strftime, gmtime
    99from os.path import join, exists
    10 
     10from anuga.lib.add_csv_header.add_csv_header import add_csv_header
    1111
    1212#-------------------------------------------------------------------------------
     
    1818state = 'australia_ph2'
    1919scenario_name = 'cooktown'
    20 scenario_folder = scenario_name
    2120
    2221#-------------------------------------------------------------------------------
     
    2625# Model specific parameters.
    2726# One or all can be changed each time the run_model script is executed
    28 tide = 0                # difference between MSL and HAT
    29 zone = 55               # specify zone of model
    30 ##central_meridian = 143.5 # nonstandard projection
    31 
    32 
     27
     28central_meridian = 147.0 # Central meridian for projection (optional)
     29#zone = 55
    3330import sys
    3431if len(sys.argv) > 1:
     
    3633else:   
    3734    event_number = 31977    # the event number or the mux file name
    38    
     35
    3936event_number_list = [31977, 51469, 63735] # To piggy back multiple events
    40                                           # using run_multiple_events.py
    41 
     37
     38tide = 0                # difference between MSL and HAT
    4239alpha = 0.1             # smoothing parameter for mesh
    4340friction=0.01           # manning's friction coefficient
    4441starttime=0             # start time for simulation
    45 finaltime=80000          # final time for simulation
    46 
    47 # index is only used when wave = Tb
    48 index = 1889            # index from the PTHA
    49 wave = 'Tb'             # Bf (sts wave) Tb (index wave)
    50 
     42finaltime=1000   #60000 # final time for simulation
    5143setup = 'trial'         # This can be one of three values
    5244                        #    trial - coarsest mesh, fast
    5345                        #    basic - coarse mesh
    5446                        #    final - fine mesh, slowest
     47
     48# index is only used when wave = Tb
     49index = 2065            # index from the PTHA - Y2000 0.257m
     50wave = 'Tb'             # Bf (sts wave) Tb (index wave)
     51
    5552
    5653internal_polygon = False
     
    7067    internal_poly_comment = 'internal'
    7168else:
    72     internal_poly_comment = None
     69    internal_poly_comment = ''
    7370
    7471output_comment = [setup, tide, event_number, index, wave, internal_poly_comment]
     
    8178# Used in build_elevation.py
    8279# Format for ascii grids, as produced in ArcGIS + a projection file
    83 ascii_grid_filenames = ['grid250m_pro'] # 250m grid 2005
    84 
    85 # Format for point is x,y,elevation (with header)
    86 ##point_filenames = []
     80ascii_grid_filenames = []
     81
     82# Format for points is x,y,elevation (with header)
    8783point_filenames = ['ahs100_0.txt',
    8884                   'ahs100_1.txt',
     
    10096                   'ahs100_13.txt'] # LADS data
    10197
     98### Add csv header list to all files in point_filenames
     99##headerlist = ['x', 'y', 'elevation']
     100##for f in point_filenames:
     101##    add_csv_header(join(topographies_folder, f), headerlist)
     102
    102103# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
    103104# Used in build_elevation.py
    104 # Format for points easting,northing (no header)
     105# Format for points: easting,northing (no header)
    105106bounding_polygon_filename = 'bounding_polygon.csv'
    106107bounding_polygon_maxarea = 125000
     
    131132# Used in run_building_inundation.py
    132133# Format latitude,longitude etc (geographic)
    133 building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
     134building_exposure_filename = '.csv' # from NEXIS
    134135
    135136# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
     
    149150# If a meta-file from EventSelection is used, set 'multi-mux' to True.
    150151# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
    151 ##mux_input_filename = event_number # to be found in event_folder
    152                                     # (ie boundaries/event_number/)
     152##mux_input_filename = 'Java-0016-z.grd'
    153153##multi_mux = False
    154154mux_input_filename = 'event.list'
    155155multi_mux = True
     156
     157# Specify if share cache is to be used
     158# Whatever is specified here will be relative to INUNDATION_HOME/.cache
     159# If nothing is specified, local cache will be used.
     160cachedir = '.python_cache_phII'
    156161
    157162
     
    196201home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
    197202muxhome = os.getenv(ENV_MUXHOME)
     203
     204# Create absolute pathname for cache directory
     205# and change caching to use it
     206if 'cachedir' in dir():
     207    cachedir = join(os.getenv(ENV_INUNDATIONHOME), '.cache', cachedir)
     208    from anuga.caching import caching
     209    caching.set_option('cachedir', cachedir)
    198210   
    199211# check various directories/files that must exist
    200 anuga_folder = join(home, state, scenario_folder, 'anuga')
     212anuga_folder = join(home, state, scenario_name, 'anuga')
    201213topographies_folder = join(anuga_folder, 'topographies')
    202214polygons_folder = join(anuga_folder, 'polygons')
     
    235247event_sts = join(event_folder, scenario_name)
    236248
    237 
    238 
    239249# The absolute pathname for the output folder names
    240250# Used for build_elevation.py
  • anuga_work/production/australia_ph2/cooktown/run_multiple_events.py

    r6745 r6756  
    11"""This script executes models for a range of event numbers.
    22
    3 Events must have been created first
     3Events folders and event.list must have been created first from
     4the event selection program
    45"""
    56
  • anuga_work/production/australia_ph2/gold_coast/project.py

    r6531 r6756  
    88from time import localtime, strftime, gmtime
    99from os.path import join, exists
    10 
     10from anuga.lib.add_csv_header.add_csv_header import add_csv_header
    1111
    1212#-------------------------------------------------------------------------------
     
    1818state = 'australia_ph2'
    1919scenario_name = 'gold_coast'
    20 scenario_folder = scenario_name
    2120
    2221#-------------------------------------------------------------------------------
     
    2625# Model specific parameters.
    2726# One or all can be changed each time the run_model script is executed
     27
     28central_meridian = 153.0 # Central meridian for projection (optional)
     29#zone = 56
     30import sys
     31if len(sys.argv) > 1:
     32    event_number = int(sys.argv[1])
     33else:   
     34    event_number = 50883    # the event number or the mux file name
     35
     36event_number_list = [50883, 51318, 51453] # To piggy back multiple events
     37
    2838tide = 0                # difference between MSL and HAT
    29 zone = 56               # specify zone of model
    30 event_number = 51314    # the event number or the mux file name
    3139alpha = 0.1             # smoothing parameter for mesh
    3240friction=0.01           # manning's friction coefficient
    3341starttime=0             # start time for simulation
    34 finaltime=80000          # final time for simulation
    35 
    36 # index is only used when wave = Tb
    37 index = 3727            # index from the PTHA
    38 wave = 'Tb'             # Bf (sts wave) Tb (index wave)
    39 
    40 setup = 'final'         # This can be one of three values
     42finaltime=1000   #60000 # final time for simulation
     43setup = 'trial'         # This can be one of three values
    4144                        #    trial - coarsest mesh, fast
    4245                        #    basic - coarse mesh
    4346                        #    final - fine mesh, slowest
     47
     48# index is only used when wave = Tb
     49index = 3727            # index from the PTHA - Y2000 0.257m
     50wave = 'Tb'             # Bf (sts wave) Tb (index wave)
     51
     52
     53internal_polygon = False
    4454
    4555#-------------------------------------------------------------------------------
     
    5464#-------------------------------------------------------------------------------
    5565
    56 output_comment = [setup, tide, event_number, index, wave]
     66if internal_polygon:
     67    internal_poly_comment = 'internal'
     68else:
     69    internal_poly_comment = ''
     70
     71output_comment = [setup, tide, event_number, index, wave, internal_poly_comment]
    5772
    5873#-------------------------------------------------------------------------------
     
    6378# Used in build_elevation.py
    6479# Format for ascii grids, as produced in ArcGIS + a projection file
    65 ascii_grid_filenames = [] # 250m grid 2005
    66 
    67 # Format for point is x,y,elevation (with header)
     80ascii_grid_filenames = []
     81
     82# Format for points is x,y,elevation (with header)
    6883point_filenames = ['brisbane_250m.txt',
    6984                   'GBR_250m.txt',
     
    7590##    add_csv_header(join(topographies_folder, f), headerlist)
    7691
    77     # BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
     92# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
    7893# Used in build_elevation.py
    79 # Format for points easting,northing (no header)
     94# Format for points: easting,northing (no header)
    8095bounding_polygon_filename = 'bounding_polygon.csv'
    81 bounding_polygon_maxarea = 100000
     96bounding_polygon_maxarea = 125000
    8297
    8398# INTERIOR REGIONS -  for designing the mesh
     
    86101interior_regions_data = []
    87102
     103# add an internal polygon to force different mesh generation
     104# used to test for discretisation error when building elevation
     105# make sure file is in same folder as interior regions and bouding polygon;
     106# format is same (2 column .csv; easting, northing; no header)
     107if internal_polygon:
     108    interior_regions_data.append(['internal_polygon.csv',
     109                                  bounding_polygon_maxarea])
     110
    88111# LAND - used to set the initial stage/water to be offcoast only
    89112# Used in run_model.py.  Format for points easting,northing (no header)
     
    98121# Used in run_building_inundation.py
    99122# Format latitude,longitude etc (geographic)
    100 building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
     123building_exposure_filename = '.csv' # from NEXIS
    101124
    102125# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
     
    107130# Thinned ordering file from Hazard Map (geographic)
    108131# Format is index,latitude,longitude (with header)
    109 urs_order_filename = 'urs_order.csv'
     132urs_order_filename = 'urs_order_simple.csv'
    110133
    111134# Landward bounding points
     
    116139# If a meta-file from EventSelection is used, set 'multi-mux' to True.
    117140# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
    118 ##mux_input_filename = event_number # to be found in event_folder
    119                                     # (ie boundaries/event_number/)
     141##mux_input_filename = 'Java-0016-z.grd'
    120142##multi_mux = False
    121143mux_input_filename = 'event.list'
    122144multi_mux = True
     145
     146# Specify if share cache is to be used
     147# Whatever is specified here will be relative to INUNDATION_HOME/.cache
     148# If nothing is specified, local cache will be used.
     149cachedir = '.python_cache_phII'
    123150
    124151
     
    163190home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
    164191muxhome = os.getenv(ENV_MUXHOME)
     192
     193# Create absolute pathname for cache directory
     194# and change caching to use it
     195if 'cachedir' in dir():
     196    cachedir = join(os.getenv(ENV_INUNDATIONHOME), '.cache', cachedir)
     197    from anuga.caching import caching
     198    caching.set_option('cachedir', cachedir)
    165199   
    166200# check various directories/files that must exist
    167 anuga_folder = join(home, state, scenario_folder, 'anuga')
     201anuga_folder = join(home, state, scenario_name, 'anuga')
    168202topographies_folder = join(anuga_folder, 'topographies')
    169203polygons_folder = join(anuga_folder, 'polygons')
     
    220254# full path to where MUX files (or meta-files) live
    221255mux_input = join(event_folder, mux_input_filename)
    222 #full path to boundary polygon csv
    223 boundary_csv = join(event_folder, 'sts_gauge_' + str(index) +'.csv')
    224 
     256
     257# sts gauge with desired index number - used for wave 'Tb'
     258boundary_csv = join(event_folder, 'sts_gauge_' + str(index) + '.csv')
     259
     260
  • anuga_work/production/australia_ph2/lucinda/project.py

    r6747 r6756  
    88from time import localtime, strftime, gmtime
    99from os.path import join, exists
    10 
     10from anuga.lib.add_csv_header.add_csv_header import add_csv_header
    1111
    1212#-------------------------------------------------------------------------------
     
    1818state = 'australia_ph2'
    1919scenario_name = 'lucinda'
    20 scenario_folder = scenario_name
    2120
    2221#-------------------------------------------------------------------------------
     
    2625# Model specific parameters.
    2726# One or all can be changed each time the run_model script is executed
    28 tide = 0                # difference between MSL and HAT
    29 zone = 55               # specify zone of model
    30 ##central_meridian = 143.5 # nonstandard projection
    31 
    32 
     27
     28central_meridian = 147.0 # Central meridian for projection (optional)
     29#zone = 55
    3330import sys
    3431if len(sys.argv) > 1:
     
    3633else:   
    3734    event_number = 31982    # the event number or the mux file name
    38    
     35
    3936event_number_list = [31982, 51311, 63735] # To piggy back multiple events
    40                                           # using run_multiple_events.py
    41 
     37
     38tide = 0                # difference between MSL and HAT
    4239alpha = 0.1             # smoothing parameter for mesh
    4340friction=0.01           # manning's friction coefficient
    4441starttime=0             # start time for simulation
    45 finaltime=80000          # final time for simulation
    46 
    47 # index is only used when wave = Tb
    48 index = 1889            # index from the PTHA
    49 wave = 'Tb'             # Bf (sts wave) Tb (index wave)
    50 
     42finaltime=1000   #60000 # final time for simulation
    5143setup = 'trial'         # This can be one of three values
    5244                        #    trial - coarsest mesh, fast
    5345                        #    basic - coarse mesh
    5446                        #    final - fine mesh, slowest
     47
     48# index is only used when wave = Tb
     49index = 2313            # index from the PTHA - Y2000 0.257m
     50wave = 'Tb'             # Bf (sts wave) Tb (index wave)
     51
    5552
    5653internal_polygon = False
     
    7067    internal_poly_comment = 'internal'
    7168else:
    72     internal_poly_comment = None
     69    internal_poly_comment = ''
    7370
    7471output_comment = [setup, tide, event_number, index, wave, internal_poly_comment]
     
    8380ascii_grid_filenames = ['grid250m_pro'] # 250m grid 2005
    8481
    85 # Format for point is x,y,elevation (with header)
     82# Format for points is x,y,elevation (with header)
    8683##point_filenames = []
    8784point_filenames = ['ahs100_0.txt',
     
    10097                   'ahs100_13.txt'] # LADS data
    10198
     99### Add csv header list to all files in point_filenames
     100##headerlist = ['x', 'y', 'elevation']
     101##for f in point_filenames:
     102##    add_csv_header(join(topographies_folder, f), headerlist)
     103
    102104# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
    103105# Used in build_elevation.py
    104 # Format for points easting,northing (no header)
     106# Format for points: easting,northing (no header)
    105107bounding_polygon_filename = 'bounding_polygon.csv'
    106108bounding_polygon_maxarea = 125000
     
    131133# Used in run_building_inundation.py
    132134# Format latitude,longitude etc (geographic)
    133 building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
     135building_exposure_filename = '.csv' # from NEXIS
    134136
    135137# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
     
    149151# If a meta-file from EventSelection is used, set 'multi-mux' to True.
    150152# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
    151 ##mux_input_filename = event_number # to be found in event_folder
    152                                     # (ie boundaries/event_number/)
     153##mux_input_filename = 'Java-0016-z.grd'
    153154##multi_mux = False
    154155mux_input_filename = 'event.list'
    155156multi_mux = True
     157
     158# Specify if share cache is to be used
     159# Whatever is specified here will be relative to INUNDATION_HOME/.cache
     160# If nothing is specified, local cache will be used.
     161cachedir = '.python_cache_phII'
    156162
    157163
     
    196202home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
    197203muxhome = os.getenv(ENV_MUXHOME)
     204
     205# Create absolute pathname for cache directory
     206# and change caching to use it
     207if 'cachedir' in dir():
     208    cachedir = join(os.getenv(ENV_INUNDATIONHOME), '.cache', cachedir)
     209    from anuga.caching import caching
     210    caching.set_option('cachedir', cachedir)
    198211   
    199212# check various directories/files that must exist
    200 anuga_folder = join(home, state, scenario_folder, 'anuga')
     213anuga_folder = join(home, state, scenario_name, 'anuga')
    201214topographies_folder = join(anuga_folder, 'topographies')
    202215polygons_folder = join(anuga_folder, 'polygons')
     
    235248event_sts = join(event_folder, scenario_name)
    236249
    237 
    238 
    239250# The absolute pathname for the output folder names
    240251# Used for build_elevation.py
  • anuga_work/production/australia_ph2/lucinda/run_multiple_events.py

    r6747 r6756  
    11"""This script executes models for a range of event numbers.
    22
    3 Events must have been created first
     3Events folders and event.list must have been created first from
     4the event selection program
    45"""
    56
  • anuga_work/production/australia_ph2/rockhampton/project.py

    r6748 r6756  
    88from time import localtime, strftime, gmtime
    99from os.path import join, exists
    10 
     10from anuga.lib.add_csv_header.add_csv_header import add_csv_header
    1111
    1212#-------------------------------------------------------------------------------
     
    1818state = 'australia_ph2'
    1919scenario_name = 'rockhampton'
    20 scenario_folder = scenario_name
    2120
    2221#-------------------------------------------------------------------------------
     
    2625# Model specific parameters.
    2726# One or all can be changed each time the run_model script is executed
    28 tide = 0                # difference between MSL and HAT
    29 zone = 56               # specify zone of model
    30 ##central_meridian = 143.5 # nonstandard projection
    31 
    32 
     27
     28central_meridian = 153.0 # Central meridian for projection (optional)
     29#zone = 56
    3330import sys
    3431if len(sys.argv) > 1:
     
    3633else:   
    3734    event_number = 31939    # the event number or the mux file name
    38    
     35
    3936event_number_list = [31939, 51314, 63737] # To piggy back multiple events
    40                                           # using run_multiple_events.py
    41 
     37
     38tide = 0                # difference between MSL and HAT
    4239alpha = 0.1             # smoothing parameter for mesh
    4340friction=0.01           # manning's friction coefficient
    4441starttime=0             # start time for simulation
    45 finaltime=80000          # final time for simulation
    46 
    47 # index is only used when wave = Tb
    48 index = 1889            # index from the PTHA
    49 wave = 'Tb'             # Bf (sts wave) Tb (index wave)
    50 
     42finaltime=1000   #60000 # final time for simulation
    5143setup = 'trial'         # This can be one of three values
    5244                        #    trial - coarsest mesh, fast
    5345                        #    basic - coarse mesh
    5446                        #    final - fine mesh, slowest
     47
     48# index is only used when wave = Tb
     49index = 3163            # index from the PTHA - Y2000 0.257m
     50wave = 'Tb'             # Bf (sts wave) Tb (index wave)
     51
    5552
    5653internal_polygon = False
     
    7067    internal_poly_comment = 'internal'
    7168else:
    72     internal_poly_comment = None
     69    internal_poly_comment = ''
    7370
    7471output_comment = [setup, tide, event_number, index, wave, internal_poly_comment]
     
    8380ascii_grid_filenames = ['grid250m_pro'] # 250m grid 2005
    8481
    85 # Format for point is x,y,elevation (with header)
     82# Format for points is x,y,elevation (with header)
    8683##point_filenames = []
    8784point_filenames = ['ahs100_0.txt',
     
    10097                   'ahs100_13.txt'] # LADS data
    10198
     99### Add csv header list to all files in point_filenames
     100##headerlist = ['x', 'y', 'elevation']
     101##for f in point_filenames:
     102##    add_csv_header(join(topographies_folder, f), headerlist)
     103
    102104# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
    103105# Used in build_elevation.py
    104 # Format for points easting,northing (no header)
     106# Format for points: easting,northing (no header)
    105107bounding_polygon_filename = 'bounding_polygon.csv'
    106108bounding_polygon_maxarea = 125000
     
    131133# Used in run_building_inundation.py
    132134# Format latitude,longitude etc (geographic)
    133 building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
     135building_exposure_filename = '.csv' # from NEXIS
    134136
    135137# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
     
    149151# If a meta-file from EventSelection is used, set 'multi-mux' to True.
    150152# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
    151 ##mux_input_filename = event_number # to be found in event_folder
    152                                     # (ie boundaries/event_number/)
     153##mux_input_filename = 'Java-0016-z.grd'
    153154##multi_mux = False
    154155mux_input_filename = 'event.list'
    155156multi_mux = True
     157
     158# Specify if share cache is to be used
     159# Whatever is specified here will be relative to INUNDATION_HOME/.cache
     160# If nothing is specified, local cache will be used.
     161cachedir = '.python_cache_phII'
    156162
    157163
     
    196202home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
    197203muxhome = os.getenv(ENV_MUXHOME)
     204
     205# Create absolute pathname for cache directory
     206# and change caching to use it
     207if 'cachedir' in dir():
     208    cachedir = join(os.getenv(ENV_INUNDATIONHOME), '.cache', cachedir)
     209    from anuga.caching import caching
     210    caching.set_option('cachedir', cachedir)
    198211   
    199212# check various directories/files that must exist
    200 anuga_folder = join(home, state, scenario_folder, 'anuga')
     213anuga_folder = join(home, state, scenario_name, 'anuga')
    201214topographies_folder = join(anuga_folder, 'topographies')
    202215polygons_folder = join(anuga_folder, 'polygons')
     
    235248event_sts = join(event_folder, scenario_name)
    236249
    237 
    238 
    239250# The absolute pathname for the output folder names
    240251# Used for build_elevation.py
  • anuga_work/production/australia_ph2/rockhampton/run_multiple_events.py

    r6748 r6756  
    11"""This script executes models for a range of event numbers.
    22
    3 Events must have been created first
     3Events folders and event.list must have been created first from
     4the event selection program
    45"""
    56
Note: See TracChangeset for help on using the changeset viewer.