Changeset 7409
- Timestamp:
- Aug 27, 2009, 1:25:29 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/patong/new_version/export_results_max.py
r6984 r7409 32 32 33 33 34 time_dirs = [time_dir 7] #, time_dir2,time_dir3, time_dir4,time_dir5, time_dir6, time_dir7]34 time_dirs = [time_dir4] #, time_dir2,time_dir3, time_dir4,time_dir5, time_dir6, time_dir7] 35 35 36 36 37 #cellsize = 250 38 cellsize = 20 37 # sww filename extensions ie. hobart_time_17640_0.sww, input into list 17640 38 # make sure numbers are in sequential order 39 times = [] 40 41 #Modify the cellsize value to set the size of the raster you require 42 #Take into account mesh size when aplying this paramater 43 cellsize = 10 #250 39 44 40 timestep = None # None means no timestep! 41 #timestep = 0 45 #Now set the timestep at which you want the raster generated. 46 #Either set the actual timestep required or use 'None' to indicate that 47 #you want the maximum values in the raster over all timesteps 48 timestep = None #0 42 49 43 ###### 44 # Set the special areas of interest. If none, do: area='All' 45 ###### 50 # Set the special areas of interest. If none, do: area=['All'] 51 # Areas identified below are specified by cooridinates in project.py 46 52 47 area = ['CBD'] # strings must match keys in var_equations below 48 #area = ['All'] # 'All' means no special areas - the whole thing 53 area = ['CBD'] 54 #area = ['All'] 55 56 # one or more key strings from var_equations below 57 var = ['speed'] 49 58 50 59 ###### … … 58 67 'elevation': 'elevation' } 59 68 60 # one or more key strings from var_equations above61 var = ['depth', 'speed']62 69 63 70 ###### 64 # Start running the various conversions we require. 71 # Start script, running through variables, area, folder, sww file (determine by times) 72 # Then creates a maximum asci if there is more than one sww file 65 73 ###### 66 74 … … 87 95 88 96 for time_dir in time_dirs: 89 90 name1 = join(directory, time_dir, project.scenario_name) 91 name2 = join(directory, time_dir, project.scenario_name)+'_time_10270_0' 92 name3 = join(directory, time_dir, project.scenario_name)+'_time_14555_0' 93 94 names = [name1, name2, name3] 95 97 names = [join(directory, time_dir, project.scenario_name)] 98 for time in times: 99 names.append(join(directory, time_dir, project.scenario_name)+ '_time_' + str(time) + '_0') 100 96 101 asc_name = [] 97 102 98 103 for name in names: 99 100 outname = name + '_' + which_area + '_' + which_var 104 outname = name + '_' + which_area + '_' + which_var + '_' + str(cellsize) 101 105 quantityname = var_equations[which_var] 102 106 103 107 print 'start sww2dem: time_dir=%s' % time_dir 104 108 print 'name=%s' % name 105 109 sww2dem(name, basename_out = outname, 106 110 quantity = quantityname, … … 116 120 117 121 asc_name.append(outname + '.asc') 118 119 maxasc_outname = join(directory, time_dir, project.scenario_name)+'_'+which_area+'_'+which_var+'_max.asc' 122 123 if len(names) >1: 124 maxasc_outname = join(directory, time_dir, project.scenario_name)+'_' 125 +which_area+'_'+which_var+'_'+str(cellsize)+'_max.asc' 120 126 121 print 'max asc outname ', maxasc_outname 122 print 'asc_name ', str(asc_name) 123 124 MaxAsc(maxasc_outname, asc_name) 127 print 'max asc outname ', maxasc_outname 128 print 'asc_name ', str(asc_name) 129 130 MaxAsc(maxasc_outname, asc_name) 131 else: 132 print 'Only one sww file, no Max file required'
Note: See TracChangeset
for help on using the changeset viewer.