Changeset 6773


Ignore:
Timestamp:
Apr 8, 2009, 4:47:05 PM (15 years ago)
Author:
kristy
Message:
 
File:
1 edited

Legend:

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

    r6731 r6773  
    88from time import localtime, strftime, gmtime
    99from os.path import join, exists
    10 from os import sep
    11 
     10from anuga.lib.add_csv_header.add_csv_header import add_csv_header
    1211
    1312#-------------------------------------------------------------------------------
     
    1918state = 'australia_ph2'
    2019scenario_name = 'sydney'
    21 scenario_folder = scenario_name
    2220
    2321#-------------------------------------------------------------------------------
     
    2725# Model specific parameters.
    2826# One or all can be changed each time the run_model script is executed
     27
     28central_meridian = 151 # Central meridian for projection (optional)
     29zone = None
     30import sys
     31if len(sys.argv) > 1:
     32    event_number = int(sys.argv[1])
     33else:   
     34    event_number = 58152    # the event number or the mux file name
     35
     36event_number_list = [58152, 58222, 58326] # To piggy back multiple events
     37
     38# events: 27346 (java 2.1e-6), 58334 (puysegur 8.8e-7), 64322 (sandwich 8.2e-6),
     39# other events: 51466 (newHebrides 7.2e-7), 57537 (peru 4.7e-7), 46591 (midAmerica 1.3e-6),
     40# 68791 (sumatra 7.5e-7), 11100 (andaman 4.9e-7), 65368 (shetland 2.5e-6), 7867 (altiplano 1.0e-6)
    2941tide = 0                # difference between MSL and HAT
    30 zone = 56              # specify zone of model
    31 event_number = 58152    # the event number or the mux file name
    3242alpha = 0.1             # smoothing parameter for mesh
    3343friction=0.01           # manning's friction coefficient
    3444starttime=0             # start time for simulation
    35 finaltime=80000          # final time for simulation
    36 
    37 # index is only used when wave = Tb
    38 index = 2956            # index from the PTHA
    39 wave = 'Tb'             # Bf (sts wave) Tb (index wave)
    40 
    41 setup = 'final'         # This can be one of three values
     45finaltime=1000   #60000 # final time for simulation
     46setup = 'trial'         # This can be one of three values
    4247                        #    trial - coarsest mesh, fast
    4348                        #    basic - coarse mesh
    4449                        #    final - fine mesh, slowest
     50
     51# index is only used when wave = Tb
     52index = 2938            # index from the PTHA - Y2000 0.257m
     53wave = 'Tb'             # Bf (sts wave) Tb (index wave)
     54
     55
     56internal_polygon = False
    4557
    4658#-------------------------------------------------------------------------------
     
    5567#-------------------------------------------------------------------------------
    5668
    57 output_comment = [setup, tide, event_number, index, wave]
     69if internal_polygon:
     70    internal_poly_comment = 'internal'
     71else:
     72    internal_poly_comment = ''
     73
     74output_comment = [setup, tide, event_number, index, wave, internal_poly_comment]
    5875
    5976#-------------------------------------------------------------------------------
     
    6481# Used in build_elevation.py
    6582# Format for ascii grids, as produced in ArcGIS + a projection file
    66 ascii_grid_filenames = [] # 250m grid 2005
    67 
    68 # Format for point is x,y,elevation (with header)
    69 point_filenames = ['sydney_elevation.txt',
    70                    'melbourne_elevation.txt'] # 250m grid 2005
     83ascii_grid_filenames = ['grid_250m_simple']
     84
     85# Format for points is x,y,elevation (with header)
     86point_filenames = []
     87##point_filenames = ['sydney_elevation.txt',
     88##                   'melbourne_elevation.txt'] # 250m grid 2005
    7189
    7290### Add csv header list to all files in point_filenames
     
    7593##    add_csv_header(join(topographies_folder, f), headerlist)
    7694
    77     # BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
     95# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
    7896# Used in build_elevation.py
    79 # Format for points easting,northing (no header)
    80 bounding_polygon_filename = 'bounding_polygon.csv'
    81 bounding_polygon_maxarea = 100000
     97# Format for points: easting,northing (no header)
     98bounding_polygon_filename = 'bounding_polygon_simple.csv'
     99bounding_polygon_maxarea = 125000
    82100
    83101# INTERIOR REGIONS -  for designing the mesh
     
    86104interior_regions_data = []
    87105
     106# add an internal polygon to force different mesh generation
     107# used to test for discretisation error when building elevation
     108# make sure file is in same folder as interior regions and bouding polygon;
     109# format is same (2 column .csv; easting, northing; no header)
     110if internal_polygon:
     111    interior_regions_data.append(['internal_polygon.csv',
     112                                  bounding_polygon_maxarea])
     113
    88114# LAND - used to set the initial stage/water to be offcoast only
    89115# Used in run_model.py.  Format for points easting,northing (no header)
     
    93119# Used in get_timeseries.py. 
    94120# Format easting,northing,name,elevation (with header)
    95 gauges_filename = 'MH_gauges_10m2.csv' #'gauges.csv'
     121gauges_filename = 'gauges.csv'
    96122
    97123# BUILDINGS EXPOSURE - for identifying inundated houses
    98124# Used in run_building_inundation.py
    99125# Format latitude,longitude etc (geographic)
    100 building_exposure_filename = 'sydney_res_clip.csv' # from NEXIS
     126building_exposure_filename = '.csv' # from NEXIS
    101127
    102128# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
     
    107133# Thinned ordering file from Hazard Map (geographic)
    108134# Format is index,latitude,longitude (with header)
    109 urs_order_filename = 'urs_order.csv'
     135urs_order_filename = 'urs_order_simple.csv'
    110136
    111137# Landward bounding points
    112138# Format easting,northing (no header)
    113 landward_boundary_filename = 'landward_boundary.csv'
     139landward_boundary_filename = 'landward_boundary_simple.csv'
    114140
    115141# MUX input filename.
    116142# If a meta-file from EventSelection is used, set 'multi-mux' to True.
    117143# 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/)
     144##mux_input_filename = 'Java-0016-z.grd'
    120145##multi_mux = False
    121146mux_input_filename = 'event.list'
    122147multi_mux = True
    123148
    124 
     149# Specify if share cache is to be used
     150# Whatever is specified here will be relative to INUNDATION_HOME/.cache
     151# If nothing is specified, local cache will be used.
     152cachedir = '.python_cache_phII'
    125153
    126154
     
    150178# Output filename for elevation
    151179# this is a combination of all the data generated in build_elevation.py
    152 combined_elevation_basename = scenario_name + '_combined_elevation'
     180combined_elevation_basename = scenario_name + 'simple_combined_elevation'
    153181
    154182#-------------------------------------------------------------------------------
     
    165193home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
    166194muxhome = os.getenv(ENV_MUXHOME)
     195
     196# Create absolute pathname for cache directory
     197# and change caching to use it
     198if 'cachedir' in dir():
     199    cachedir = join(os.getenv(ENV_INUNDATIONHOME), '.cache', cachedir)
     200    from anuga.caching import caching
     201    caching.set_option('cachedir', cachedir)
    167202   
    168203# check various directories/files that must exist
    169 anuga_folder = join(home, state, scenario_folder, 'anuga')
     204anuga_folder = join(home, state, scenario_name, 'anuga')
    170205topographies_folder = join(anuga_folder, 'topographies')
    171206polygons_folder = join(anuga_folder, 'polygons')
     
    223258mux_input = join(event_folder, mux_input_filename)
    224259
    225 boundary_csv = event_folder + sep + 'sts_gauge_' + str(index) +'.csv'
     260# sts gauge with desired index number - used for wave 'Tb'
     261boundary_csv = join(event_folder, 'sts_gauge_' + str(index) + '.csv')
     262
     263
Note: See TracChangeset for help on using the changeset viewer.