Changeset 4003


Ignore:
Timestamp:
Nov 17, 2006, 10:24:43 AM (18 years ago)
Author:
sexton
Message:

including data and supporting files for Cairns demo + updating scripts

Location:
anuga_core/documentation/user_manual/demos/cairns
Files:
9 added
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/documentation/user_manual/demos/cairns/project.py

    r3979 r4003  
    1010                                    polygon_area, is_inside_polygon
    1111
    12 if sys.platform == 'win32':
    13     home = getenv('INUNDATIONHOME')
    14     user = getenv('USERPROFILE')
    15 
    16 else:   
    17     home = getenv('INUNDATIONHOME', sep+'d'+sep+'xrd'+sep+'gem'+sep+\
    18                   '2'+sep+'ramp'+sep+'risk_assessment_methods_project'+\
    19                   sep+'inundation')     
    20     user = getenv('LOGNAME')
    21     print 'USER:', user
    22 
    23 # INUNDATIONHOME is the inundation directory, not the data directory.
    24 home += sep +'data'
    25 
    26 #Making assumptions about the location of scenario data
    27 state = 'queensland'
    28 scenario_dir_name = 'cairns_tsunami_scenario_demo'
    29 
    30 # onshore data provided by WA DLI
    31 demname = 'cairns'
    32 
    33 #swollen/ all data output
    34 basename = 'source'
    35 codename = 'project.py'
    36 
    37 #Derive subdirectories and filenames
    38 local_time = strftime('%Y%m%d_%H%M%S',gmtime())
    39 meshdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'meshes'+sep
    40 datadir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'topographies'+sep
    41 gaugedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'gauges'+sep
    42 polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep
    43 boundarydir = home+sep+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'boundaries'+sep
    44 outputdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep
    45 outputtimedir = outputdir + local_time + sep
    46 polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep
    47 
    48 gauge_filename = gaugedir + 'gauges.csv'
    49 codedir = getcwd()+sep                           
    50 codedirname = codedir + 'project.py'
    51 #meshname = outputtimedir + 'mesh_' + basename
    52 
    53 # Necessary if using point datasets, rather than grid
    54 dem_name = datadir + demname
    55 
    5612###############################
    5713# Domain definitions
     
    5915
    6016# bounding polygon for study area
    61 polyAll = read_polygon(polygondir+'extent_v2.csv')
     17polyAll = read_polygon('extent.csv')
    6218
    6319print 'Area of bounding polygon', polygon_area(polyAll)/1000000.0
     20
     21###############################
     22# Interior region definitions
     23###############################
     24
     25# interior polygons
     26poly_cairns = read_polygon('cairns.csv')
     27poly_island0 = read_polygon('islands.csv')
     28poly_island1 = read_polygon('islands1.csv')
     29poly_island2 = read_polygon('islands2.csv')
     30poly_island3 = read_polygon('islands3.csv')
     31poly_shallow = read_polygon('shallow.csv')
     32
     33plot_polygons([polyAll,poly_cairns,poly_island0,poly_island1,\
     34               poly_island2,poly_island3,poly_shallow],\
     35              'boundingpoly',verbose=False)
    6436
    6537###################################################################
     
    7345northingmax = 8148700
    7446
    75 ###############################
    76 # Interior region definitions
    77 ###############################
    7847
    79 # broome digitized polygons
    80 poly_cairns = read_polygon(polygondir+'cairns.csv')
    81 poly_island0 = read_polygon(polygondir+'islands.csv')
    82 poly_island1 = read_polygon(polygondir+'islands1.csv')
    83 poly_island2 = read_polygon(polygondir+'islands2.csv')
    84 poly_island3 = read_polygon(polygondir+'islands3.csv')
    85 poly_shallow = read_polygon(polygondir+'shallow.csv')
    86 
    87 plot_polygons([polyAll,poly_cairns,poly_island0,poly_island1,\
    88                poly_island2,poly_island3,poly_shallow],\
    89               'boundingpoly',verbose=False)
    90 
    91 #slump_origin = [633361, 8129700]
    92 #slump_depth = 986
    9348slump_origin = [451871, 8128376] # move onto the continental shelf, depth = 500
    9449slump_depth = 500.
     50
     51gauge_filename = 'gauges.csv'
  • anuga_core/documentation/user_manual/demos/cairns/runcairns.py

    r3979 r4003  
    2828from anuga.abstract_2d_finite_volumes.combine_pts import combine_rectangular_points_files
    2929from anuga.geospatial_data.geospatial_data import *
    30 from anuga.abstract_2d_finite_volumes.util import Screen_Catcher
    3130
    3231# Application specific imports
     
    3635# Define scenario as either slump or fixed_wave.
    3736#-------------------------------------------------------------------------------
    38 scenario = 'slump' # 'fixedwave'
    39 mkdir (scenario)
    40 basename = scenario + project.basename
    41 
    42 #-------------------------------------------------------------------------------
    43 # Copy scripts to time stamped output directory and capture screen
    44 # output to file
    45 #-------------------------------------------------------------------------------
    46 
    47 # creates copy of code in output dir if dir doesn't exist
    48 if access(project.outputtimedir,F_OK) == 0 :
    49     mkdir (project.outputtimedir)
    50 copy (project.codedirname, project.outputtimedir + project.codename)
    51 copy (project.codedir + 'runcairns.py', project.outputtimedir + 'runcairns2.py')
    52 print'output dir', project.outputtimedir
    53 
    54 #normal screen output is stored in
    55 screen_output_name = project.outputtimedir + "screen_output.txt"
    56 screen_error_name = project.outputtimedir + "screen_error.txt"
    57 
    58 #used to catch screen output to file
    59 sys.stdout = Screen_Catcher(screen_output_name)
    60 sys.stderr = Screen_Catcher(screen_error_name)
    61 
    62 print 'USER:    ', project.user
     37scenario = 'slump' # OR 'fixed_wave'
     38if access(scenario,F_OK) == 0:
     39    mkdir (scenario)
     40basename = scenario + 'source'
    6341
    6442#-------------------------------------------------------------------------------
     
    6947
    7048# filenames
    71 dem_name = project.dem_name
    72 meshname = project.meshname+'.msh'
     49dem_name = 'cairns'
     50meshname = 'cairns.msh'
    7351
    7452# creates DEM from asc data
     
    11694print domain.statistics()
    11795
    118 domain.set_name(basename) #domain.set_name(project.basename)
    119 domain.set_datadir(scenario) #domain.set_datadir(project.outputtimedir)
     96domain.set_name(basename)
     97domain.set_datadir(scenario)
    12098domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum'])
    12199domain.set_minimum_storable_height(0.01)
     
    129107domain.set_quantity('friction', 0.0)
    130108domain.set_quantity('elevation',
    131                     filename = project.dem_name + '.pts',
     109                    filename = dem_name + '.pts',
    132110                    use_cache = True,
    133111                    verbose = True,
Note: See TracChangeset for help on using the changeset viewer.