Changeset 4003
- Timestamp:
- Nov 17, 2006, 10:24:43 AM (18 years ago)
- 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 10 10 polygon_area, is_inside_polygon 11 11 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:', user22 23 # INUNDATIONHOME is the inundation directory, not the data directory.24 home += sep +'data'25 26 #Making assumptions about the location of scenario data27 state = 'queensland'28 scenario_dir_name = 'cairns_tsunami_scenario_demo'29 30 # onshore data provided by WA DLI31 demname = 'cairns'32 33 #swollen/ all data output34 basename = 'source'35 codename = 'project.py'36 37 #Derive subdirectories and filenames38 local_time = strftime('%Y%m%d_%H%M%S',gmtime())39 meshdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'meshes'+sep40 datadir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'topographies'+sep41 gaugedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'gauges'+sep42 polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep43 boundarydir = home+sep+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'boundaries'+sep44 outputdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep45 outputtimedir = outputdir + local_time + sep46 polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep47 48 gauge_filename = gaugedir + 'gauges.csv'49 codedir = getcwd()+sep50 codedirname = codedir + 'project.py'51 #meshname = outputtimedir + 'mesh_' + basename52 53 # Necessary if using point datasets, rather than grid54 dem_name = datadir + demname55 56 12 ############################### 57 13 # Domain definitions … … 59 15 60 16 # bounding polygon for study area 61 polyAll = read_polygon( polygondir+'extent_v2.csv')17 polyAll = read_polygon('extent.csv') 62 18 63 19 print 'Area of bounding polygon', polygon_area(polyAll)/1000000.0 20 21 ############################### 22 # Interior region definitions 23 ############################### 24 25 # interior polygons 26 poly_cairns = read_polygon('cairns.csv') 27 poly_island0 = read_polygon('islands.csv') 28 poly_island1 = read_polygon('islands1.csv') 29 poly_island2 = read_polygon('islands2.csv') 30 poly_island3 = read_polygon('islands3.csv') 31 poly_shallow = read_polygon('shallow.csv') 32 33 plot_polygons([polyAll,poly_cairns,poly_island0,poly_island1,\ 34 poly_island2,poly_island3,poly_shallow],\ 35 'boundingpoly',verbose=False) 64 36 65 37 ################################################################### … … 73 45 northingmax = 8148700 74 46 75 ###############################76 # Interior region definitions77 ###############################78 47 79 # broome digitized polygons80 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 = 98693 48 slump_origin = [451871, 8128376] # move onto the continental shelf, depth = 500 94 49 slump_depth = 500. 50 51 gauge_filename = 'gauges.csv' -
anuga_core/documentation/user_manual/demos/cairns/runcairns.py
r3979 r4003 28 28 from anuga.abstract_2d_finite_volumes.combine_pts import combine_rectangular_points_files 29 29 from anuga.geospatial_data.geospatial_data import * 30 from anuga.abstract_2d_finite_volumes.util import Screen_Catcher31 30 32 31 # Application specific imports … … 36 35 # Define scenario as either slump or fixed_wave. 37 36 #------------------------------------------------------------------------------- 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 37 scenario = 'slump' # OR 'fixed_wave' 38 if access(scenario,F_OK) == 0: 39 mkdir (scenario) 40 basename = scenario + 'source' 63 41 64 42 #------------------------------------------------------------------------------- … … 69 47 70 48 # filenames 71 dem_name = project.dem_name72 meshname = project.meshname+'.msh'49 dem_name = 'cairns' 50 meshname = 'cairns.msh' 73 51 74 52 # creates DEM from asc data … … 116 94 print domain.statistics() 117 95 118 domain.set_name(basename) #domain.set_name(project.basename)119 domain.set_datadir(scenario) #domain.set_datadir(project.outputtimedir)96 domain.set_name(basename) 97 domain.set_datadir(scenario) 120 98 domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum']) 121 99 domain.set_minimum_storable_height(0.01) … … 129 107 domain.set_quantity('friction', 0.0) 130 108 domain.set_quantity('elevation', 131 filename = project.dem_name + '.pts',109 filename = dem_name + '.pts', 132 110 use_cache = True, 133 111 verbose = True,
Note: See TracChangeset
for help on using the changeset viewer.