Ignore:
Timestamp:
Feb 11, 2009, 3:53:48 PM (16 years ago)
Author:
rwilson
Message:

Checked in to get a copy on nautilus for final testing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/busselton/standardised_version/project.py

    r6308 r6312  
    1414#-----
    1515# Get system data - don't fiddle with this.
     16# These values can be used to distinguish between two similar runs by two
     17# different users or runs by the same user on two different machines.
    1618#-----
    1719
     
    5254# Important to distinguish each run - ensure str(user) is included!
    5355# Note, the user is free to include as many parameters as desired
     56# This should be moved to run_model.py, with the user providing the list to join
     57# for example: output_comment_list = [setup, str(tide), str(event_number), str(user)]
    5458output_comment = '_'.join([setup, str(tide), str(event_number), str(user)])
    5559
     
    7983# Format for points easting,northing (no header)
    8084bounding_polygon_filename = 'bounding_polygon.csv'
     85bounding_polygon_maxarea = 100000
    8186
    8287# INTERIOR REGIONS -  for designing the mesh
     
    121126# MUX input filename
    122127# Must exist in $MUXHOME/mux directory.
    123 # If MUX file not used, do "mux_input_file = None".
    124 mux_input_file = 'event_031451.list'          # File produced by EventSelection
     128# File is prodiced by EventSelection.
     129# If MUX file not used, do "mux_input_filename = None".
     130mux_input_filename = r'C:\temp\event_026633.list'
    125131
    126132#-------------------------------------------------------------------------------
     
    162168ENV_MUXHOME = 'MUXHOME'
    163169
    164 # Check we have required environment variables set
    165 sanity_error = False               # checked at bottom of this file
    166 
    167 if os.getenv(ENV_INUNDATIONHOME) is None:
    168     print "Environment variable '%s' is not set" % ENV_INUNDATIONHOME
    169     sanity_error = True
    170 
    171 if os.getenv(ENV_MUXHOME) is None:
    172     print "Environment variable '%s' is not set" % ENV_MUXHOME
    173     sanity_error = True
    174 
    175 # check for errors detected so far
    176 if sanity_error:
    177     print 'You must fix the above errors before continuing.'
    178     sys.exit(10)
     170### Check we have required environment variables set
     171##sanity_error = False               # checked at bottom of this file
     172##
     173##if os.getenv(ENV_INUNDATIONHOME) is None:
     174##    print "Environment variable '%s' is not set" % ENV_INUNDATIONHOME
     175##    sanity_error = True
     176##
     177##if os.getenv(ENV_MUXHOME) is None:
     178##    print "Environment variable '%s' is not set" % ENV_MUXHOME
     179##    sanity_error = True
     180##
     181### check for errors detected so far
     182##if sanity_error:
     183##    print 'You must fix the above errors before continuing.'
     184##    sys.exit(10)
    179185
    180186#-------------------------------------------------------------------------------
     
    198204# create paths generated from environment variables.
    199205home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
    200 if not exists(home):
    201     print "Sorry, data directory '%s' doesn't exist" % home
    202     sanity_error = True
     206##if not exists(home):
     207##    print "Sorry, data directory '%s' doesn't exist" % home
     208##    sanity_error = True
    203209   
    204210muxhome = os.getenv(ENV_MUXHOME)
    205 if not exists(muxhome):
    206     print "Sorry, MUX directory '%s' doesn't exist" % muxhome
    207     sanity_error = True
     211##if not exists(muxhome):
     212##    print "Sorry, MUX directory '%s' doesn't exist" % muxhome
     213##    sanity_error = True
    208214   
    209 # if mux_input_file has been defined, check if file exists
    210 if mux_input_file:
    211     if not exists(join(muxhome, mux_input_file)):
    212         print ("Sorry, MUX input file '%s' doesn't exist"
    213                % join(muxhome, mux_input_file))
    214         sanity_error = True
    215 
    216 # check various directories that must exist
     215# check various directories/files that must exist
    217216anuga_folder = join(home, state, scenario_folder, 'anuga')
    218 if not exists(anuga_folder):
    219     print "Sorry, ANUGA directory '%s' doesn't exist" % anuga_folder
    220     sanity_error = True
     217##if not exists(anuga_folder):
     218##    print "Sorry, ANUGA directory '%s' doesn't exist" % anuga_folder
     219##    sanity_error = True
    221220
    222221topographies_folder = join(anuga_folder, 'topographies')
    223 if not exists(topographies_folder):
    224     print "Sorry, topo directory '%s' doesn't exist" % topographies_folder
    225     sanity_error = True
     222##if not exists(topographies_folder):
     223##    print "Sorry, topo directory '%s' doesn't exist" % topographies_folder
     224##    sanity_error = True
    226225
    227226polygons_folder = join(anuga_folder, 'polygons')
    228 if not exists(polygons_folder):
    229     print "Sorry, polygon directory '%s' doesn't exist" % polygons_folder
    230     sanity_error = True
     227##if not exists(polygons_folder):
     228##    print "Sorry, polygon directory '%s' doesn't exist" % polygons_folder
     229##    sanity_error = True
    231230
    232231boundaries_folder = join(anuga_folder, 'boundaries')
    233 if not exists(boundaries_folder):
    234     print "Sorry, boundaries directory '%s' doesn't exist" % boundaries_folder
    235     sanity_error = True
     232##if not exists(boundaries_folder):
     233##    print "Sorry, boundaries directory '%s' doesn't exist" % boundaries_folder
     234##    sanity_error = True
    236235
    237236output_folder = join(anuga_folder, 'outputs')
    238 if not exists(output_folder):
    239     print "Sorry, outputs directory '%s' doesn't exist" % output_folder
    240     sanity_error = True
     237##if not exists(output_folder):
     238##    print "Sorry, outputs directory '%s' doesn't exist" % output_folder
     239##    sanity_error = True
    241240
    242241gauges_folder = join(anuga_folder, 'gauges')
    243 if not exists(gauges_folder):
    244     print "Sorry, gauges directory '%s' doesn't exist" % gauges_folder
    245     sanity_error = True
     242##if not exists(gauges_folder):
     243##    print "Sorry, gauges directory '%s' doesn't exist" % gauges_folder
     244##    sanity_error = True
    246245
    247246meshes_folder = join(anuga_folder, 'meshes')
    248 if not exists(meshes_folder):
    249     print "Sorry, meshes directory '%s' doesn't exist" % meshes_folder
    250     sanity_error = True
    251 
     247##if not exists(meshes_folder):
     248##    print "Sorry, meshes directory '%s' doesn't exist" % meshes_folder
     249##    sanity_error = True
     250
     251### if mux_input_filename has been defined, check if file exists
     252##if mux_input_filename:
     253##    if not exists(mux_input_filename):
     254##        print ("Sorry, MUX input file '%s' doesn't exist" % mux_input_filename)
     255##        sanity_error = True
     256
     257#-----
     258# If these directories don't exist initially, create them.
     259# This should be moved to run_model.py.
     260#-----
     261
     262event_folder = join(boundaries_folder, str(event_number))
     263if not exists(event_folder):
     264    print "Creating directory 'event_folder'=%s" % event_folder
     265    os.mkdir(event_folder)
    252266
    253267#-------------------------------------------------------------------------------
     
    306320    time_thinning = 4
    307321    yieldstep = 60
    308 else:
    309     print ("Sorry, you must set the 'setup' variable to one of 'trial', "
    310            "'basic' or 'final'. I found '%s'" % str(setup))
    311     sanity_error = True
     322##else:
     323##    print ("Sorry, you must set the 'setup' variable to one of 'trial', "
     324##           "'basic' or 'final'. I found '%s'" % str(setup))
     325##    sanity_error = True
    312326
    313327#-------------------------------------------------------------------------------
     
    330344bounding_polygon = read_polygon(join(polygons_folder,
    331345                                     bounding_polygon_filename))
    332 bounding_maxarea = 100000*scale_factor
     346bounding_maxarea = bounding_polygon_maxarea*scale_factor
    333347
    334348# Estimate the number of triangles                     
     
    336350                                  bounding_polygon, bounding_maxarea)
    337351
    338 #-------------------------------------------------------------------------------
    339 # Check for errors detected above.
    340 #-------------------------------------------------------------------------------
    341 
    342 if sanity_error:
    343     print 'You must fix the above errors before continuing.'
    344     sys.exit(10)
     352###-------------------------------------------------------------------------------
     353### Check for errors detected above.
     354###-------------------------------------------------------------------------------
     355##
     356##if sanity_error:
     357##    print 'You must fix the above errors before continuing.'
     358##    sys.exit(10)
    345359
    346360
Note: See TracChangeset for help on using the changeset viewer.