Changeset 4429
- Timestamp:
- May 15, 2007, 4:13:58 PM (18 years ago)
- Location:
- anuga_work/production/broome_2006
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/broome_2006/build_broome.py
r4366 r4429 83 83 dem2pts(offshore_dir_name1, use_cache=True, verbose=True) 84 84 dem2pts(offshore_dir_name2, use_cache=True, verbose=True) 85 ''' 85 86 86 print'create Geospatial data1 objects from topographies',onshore_dir_name + '.pts' 87 87 G1 = Geospatial_data(file_name = onshore_dir_name + '.pts') … … 110 110 print'export',project.combined_dir_name+'_unclipped' + '.txt' 111 111 G.export_points_file(project.combined_dir_name+'_unclipped' + '.txt') 112 ''' 112 113 113 print'split' 114 114 G_small, G_other = G_clipped.split(.10,verbose=True) … … 120 120 G_small.export_points_file(project.combined_small_dir_name + '.txt') 121 121 #G_clipped.export_points_file(project.combined_dir_name + '.xya') 122 '''123 122 124 ''' 123 124 125 125 print'project.combined_dir_name + 1.xya',project.combined_dir_name + '1.xya' 126 126 G_all=Geospatial_data(file_name = project.combined_dir_name + '1.xya') … … 132 132 G_all_2.export_points_file(project.combined_dir_name+'_other1' + '.xya') 133 133 134 134 ''' 135 135 #------------------------------------------------------------------------- 136 136 # Convert URS to SWW file for boundary conditions 137 137 #------------------------------------------------------------------------- 138 ''' 138 print 'starting to create boundary conditions' 139 boundaries_in_dir_name = project.boundaries_in_dir_name 140 141 from anuga.shallow_water.data_manager import urs2sww, urs_ungridded2sww 142 143 print 'boundaries_in_dir_name',boundaries_in_dir_name 144 print 'project.boundaries_dir_name',project.boundaries_dir_name 145 146 urs_ungridded2sww(boundaries_in_dir_name, project.boundaries_dir_name, 147 verbose=True, mint=4000, maxt=35000, zscale=1) 139 148 140 149 … … 143 152 144 153 145 -
anuga_work/production/broome_2006/export_results.py
r4347 r4429 5 5 from os import sep 6 6 7 time_dir = '20061113_040953' 7 time_dir = '20070423_040235_run' # 8 cellsize = 25 9 timestep = None 10 directory = project.output_dir 11 #name = directory + time_dir + sep + project.scenario_name 12 name = directory+time_dir+sep+project.scenario_name 8 13 9 directory = project.outputdir 10 name = directory + time_dir +sep + 'source' 14 is_parallel = True 15 if is_parallel == True: nodes = 4 16 print 'output dir:', name 11 17 12 print 'output dir:', name 13 which_var = 4 18 which_var = 2 14 19 if which_var == 0: # Stage 15 20 outname = name + '_stage' … … 17 22 18 23 if which_var == 1: # Absolute Momentum 19 outname = name + '_momentum '20 quantityname = '(xmomentum**2 + ymomentum**2)**0.5' #Absolute momentum24 outname = name + '_momentum_i1' 25 quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 21 26 22 27 if which_var == 2: # Depth 23 28 outname = name + '_depth' 24 quantityname = 'stage-elevation' #Depth29 quantityname = 'stage-elevation' 25 30 26 31 if which_var == 3: # Speed 27 outname = name + '_speed '32 outname = name + '_speed_i0' 28 33 quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))' #Speed 29 34 … … 32 37 quantityname = 'elevation' #Elevation 33 38 34 print 'start sww2dem'35 39 36 sww2dem(name, basename_out = outname,37 quantity = quantityname,38 cellsize = 25, # would prefer this at 2539 # define region for viz purposes40 easting_min = project.eastingmin,41 easting_max = project.eastingmax,42 northing_min = project.northingmin,43 northing_max = project.northingmax,44 reduction = max, #this is because we want max quantityname45 verbose = True,46 format = 'asc')47 40 41 if is_parallel == True: 42 # print 'is_parallel',is_parallel 43 for i in range(0,nodes): 44 namei = name + '_P%d_%d' %(i,nodes) 45 outnamei = outname + '_P%d_%d' %(i,nodes) 46 print 'start sww2dem for sww file %d' %(i) 47 sww2dem(namei, basename_out = outnamei, 48 quantity = quantityname, 49 timestep = timestep, 50 cellsize = cellsize, 51 easting_min = project.e_min_area, 52 easting_max = project.e_max_area, 53 northing_min = project.n_min_area, 54 northing_max = project.n_max_area, 55 reduction = max, 56 verbose = True, 57 format = 'asc') 58 else: 59 print 'start sww2dem' 60 sww2dem(name, basename_out = outname, 61 quantity = quantityname, 62 timestep = timestep, 63 cellsize = cellsize, 64 easting_min = project.e_min_area, 65 easting_max = project.e_max_area, 66 northing_min = project.n_min_area, 67 northing_max = project.n_max_area, 68 reduction = max, 69 verbose = True, 70 format = 'asc') -
anuga_work/production/broome_2006/project.py
r4372 r4429 22 22 23 23 #time stuff 24 time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir 24 time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir 25 #time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir 25 26 gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir 26 27 build_time = time+'_build' … … 29 30 30 31 #tide = -5.3 31 #tide = 032 tide = 4.932 tide = 0 33 #tide = 4.9 33 34 34 35 #Making assumptions about the location of scenario data … … 93 94 94 95 95 boundaries_source = ' ????'96 boundaries_source = 'broome_3854_17042007' 96 97 #boundaries locations 97 boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+boundaries_source+sep 98 boundaries_in_dir_name = boundaries_in_dir + scenario_name 98 boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep 99 #boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+boundaries_source+sep 100 boundaries_in_dir_name = boundaries_in_dir + boundaries_source 99 101 boundaries_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep 100 boundaries_dir_name = boundaries_dir + scenario_name102 boundaries_dir_name = boundaries_dir + boundaries_source 101 103 #boundaries_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+build_time+sep 102 104 #boundaries_time_dir_name = boundaries_time_dir + boundaries_name #Used by post processing … … 126 128 poly_all = read_polygon(polygons_dir+'extent_small.csv') 127 129 #poly_all = read_polygon(polygons_dir+'extent.csv') 128 res_poly_all = 500000 129 #res_poly_all = 150000 130 res_factor = 2 131 #res_poly_all = 500000 132 res_poly_all = 150000*res_factor 130 133 131 134 ############################### … … 134 137 135 138 poly_0 = read_polygon(polygons_dir+'neg20_coast_contour_pts.csv') 136 res_0 = 100000137 #res_0 = 20000 139 #res_0 = 100000 140 res_0 = 20000*res_factor 138 141 139 142 poly_1 = read_polygon(polygons_dir+'broome_north_coast_inside_extent.csv') 140 res_1 = 50000141 #res_1 = 5000 143 #res_1 = 50000 144 res_1 = 5000*res_factor 142 145 143 146 poly_2 = read_polygon(polygons_dir+'broome_south_coast_inside_extent.csv') 144 res_2 = 50000145 #res_2 = 5000 147 #res_2 = 50000 148 res_2 = 5000*res_factor 146 149 147 150 poly_3 = read_polygon(polygons_dir+'Broome_town_pts.csv') 148 res_3 = 20000149 #res_3 = 2000 151 #res_3 = 20000 152 res_3 = 2000*res_factor 150 153 151 154 poly_4 = read_polygon(polygons_dir+'Broome_inner_town_pts.csv') 152 res_4 = 5000153 #res_4 = 500 155 #res_4 = 5000 156 res_4 = 500*res_factor 154 157 #assert zone == refzone 155 158 … … 161 164 print 'min number triangles', trigs_min 162 165 166 poly_mainland = read_polygon(polygons_dir+'Initial_Condition.csv') 167 163 168 ################################################################### 164 169 # Clipping regions for export to asc and regions for clipping data … … 166 171 167 172 # exporting asc grid 168 e astingmin = 406215.87169 e astingmax = 440208.78170 n orthingmin = 7983427.73171 n orthingmax = 8032834.52173 e_min_area = 412000.0 174 e_max_area = 423000.0 175 n_min_area = 8007000.0 176 n_max_area = 8022000.0 172 177 173 178 -
anuga_work/production/broome_2006/run_broome.py
r4372 r4429 81 81 interior_regions=project.interior_regions, 82 82 filename=meshes_dir_name, 83 use_cache= True,83 use_cache=False, 84 84 verbose=True) 85 85 … … 92 92 print 'Setup computational domain' 93 93 #domain = Domain(meshes_time_dir_name, use_cache=True, verbose=True) 94 domain = Domain(meshes_dir_name, use_cache= True, verbose=True)94 domain = Domain(meshes_dir_name, use_cache=False, verbose=True) 95 95 print domain.statistics() 96 '''97 print 'starting to create boundary conditions'98 boundaries_in_dir_name = project.boundaries_in_dir_name99 100 from anuga.shallow_water.data_manager import urs2sww, ferret2sww101 102 # put above distribute103 print 'boundary file is: ',boundaries_dir_name104 from caching import cache105 if myid == 0:106 cache(ferret2sww,107 (boundaries_in_dir_name,108 # boundaries_time_dir_name),109 boundaries_dir_name),110 {'verbose': True,111 'minlat': project.south_boundary,112 'maxlat': project.north_boundary,113 'minlon': project.west_boundary,114 'maxlon': project.east_boundary,115 # 'minlat': project.south,116 # 'maxlat': project.north,117 # 'minlon': project.west,118 # 'maxlon': project.east,119 'mint': 0, 'maxt': 35100,120 'origin': domain.geo_reference.get_origin(),121 'mean_stage': project.tide,122 # 'zscale': 1, #Enhance tsunami123 'fail_on_NaN': False},124 verbose = True,125 )126 barrier()127 '''128 96 129 97 #------------------------------------------------------------------------- … … 134 102 print 'Setup initial conditions' 135 103 136 domain.set_quantity('stage', tide) 137 domain.set_quantity('friction', 0.01) 104 from polygon import Polygon_function 105 #following sets the stage/water to be offcoast only 106 IC = Polygon_function( [(project.poly_mainland, -1.0)], default = tide, 107 geo_reference = domain.geo_reference) 108 domain.set_quantity('stage', IC) 138 109 #combined_time_dir_name = project.topographies_dir+build_time+project.combined_name 139 110 print 'Start Set quantity' 140 111 print 'project.combined_dir_name_unclipped1',project.combined_dir_name_unclipped1+'.txt' 141 112 domain.set_quantity('elevation', 113 # filename = project.combined_dir_name+'.txt', 142 114 filename = project.combined_dir_name_unclipped1+'.txt', 143 115 # filename = project.combined_smaller_name_dir+'.xya', … … 175 147 print 'domain id', id(domain) 176 148 #Bf = File_boundary(boundaries_dir_name + '.sww', 177 # domain, time_thinning=5, use_cache=True, verbose=True) 149 # domain, time_thinning=12, use_cache=True, verbose=True) 150 Bf = Field_boundary(boundaries_dir_name + '.sww', 151 domain, time_thinning=1, mean_stage=tide, 152 use_cache=True, verbose=True) 178 153 179 154 print 'finished reading boundary file' … … 185 160 domain.set_boundary({'back': Br, 186 161 'side': Bd, 187 'ocean': Bd}) 162 'ocean': Bf}) 163 # 'ocean': Bd}) 188 164 print'finish set boundary' 189 165 … … 194 170 t0 = time.time() 195 171 196 for t in domain.evolve(yieldstep = 60, finaltime = 10000):172 for t in domain.evolve(yieldstep = 60, finaltime = 30000): 197 173 domain.write_time() 198 174 domain.write_boundary_statistics(tags = 'ocean') 199 if allclose(t, 120):200 domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bo})175 # if allclose(t, 120): 176 # domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bo}) 201 177 202 if allclose(t, 1020):203 domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bd})178 # if allclose(t, 1020): 179 # domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bd}) 204 180 205 181
Note: See TracChangeset
for help on using the changeset viewer.