Changeset 5793 for anuga_work/production/geraldton/export_results.py
- Timestamp:
- Sep 26, 2008, 3:46:52 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/geraldton/export_results.py
r5789 r5793 1 import project , os1 import project_250m, os 2 2 import sys 3 3 … … 7 7 8 8 9 time_dir = '20080911_094915_run_final_0.6_27255_alpha0.1_kvanputt' 10 #time_dir = '20080911_100609_run_final_0.6_27283_alpha0.1_kvanputt' 11 9 time_dir = '20080925_162836_run_final_0_27283_250m_none_kvanputt' 12 10 13 11 cellsize = 25 14 12 #cellsize = 150 15 13 #timestep = 0 16 directory = project.output_dir 17 name = directory+sep+time_dir+sep+project.scenario_name 18 #var = [0,4] 19 var = [2] # depth and Speed 14 directory = project_250m.output_dir 15 name = directory+sep+time_dir+sep+project_250m.scenario_name 16 17 var = [0,4] 18 #var = [2] # depth and Speed 20 19 #var = [2,3] # elevation, depth and Speed 21 20 … … 26 25 print 'output dir:', name 27 26 27 name = directory+time_dir+sep+project_250m.scenario_name 28 28 29 name1 = directory+time_dir+sep+project.scenario_name 30 name2 = directory+time_dir+sep+'sww2'+sep+project.scenario_name+'_time_41700_0' #need to get assistance on how to make this into anything 29 for which_var in var: 30 if which_var == 0: # Stage 31 outname = name + '_stage' 32 quantityname = 'stage' 31 33 32 names = [name1, name2] 34 if which_var == 1: # Absolute Momentum 35 outname = name + '_momentum' 36 quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 33 37 34 for name in names: 38 if which_var == 2: # Depth 39 outname = name + '_depth' 40 quantityname = 'stage-elevation' 35 41 36 for which_var in var: 37 if which_var == 0: # Stage 38 outname = name + '_stage' 39 quantityname = 'stage' 42 if which_var == 3: # Speed 43 outname = name + '_speed' 44 quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))' #Speed 40 45 41 if which_var == 1: # Absolute Momentum42 outname = name + '_momentum'43 quantityname = '(xmomentum**2 + ymomentum**2)**0.5'46 if which_var == 4: # Elevation 47 outname = name + '_elevation' 48 quantityname = 'elevation' #Elevation 44 49 45 if which_var == 2: # Depth 46 outname = name + '_depth' 47 quantityname = 'stage-elevation' 48 49 if which_var == 3: # Speed 50 outname = name + '_speed' 51 quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))' #Speed 52 53 if which_var == 4: # Elevation 54 outname = name + '_elevation' 55 quantityname = 'elevation' #Elevation 56 57 if is_parallel == True: 58 # print 'is_parallel',is_parallel 59 for i in range(0,nodes): 60 namei = name + '_P%d_%d' %(i,nodes) 61 outnamei = outname + '_P%d_%d' %(i,nodes) 62 print 'start sww2dem for sww file %d' %(i) 63 sww2dem(namei, basename_out = outnamei, 64 quantity = quantityname, 65 #timestep = timestep, 66 cellsize = cellsize, 67 easting_min = project_grad.e_min_area, 68 easting_max = project_grad.e_max_area, 69 northing_min = project_grad.n_min_area, 70 northing_max = project_grad.n_max_area, 71 reduction = max, 72 verbose = True, 73 format = 'asc') 74 else: 75 print 'start sww2dem' 76 sww2dem(name, basename_out = outname, 50 if is_parallel == True: 51 # print 'is_parallel',is_parallel 52 for i in range(0,nodes): 53 namei = name + '_P%d_%d' %(i,nodes) 54 outnamei = outname + '_P%d_%d' %(i,nodes) 55 print 'start sww2dem for sww file %d' %(i) 56 sww2dem(namei, basename_out = outnamei, 77 57 quantity = quantityname, 78 58 #timestep = timestep, 79 cellsize = cellsize, 80 number_of_decimal_places = 4, 59 cellsize = cellsize, 60 easting_min = project_grad.e_min_area, 61 easting_max = project_grad.e_max_area, 62 northing_min = project_grad.n_min_area, 63 northing_max = project_grad.n_max_area, 81 64 reduction = max, 82 65 verbose = True, 83 66 format = 'asc') 67 else: 68 print 'start sww2dem' 69 sww2dem(name, basename_out = outname, 70 quantity = quantityname, 71 #timestep = timestep, 72 cellsize = cellsize, 73 number_of_decimal_places = 4, 74 reduction = max, 75 verbose = True, 76 format = 'asc') 84 77
Note: See TracChangeset
for help on using the changeset viewer.