Changeset 3955 for anuga_work/production/dampier_2006/export_results.py
- Timestamp:
- Nov 9, 2006, 12:04:41 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/dampier_2006/export_results.py
r3827 r3955 3 3 4 4 from anuga.shallow_water.data_manager import sww2dem 5 #from anuga.pyvolution.ermapper_grids import read_ermapper_grid6 from anuga.abstract_2d_finite_volumes.util import Screen_Catcher7 5 from os import sep 8 6 9 #time_dir = '20060704_063005' #HAT 10 #time_dir = '20060706_235246' #LAT 11 time_dir = '20060704_063234' #MSL 12 #time_dir = '20060515_001733' #DTED data 13 directory = project.boundarydir 14 #name = directory + time_dir +sep + 'source' 15 # to develop grid of MOST output 16 #directory = project.boundarydir 17 name = directory + project.boundary_basename 7 time_dir = '20061107_070805_run' # 8 directory = project.output_dir 9 name = directory + time_dir + sep + project.scenario_name 18 10 19 #normal screen output is stored in 'outname' 20 #screen_output_name = directory + time_dir + sep + "export_output.txt" 21 #screen_error_name = directory + time_dir + sep + "export_error.txt" 22 # for MOST output 23 #screen_output_name = directory + "export_output.txt" 24 #screen_error_name = directory + "export_error.txt" 11 is_parallel = True 12 if is_parallel == True: nodes = 8 13 print 'output dir:', name 25 14 26 #used to catch screen output to file 27 #sys.stdout = Screen_Catcher(screen_output_name) 28 #sys.stderr = Screen_Catcher(screen_error_name) 29 30 print 'output dir:', name 31 #print 'Which variable do you want to export?' 32 #which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3 ' )) 33 which_var = 4 34 #sys.stderr.write(sys.stdout.data) 15 which_var = 2 35 16 if which_var == 0: # Stage 36 17 outname = name + '_stage' … … 39 20 if which_var == 1: # Absolute Momentum 40 21 outname = name + '_momentum' 41 quantityname = '(xmomentum**2 + ymomentum**2)**0.5' #Absolute momentum22 quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 42 23 43 24 if which_var == 2: # Depth 44 25 outname = name + '_depth' 45 quantityname = 'stage-elevation' #Depth26 quantityname = 'stage-elevation' 46 27 47 28 if which_var == 3: # Speed 48 29 outname = name + '_speed' 49 30 #quantityname = '((xmomentum/(stage-elevation))**2 + (ymomentum/(stage-elevation))**2)**0.5' #Speed 50 #quantityname = 'xmomentum/(stage-elevation)' #Speed51 31 quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)' #Speed 52 32 … … 55 35 quantityname = 'elevation' #Elevation 56 36 57 print 'start sww2dem' 58 #sys.stderr.write(sys.stdout.data) 59 sww2dem(name, basename_out = outname, 60 quantity = quantityname, 61 cellsize = 20, # Trevor would like this at 25 62 # define region for viz purposes 63 easting_min = project.e_min_area, 64 easting_max = project.e_max_area, 65 northing_min = project.n_min_area, 66 northing_max = project.n_max_area, 67 reduction = max, #this is because we want max quantityname 68 verbose = True, 69 format = 'asc') 70 71 #sys.stderr.write(sys.stdout.data) 72 73 #Check 74 75 #data = read_ermapper_grid(name) 76 #print 'Values from %s are in [%f, %f]' %(name, min(data.flat), max(data.flat)) 37 if is_parallel == True: 38 for i in range(nodes): 39 namei = name + '_P%d_%d' %(i,nodes) 40 outnamei = outname + '_P%d_%d' %(i,nodes) 41 print 'start sww2dem for sww file %d' %(i) 42 sww2dem(namei, basename_out = outnamei, 43 quantity = quantityname, 44 cellsize = 20, 45 easting_min = project.e_min_area, 46 easting_max = project.e_max_area, 47 northing_min = project.n_min_area, 48 northing_max = project.n_max_area, 49 reduction = max, 50 verbose = True, 51 format = 'asc') 52 else: 53 print 'start sww2dem' 54 sww2dem(name, basename_out = outname, 55 quantity = quantityname, 56 cellsize = 20, 57 easting_min = project.e_min_area, 58 easting_max = project.e_max_area, 59 northing_min = project.n_min_area, 60 northing_max = project.n_max_area, 61 reduction = max, 62 verbose = True, 63 format = 'asc')
Note: See TracChangeset
for help on using the changeset viewer.