Changeset 3955
- Timestamp:
- Nov 9, 2006, 12:04:41 PM (18 years ago)
- Location:
- anuga_work/production/dampier_2006
- Files:
-
- 36 added
- 2 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') -
anuga_work/production/dampier_2006/project.py
r3940 r3955 84 84 85 85 print 'gtime: ', gtime 86 #print 'ctime: ', cctime 87 86 output_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'outputs'+sep 88 87 output_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'outputs'+sep 89 88 output_build_time_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'outputs'+sep+build_time+sep … … 97 96 #boundaries_time_dir = boundaries_in_dir+'urs'+sep+boundaries_source+sep 98 97 98 gauge_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'gauges'+sep 99 gauge_filename = gauge_dir + 'dampier_gauges.csv' 99 100 100 101 gauges_dir_name = gauges_dir + gauge_name … … 178 179 # convert_from_latlon_to_utm([p1, p2, p3, p4, p5, p6, p7]) 179 180 refzone = zone 181 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon 182 print 'poly area', polygon_area(bounding_polygon)/1000000.0 180 183 181 184 #Interior regions
Note: See TracChangeset
for help on using the changeset viewer.