Changeset 5669
- Timestamp:
- Aug 20, 2008, 7:44:49 AM (16 years ago)
- Location:
- anuga_work/production
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/busselton/export_results.py
r5655 r5669 6 6 7 7 8 time_dir = '2008081 2_165858_run_final_0.0_polyline_newExtent_kvanputt'8 time_dir = '20080815_103708_run_final_0.6_polyline_newExtent_kvanputt' 9 9 10 10 11 11 cellsize = 25 12 12 #cellsize = 150 13 timestep = 013 #timestep = 0 14 14 directory = project.output_dir 15 15 name = directory+sep+time_dir+sep+project.scenario_name … … 24 24 print 'output dir:', name 25 25 26 var = [0,4]26 #var = [0,4] 27 27 #var = [2,3] # depth and Speed 28 #var = [2,3,4] # elevation, depth and Speed28 var = [2,3] # elevation, depth and Speed 29 29 30 30 … … 71 71 sww2dem(name, basename_out = outname, 72 72 quantity = quantityname, 73 timestep = timestep,73 #timestep = timestep, 74 74 cellsize = cellsize, 75 75 number_of_decimal_places = 4, -
anuga_work/production/busselton/export_results_all.py
r5647 r5669 2 2 import sys 3 3 4 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts 4 5 from anuga.shallow_water.data_manager import sww2dem 5 6 from os import sep 6 7 7 8 8 time_dir = '20080807_102253_run_final_0.0_polyline_newExtent_kvanputt' 9 10 11 12 cellsize = 5 13 #timestep = 0 14 directory = project.output_dir 15 name = directory+time_dir+sep+project.scenario_name # test folder take out!! 16 17 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts 18 9 #time_dir = '20080815_103708_run_final_0.6_polyline_newExtent_kvanputt' 10 time_dir = '20080815_103818_run_final_0_polyline_newExtent_kvanputt' 19 11 20 12 is_parallel = False 21 13 #is_parallel = True 14 if is_parallel == True: nodes = 4 22 15 23 if is_parallel == True: nodes = 424 print 'output dir:', name25 16 26 area = ['Busselton', 'Bunbury', 'Dunsborough'] 17 cellsize = 15 18 #timestep = 0 19 directory = project.output_dir 20 name1 = directory+time_dir+sep+project.scenario_name 21 name2 = directory+time_dir+sep+'busselton_time_38340'+sep+project.scenario_name+'_time_38340_0' 27 22 28 for which_area in area: 29 if which_area == 'Busselton': 30 easting_min = project.xminBusselton 31 easting_max = project.xmaxBusselton 32 northing_min = project.yminBusselton 33 northing_max = project.ymaxBusselton 23 names= [name1, name2] 24 for name in names: 34 25 35 if which_area == 'Bunbury': 36 easting_min = project.xminBunbury 37 easting_max = project.xmaxBunbury 38 northing_min = project.yminBunbury 39 northing_max = project.ymaxBunbury 26 area = ['Busselton', 'Bunbury', 'Dunsborough'] 40 27 41 if which_area == 'Dunsborough': 42 easting_min = project.xminDunsborough 43 easting_max = project.xmaxDunsborough 44 northing_min = project.yminDunsborough 45 northing_max = project.ymaxDunsborough 28 for which_area in area: 29 if which_area == 'Busselton': 30 easting_min = project.xminBusselton 31 easting_max = project.xmaxBusselton 32 northing_min = project.yminBusselton 33 northing_max = project.ymaxBusselton 46 34 47 var = [2,3] # depth and speed 48 #var = [2] # depth 49 #var = [0,4] 35 if which_area == 'Bunbury': 36 easting_min = project.xminBunbury 37 easting_max = project.xmaxBunbury 38 northing_min = project.yminBunbury 39 northing_max = project.ymaxBunbury 50 40 51 for which_var in var: 52 if which_var == 0: # Stage 53 outname = name + which_area + '_stage' 54 quantityname = 'stage' 41 var = [2] # momentum and depth 42 #var = [2] # depth 43 #var = [0,4] 55 44 56 if which_var == 1: # Absolute Momentum 57 outname = name + which_area + '_momentum' 58 quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 45 for which_var in var: 46 if which_var == 0: # Stage 47 outname = name + which_area + '_stage' 48 quantityname = 'stage' 59 49 60 if which_var == 2: # Depth61 outname = name + which_area + '_depth'62 quantityname = 'stage-elevation'50 if which_var == 1: # Absolute Momentum 51 outname = name + which_area + '_momentum' 52 quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 63 53 64 if which_var == 3: # Speed65 outname = name + which_area + '_speed'66 quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))' #Speed54 if which_var == 2: # Depth 55 outname = name + which_area + '_depth' 56 quantityname = 'stage-elevation' 67 57 68 if which_var == 4: # Elevation69 outname = name + which_area + '_elevation'70 quantityname = 'elevation' #Elevation58 if which_var == 3: # Speed 59 outname = name + which_area + '_speed' 60 quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))' #Speed 71 61 72 if is_parallel == True: 73 # print 'is_parallel',is_parallel 74 for i in range(0,nodes): 75 namei = name + '_P%d_%d' %(i,nodes) 76 outnamei = outname + '_P%d_%d' %(i,nodes) 77 print 'start sww2dem for sww file %d' %(i) 78 sww2dem(namei, basename_out = outnamei, 62 if which_var == 4: # Elevation 63 outname = name + which_area + '_elevation' 64 quantityname = 'elevation' #Elevation 65 66 if is_parallel == True: 67 # print 'is_parallel',is_parallel 68 for i in range(0,nodes): 69 namei = name + '_P%d_%d' %(i,nodes) 70 outnamei = outname + '_P%d_%d' %(i,nodes) 71 print 'start sww2dem for sww file %d' %(i) 72 sww2dem(namei, basename_out = outnamei, 73 quantity = quantityname, 74 #timestep = timestep, 75 cellsize = cellsize, 76 easting_min = project_grad.e_min_area, 77 easting_max = project_grad.e_max_area, 78 northing_min = project_grad.n_min_area, 79 northing_max = project_grad.n_max_area, 80 reduction = max, 81 verbose = True, 82 format = 'asc') 83 else: 84 print 'start sww2dem',which_area, easting_min,name,outname 85 sww2dem(name, basename_out = outname, 79 86 quantity = quantityname, 80 87 #timestep = timestep, 81 88 cellsize = cellsize, 82 easting_min = project_grad.e_min_area,83 easting_max = project_grad.e_max_area,84 northing_min = project_grad.n_min_area,85 northing_max = project_grad.n_max_area,89 easting_min = easting_min, 90 easting_max = easting_max, 91 northing_min = northing_min, 92 northing_max = northing_max, 86 93 reduction = max, 87 94 verbose = True, 88 95 format = 'asc') 89 else:90 print 'start sww2dem',which_area, easting_min,name,outname91 sww2dem(name, basename_out = outname,92 quantity = quantityname,93 #timestep = timestep,94 cellsize = cellsize,95 easting_min = easting_min,96 easting_max = easting_max,97 northing_min = northing_min,98 northing_max = northing_max,99 reduction = max,100 verbose = True,101 format = 'asc')102 96 -
anuga_work/production/busselton/get_timeseries.py
r5647 r5669 20 20 timestamp='20080807_102253_run_final_0.0_polyline_newExtent_kvanputt' 21 21 22 22 23 filename=project.output_dir+timestamp+sep+project.scenario_name+'.sww' 23 24 print 'Hello', filename -
anuga_work/production/busselton/project.py
r5647 r5669 35 35 scenario = 'busselton_tsunami_scenario' 36 36 37 tide = 0 .637 tide = 0 #0.6 38 38 39 39 alpha = 0.1 -
anuga_work/production/busselton/run_busselton.py
r5645 r5669 42 42 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon 43 43 from anuga.geospatial_data.geospatial_data import find_optimal_smoothing_parameter 44 from Scientific.IO.NetCDF import NetCDFFile 44 45 45 # Application specific imports 46 46 import project # Definition of file names and polygons … … 187 187 188 188 boundary_urs_out=project.boundaries_dir_name 189 190 Br = Reflective_boundary(domain) 191 Bd = Dirichlet_boundary([kwargs['tide'],0,0]) 189 192 190 193 print 'Available boundary tags', domain.get_boundary_tags() … … 192 195 domain, mean_stage=project.tide, 193 196 time_thinning=1, 197 default_boundary=Bd, 194 198 use_cache=True, 195 199 verbose = True, 196 200 boundary_polygon=bounding_polygon) 197 201 198 Br = Reflective_boundary(domain)199 Bd = Dirichlet_boundary([kwargs['tide'],0,0])200 201 fid = NetCDFFile(boundary_urs_out+'.sts', 'r') #Open existing file for read202 sts_time=fid.variables['time'][:]+fid.starttime203 tmin=min(sts_time)204 tmax=max(sts_time)205 fid.close()206 207 print 'Boundary end time ', tmax-tmin208 209 202 domain.set_boundary({'back': Bd, 210 203 'side': Bd, … … 224 217 domain.write_time() 225 218 domain.write_boundary_statistics(tags = 'ocean') 226 227 if t >= tmax-tmin:228 print 'changed to tide boundary condition at ocean'229 domain.set_boundary({'ocean': Bd})230 219 231 220 x, y = domain.get_maximum_inundation_location() … … 274 263 run_model(**kwargs) 275 264 276 if myid==0:277 export_model(**kwargs)278 265 #barrier 279 266 -
anuga_work/production/geraldton/project.py
r5652 r5669 36 36 37 37 38 tide = 0 .75 #??? must check!!!38 tide = 0 #0.75 #??? must check!!! 39 39 40 40 alpha = 0.1 41 41 friction=0.01 42 42 starttime=0 43 finaltime= 8000043 finaltime=1000 44 44 export_cellsize=25 45 45 setup='final' 46 source=' polyline'46 source='elevation' 47 47 48 48 … … 178 178 print 'min number triangles', trigs_min 179 179 180 #For no input boundary file 181 182 boundary_tags={'back': [2,3,4,5], 'side': [0,1,6], 'ocean': [7,8,9]} 180 183 poly_mainland=read_polygon(topographies_in_dir +'initial_condition.csv') 184 185 181 186 182 187 ################################################################### -
anuga_work/production/geraldton/run_geraldton.py
r5652 r5669 78 78 # Domain definitions 79 79 #----------------------------------------------------------------------- 80 81 # Read in boundary from ordered sts file 82 urs_bounding_polygon=create_sts_boundary(os.path.join(project.boundaries_dir,project.scenario_name)) 83 84 # Reading the landward defined points, this incorporates the original clipping 85 # polygon minus the 100m contour 86 landward_bounding_polygon = read_polygon(project.polygons_dir+'landward_boundary.txt') 87 88 # Combine sts polyline with landward points 89 bounding_polygon = urs_bounding_polygon + landward_bounding_polygon 90 91 # counting segments 92 N = len(urs_bounding_polygon)-1 93 boundary_tags={'back': [N+2,N+3], 'side': [N,N+1,N+4],'ocean': range(N)} 80 ## 81 ## # Read in boundary from ordered sts file 82 ## urs_bounding_polygon=create_sts_boundary(os.path.join(project.boundaries_dir,project.scenario_name)) 83 ## 84 ## # Reading the landward defined points, this incorporates the original clipping 85 ## # polygon minus the 100m contour 86 ## landward_bounding_polygon = read_polygon(project.boundaries_dir+'landward_boundary.txt') 87 ## 88 ## # Combine sts polyline with landward points 89 ## bounding_polygon = urs_bounding_polygon + landward_bounding_polygon 90 ## 91 ## # counting segments 92 ## N = len(urs_bounding_polygon)-1 93 ## boundary_tags={'back': [N+2,N+3], 'side': [N,N+1,N+4],'ocean': range(N)} 94 95 bounding_polygon = project.poly_all 96 94 97 95 98 … … 108 111 109 112 create_mesh_from_regions(bounding_polygon, 110 boundary_tags= boundary_tags,113 boundary_tags=project.boundary_tags, 111 114 maximum_triangle_area=project.res_poly_all, 112 115 interior_regions=project.interior_regions, … … 218 221 Bd = Dirichlet_boundary([kwargs['tide'],0,0]) 219 222 220 fid = NetCDFFile(boundary_urs_out+'.sts', 'r') #Open existing file for read221 sts_time=fid.variables['time'][:]+fid.starttime222 tmin=min(sts_time)223 tmax=max(sts_time)224 fid.close()225 226 print 'Boundary end time ', tmax-tmin227 228 223 ## Bf = Field_boundary(kwargs['boundary_file'], 229 224 ## domain, time_thinning=kwargs['time_thinning'], mean_stage=kwargs['tide'], … … 232 227 domain.set_boundary({'back': Br, 233 228 'side': Bd, 234 'ocean': B f})229 'ocean': Bd}) # change baxk to Bf when running properly 235 230 236 231 kwargs['input_start_time']=domain.starttime … … 248 243 domain.write_boundary_statistics(tags = 'ocean') 249 244 250 if t >= tmax-tmin:251 print 'changed to tide boundary condition at ocean'252 domain.set_boundary({'ocean': Bd})253 245 254 246 x, y = domain.get_maximum_inundation_location() … … 283 275 kwargs['output_dir']=project.output_run_time_dir 284 276 kwargs['elevation_file']=project.combined_dir_name+'.pts' 285 kwargs['boundary_file']=project.boundaries_in_dir_name + '.sww'286 277 kwargs['file_name']=project.home+'detail.csv' 287 278 kwargs['aa_scenario_name']=project.scenario_name -
anuga_work/production/onslow_2008/export_results.py
r5655 r5669 5 5 from os import sep 6 6 7 #time_dir = '20080526_104946_run_final_0.6_test_kvanputt' 8 #time_dir = '20080530_170833_run_final_0.6_exmouth_kvanputt' 9 #time_dir = '20080619_115643_run_trial_0.6_exmouth_kvanputt' 10 #time_dir = '20080714_095738_run_final_0.6_exmouth_kvanputt' 11 #time_dir = '20080714_134935_run_final_0_exmouth_kvanputt' 12 #time_dir = '20080718_112228_run_final_0_exmouth_kvanputt' 13 #time_dir = '20080725_173911_run_final_0.6_polyline_alpha0.1_kvanputt' 14 #time_dir = '20080728_112519_run_final_0.6_polyline_alpha0.2_kvanputt' 15 time_dir = '20080812_165726_run_final_0.0_polyline_alpha0.1_kvanputt' 7 time_dir = '20080818_183807_run_trial_1.5_polyline_alpha0.1_kvanputt' 16 8 17 9 cellsize = 25 -
anuga_work/production/onslow_2008/project.py
r5635 r5669 40 40 41 41 42 tide = 0.0 #1.542 tide = 1.5 43 43 44 44 alpha = 0.1 45 45 friction=0.01 46 starttime= 046 starttime=5000 47 47 finaltime=80000 48 48 export_cellsize=25 49 setup=' final'49 setup='trial' 50 50 source='polyline' 51 51 -
anuga_work/production/onslow_2008/run_onslow.py
r5645 r5669 42 42 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon 43 43 from anuga.geospatial_data.geospatial_data import find_optimal_smoothing_parameter 44 from Scientific.IO.NetCDF import NetCDFFile 44 45 45 # Application specific imports 46 46 import project # Definition of file names and polygons … … 204 204 205 205 boundary_urs_out=project.boundaries_dir_name 206 207 Br = Reflective_boundary(domain) 208 Bd = Dirichlet_boundary([kwargs['tide'],0,0]) 206 209 207 210 print 'Available boundary tags', domain.get_boundary_tags() … … 209 212 domain, mean_stage= project.tide, 210 213 time_thinning=1, 214 default_boundary=Bd, 211 215 use_cache=True, 212 216 verbose = True, 213 217 boundary_polygon=bounding_polygon) 214 215 Br = Reflective_boundary(domain)216 Bd = Dirichlet_boundary([kwargs['tide'],0,0])217 218 fid = NetCDFFile(boundary_urs_out+'.sts', 'r') #Open existing file for read219 sts_time=fid.variables['time'][:]+fid.starttime220 tmin=min(sts_time)221 tmax=max(sts_time)222 fid.close()223 224 print 'Boundary end time ', tmax-tmin225 226 ## Bf = Field_boundary(kwargs['boundary_file'],227 ## domain, time_thinning=kwargs['time_thinning'], mean_stage=kwargs['tide'],228 ## use_cache=False, verbose=True)229 218 230 219 domain.set_boundary({'back': Br, … … 246 235 domain.write_boundary_statistics(tags = 'ocean') 247 236 248 if t >= tmax-tmin:249 print 'changed to tide boundary condition at ocean'250 domain.set_boundary({'ocean': Bd})251 252 237 x, y = domain.get_maximum_inundation_location() 253 238 q = domain.get_maximum_inundation_elevation() … … 297 282 run_model(**kwargs) 298 283 299 if myid==0:300 export_model(**kwargs)301 284 #barrier -
anuga_work/production/perth/export_results.py
r5626 r5669 13 13 #time_dir = '20080725_173911_run_final_0.6_polyline_alpha0.1_kvanputt' 14 14 #time_dir = '20080728_112519_run_final_0.6_polyline_alpha0.2_kvanputt' 15 time_dir = '200808 07_134943_run_final_0.0_polyline_alpha0.1_kvanputt'15 time_dir = '20080815_103336_run_final_0.6_polyline_alpha0.1_kvanputt' 16 16 17 17 cellsize = 25 18 18 #cellsize = 150 19 timestep = 019 #timestep = 0 20 20 directory = project.output_dir 21 21 name = directory+time_dir+sep+project.scenario_name … … 30 30 print 'output dir:', name 31 31 32 #var = [2,3,4] # depth and speed32 var = [2,3] # depth and speed 33 33 #var = [2] # depth 34 var = [0,4] # stage and elevation34 #var = [0,4] # stage and elevation 35 35 36 36 … … 77 77 sww2dem(name, basename_out = outname, 78 78 quantity = quantityname, 79 timestep = timestep,79 # timestep = timestep, 80 80 cellsize = cellsize, 81 81 #easting_min = project_grad.e_min_area, -
anuga_work/production/perth/export_results_all.py
r5655 r5669 1 1 import project, os 2 2 import sys 3 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts 3 4 4 5 from anuga.shallow_water.data_manager import sww2dem … … 7 8 #time_dir = '20080526_104946_run_final_0.6_test_kvanputt' 8 9 #time_dir = '20080530_170833_run_final_0.6_exmouth_kvanputt' 9 time_dir = '20080807_134943_run_final_0.0_polyline_alpha0.1_kvanputt' 10 #time_dir = '20080815_103442_run_final_0.0_polyline_alpha0.1_kvanputt' 11 time_dir = '20080815_103336_run_final_0.6_polyline_alpha0.1_kvanputt' 12 13 is_parallel = False 14 #is_parallel = True 15 if is_parallel == True: nodes = 4 10 16 11 17 12 13 cellsize = 25 18 cellsize = 15 14 19 #cellsize = 150 15 20 #timestep = 0 16 21 directory = project.output_dir 17 name = directory+time_dir+sep+project.scenario_name 22 name1 = directory+time_dir+sep+project.scenario_name 23 name2 = directory+time_dir+sep+'perth_time_39900'+sep+project.scenario_name+'_time_39900_0' 24 #name2 = directory+time_dir+sep+project.scenario_name+'_time_39900_0' 25 names = [name1, name2] 26 for name in names: 18 27 19 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts 28 area = ['Geordie', 'Sorrento', 'Fremantle', 'Rockingham'] 20 29 30 for which_area in area: 31 if which_area == 'Geordie': 32 easting_min = project.xminGeordie 33 easting_max = project.xmaxGeordie 34 northing_min = project.yminGeordie 35 northing_max = project.ymaxGeordie 21 36 22 is_parallel = False 23 #is_parallel = True 37 if which_area == 'Sorrento': 38 easting_min = project.xminSorrento 39 easting_max = project.xmaxSorrento 40 northing_min = project.yminSorrento 41 northing_max = project.ymaxSorrento 24 42 25 if is_parallel == True: nodes = 4 26 print 'output dir:', name 43 if which_area == 'Fremantle': 44 easting_min = project.xminFremantle 45 easting_max = project.xmaxFremantle 46 northing_min = project.yminFremantle 47 northing_max = project.ymaxFremantle 27 48 28 area = ['Geordie', 'Sorrento', 'Fremantle', 'Rockingham'] 49 if which_area == 'Rockingham': 50 easting_min = project.xminRockingham 51 easting_max = project.xmaxRockingham 52 northing_min = project.yminRockingham 53 northing_max = project.ymaxRockingham 29 54 30 for which_area in area: 31 if which_area == 'Geordie': 32 easting_min = project.xminGeordie 33 easting_max = project.xmaxGeordie 34 northing_min = project.yminGeordie 35 northing_max = project.ymaxGeordie 55 var = [2] # momentum and depth 56 #var = [2] # depth 57 #var = [0,4] 36 58 37 if which_area == 'Sorrento': 38 easting_min = project.xminSorrento 39 easting_max = project.xmaxSorrento 40 northing_min = project.yminSorrento 41 northing_max = project.ymaxSorrento 59 for which_var in var: 60 if which_var == 0: # Stage 61 outname = name + which_area + '_stage' 62 quantityname = 'stage' 42 63 43 if which_area == 'Fremantle': 44 easting_min = project.xminFremantle 45 easting_max = project.xmaxFremantle 46 northing_min = project.yminFremantle 47 northing_max = project.ymaxFremantle 64 if which_var == 1: # Absolute Momentum 65 outname = name + which_area + '_momentum' 66 quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 48 67 49 if which_area == 'Rockingham': 50 easting_min = project.xminRockingham 51 easting_max = project.xmaxRockingham 52 northing_min = project.yminRockingham 53 northing_max = project.ymaxRockingham 68 if which_var == 2: # Depth 69 outname = name + which_area + '_depth' 70 quantityname = 'stage-elevation' 54 71 55 var = [2,3] # depth and speed 56 #var = [2] # depth 57 #var = [0,4] 72 if which_var == 3: # Speed 73 outname = name + which_area + '_speed' 74 #quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))' #Speed 75 quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6)' #Speed 76 77 if which_var == 4: # Elevation 78 outname = name + which_area + '_elevation' 79 quantityname = 'elevation' #Elevation 58 80 59 for which_var in var: 60 if which_var == 0: # Stage 61 outname = name + which_area + '_stage' 62 quantityname = 'stage' 63 64 if which_var == 1: # Absolute Momentum 65 outname = name + which_area + '_momentum' 66 quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 67 68 if which_var == 2: # Depth 69 outname = name + which_area + '_depth' 70 quantityname = 'stage-elevation' 71 72 if which_var == 3: # Speed 73 outname = name + which_area + '_speed' 74 quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))' #Speed 75 76 if which_var == 4: # Elevation 77 outname = name + which_area + '_elevation' 78 quantityname = 'elevation' #Elevation 79 80 if is_parallel == True: 81 # print 'is_parallel',is_parallel 82 for i in range(0,nodes): 83 namei = name + '_P%d_%d' %(i,nodes) 84 outnamei = outname + '_P%d_%d' %(i,nodes) 85 print 'start sww2dem for sww file %d' %(i) 86 sww2dem(namei, basename_out = outnamei, 81 if is_parallel == True: 82 # print 'is_parallel',is_parallel 83 for i in range(0,nodes): 84 namei = name + '_P%d_%d' %(i,nodes) 85 outnamei = outname + '_P%d_%d' %(i,nodes) 86 print 'start sww2dem for sww file %d' %(i) 87 sww2dem(namei, basename_out = outnamei, 88 quantity = quantityname, 89 timestep = timestep, 90 cellsize = cellsize, 91 easting_min = project_grad.e_min_area, 92 easting_max = project_grad.e_max_area, 93 northing_min = project_grad.n_min_area, 94 northing_max = project_grad.n_max_area, 95 reduction = max, 96 verbose = True, 97 format = 'asc') 98 else: 99 print 'start sww2dem',which_area, easting_min 100 sww2dem(name, basename_out = outname, 87 101 quantity = quantityname, 88 timestep = timestep,102 #timestep = timestep, 89 103 cellsize = cellsize, 90 easting_min = project_grad.e_min_area,91 easting_max = project_grad.e_max_area,92 northing_min = project_grad.n_min_area,93 northing_max = project_grad.n_max_area,104 easting_min = easting_min, 105 easting_max = easting_max, 106 northing_min = northing_min, 107 northing_max = northing_max, 94 108 reduction = max, 95 109 verbose = True, 96 110 format = 'asc') 97 else:98 print 'start sww2dem',which_area, easting_min99 sww2dem(name, basename_out = outname,100 quantity = quantityname,101 #timestep = timestep,102 cellsize = cellsize,103 easting_min = easting_min,104 easting_max = easting_max,105 northing_min = northing_min,106 northing_max = northing_max,107 reduction = max,108 verbose = True,109 format = 'asc')110 111 -
anuga_work/production/perth/get_timeseries.py
r5655 r5669 18 18 #timestamp='20080724_121200_run_trial_0.6_polyline_alpha0.1_kvanputt' 19 19 #timestamp='20080724_161830_run_final_0.6_polyline_alpha0.1_kvanputt' 20 timestamp='20080811_142505_run_final_0.0_polyline_alpha0.1_kvanputt' 20 timestamp='20080815_103442_run_final_0.0_polyline_alpha0.1_kvanputt' 21 #timestamp='20080815_103336_run_final_0.6_polyline_alpha0.1_kvanputt' 21 22 22 filename =project.output_dir+timestamp+sep+project.scenario_name+'.sww'23 print 'Hello', filename 23 filename1=project.output_dir+timestamp+sep+project.scenario_name+'.sww' 24 #filename2=project.output_dir+timestamp+sep+'perth_time_39900'+sep+project.scenario_name+'_time_39900_0.sww' 24 25 25 sww2csv_gauges(filename, 26 project.gauges_dir_name, 27 #project.gauges_dir_name2, 28 quantities = ['stage','speed','depth','elevation'], 29 verbose=True) 26 27 28 filenames = [filename1] 29 for filename in filenames: 30 31 sww2csv_gauges(filename, 32 project.gauges_dir_name, 33 #project.gauges_dir_name2, 34 quantities = ['stage','speed','depth','elevation'], 35 verbose=True) 30 36 31 37 32 38 33 39 40 -
anuga_work/production/perth/project.py
r5655 r5669 38 38 39 39 40 tide = 0. 640 tide = 0.0 #0.6 41 41 42 42 alpha = 0.1 -
anuga_work/production/perth/run_perth.py
r5645 r5669 42 42 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon 43 43 from anuga.geospatial_data.geospatial_data import find_optimal_smoothing_parameter 44 from Scientific.IO.NetCDF import NetCDFFile45 44 46 45 # Application specific imports … … 205 204 206 205 boundary_urs_out=project.boundaries_dir_name 206 207 Br = Reflective_boundary(domain) 208 Bd = Dirichlet_boundary([kwargs['tide'],0,0]) 207 209 208 210 print 'Available boundary tags', domain.get_boundary_tags() … … 210 212 domain, mean_stage= project.tide, 211 213 time_thinning=1, 214 default_boundary=Bd, 212 215 use_cache=True, 213 216 verbose = True, 214 217 boundary_polygon=bounding_polygon) 215 216 217 Br = Reflective_boundary(domain)218 Bd = Dirichlet_boundary([kwargs['tide'],0,0])219 220 fid = NetCDFFile(boundary_urs_out+'.sts', 'r') #Open existing file for read221 sts_time=fid.variables['time'][:]+fid.starttime222 tmin=min(sts_time)223 tmax=max(sts_time)224 fid.close()225 226 print 'Boundary end time ', tmax-tmin227 228 ## Bf = Field_boundary(kwargs['boundary_file'],229 ## domain, time_thinning=kwargs['time_thinning'], mean_stage=kwargs['tide'],230 ## use_cache=False, verbose=True)231 218 232 219 domain.set_boundary({'back': Br, … … 248 235 domain.write_boundary_statistics(tags = 'ocean') 249 236 250 if t >= tmax-tmin:251 print 'changed to tide boundary condition at ocean'252 domain.set_boundary({'ocean': Bd})253 254 237 x, y = domain.get_maximum_inundation_location() 255 238 q = domain.get_maximum_inundation_elevation() … … 299 282 run_model(**kwargs) 300 283 301 if myid==0:302 export_model(**kwargs)303 284 #barrier
Note: See TracChangeset
for help on using the changeset viewer.