Changeset 7355 for anuga_work/production/hobart_2009/export_results_max.py
- Timestamp:
- Aug 12, 2009, 2:56:52 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/hobart_2009/export_results_max.py
r7268 r7355 21 21 22 22 directory = project.output_folder 23 time_dir1 = '20090619_165107_run_final_0_58260_None_kvanputt' 24 time_dir2 = '20090619_165136_run_final_0.8_58260_None_kvanputt' 23 time_dir1 = '20090714_162136_run_final_0_58260_None_kvanputt' 24 time_dir2 = '20090714_162041_run_final_0.8_58292_None_kvanputt' 25 time_dir3 = '20090714_161944_run_final_0.8_58280_None_kvanputt' 26 time_dir4 = '20090714_161740_run_final_0.8_58260_None_kvanputt' 25 27 26 time_dirs = [time_dir1, time_dir2] #, time_dir2] #, time_dir3, time_dir4, time_dir5, time_dir6] 27 28 time_dirs = [time_dir1, time_dir2, time_dir3, time_dir4] 28 29 29 #cellsize = 250 30 cellsize = 20 30 # sww filename extensions ie. hobart_time_17640_0.sww, input into list 17640 31 # make sure numbers are in sequential order 32 times = [16980, 33960, 50940] 33 34 #Modify the cellsize value to set the size of the raster you require 35 #Take into account mesh size when aplying this paramater 36 cellsize = 20 #250 31 37 32 timestep = None # None means no timestep! 33 #timestep = 0 38 #Now set the timestep at which you want the raster generated. 39 #Either set the actual timestep required or use 'None' to indicate that 40 #you want the maximum values in the raster over all timesteps 41 timestep = None #0 34 42 35 ######36 43 # Set the special areas of interest. If none, do: area=['All'] 37 # #####44 # Areas identified below are specified by cooridinates in project.py 38 45 39 area = ['Hobart', 'NW', 'South'] 40 #area = ['All'] # 'All' means no special areas - the whole thing 46 area = ['South', 'NW', 'Hobart'] 47 #area = ['All'] 48 49 # one or more key strings from var_equations below 50 var = ['depth'] 41 51 42 52 ###### … … 50 60 'elevation': 'elevation' } 51 61 52 # one or more key strings from var_equations above53 var = ['depth', 'speed']54 62 55 63 ###### 56 # Start running the various conversions we require. 64 # Start script, running through variables, area, folder, sww file (determine by times) 65 # Then creates a maximum asci if there is more than one sww file 57 66 ###### 58 67 … … 79 88 80 89 for time_dir in time_dirs: 81 name1 = join(directory, time_dir, project.scenario_name) 82 name2 = join(directory, time_dir, project.scenario_name)+'_time_17640_0' 83 ## name3 = join(directory, time_dir, project.scenario_name)+'_time_33960_0' 84 ## name4 = join(directory, time_dir, project.scenario_name)+'_time_50940_0' 90 names = [join(directory, time_dir, project.scenario_name)] 91 for time in times: 92 names.append(join(directory, time_dir, project.scenario_name)+ '_time_' + str(time) + '_0') 85 93 86 names = [name1, name2] #, name3, name4]87 88 94 asc_name = [] 89 95 print 'start sww2dem: time_dir = %s' % time_dir 90 96 for name in names: 91 97 92 98 outname = name + '_' + which_area + '_' + which_var 93 99 quantityname = var_equations[which_var] 94 100 95 print 'start sww2dem: time_dir=%s' % time_dir101 print 'start sww2dem: name = %s' % os.path.basename(name) 96 102 97 103 sww2dem(name, basename_out = outname, … … 108 114 109 115 asc_name.append(outname + '.asc') 110 111 maxasc_outname = join(directory, time_dir, project.scenario_name)+'_'+which_area+'_'+which_var+'_max.asc' 112 113 print 'max asc outname ', maxasc_outname 114 print 'asc_name ', str(asc_name) 115 116 MaxAsc(maxasc_outname, asc_name) 116 #print 'list = %s' % asc_name 117 #print 'max asc outname ', maxasc_outname 118 #print 'name=%s' % name 119 print 'which area=%s' % which_area 120 print 'which var=%s' % which_var 121 #print 'asc_name ', str(asc_name) 122 if times == []: 123 print 'Only one sww file, no Max file required' 124 else: 125 print 'Multiple sww files' 126 maxasc_outname = join(directory, time_dir, project.scenario_name)+'_'+which_area+'_'+which_var+'_max.asc' 127 print 'maxasc_outname = ', maxasc_outname 128 MaxAsc(maxasc_outname, asc_name)
Note: See TracChangeset
for help on using the changeset viewer.