Changeset 6016
- Timestamp:
- Nov 28, 2008, 11:31:45 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/busselton/export_results_max.py
r5925 r6016 13 13 import project, os 14 14 import sys 15 from anuga.lib.maxasc.maxasc import MaxAsc 15 16 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts 16 17 from anuga.shallow_water.data_manager import sww2dem 17 18 from os import sep 18 import maxasc 19 19 20 20 21 directory = project.output_dir 21 22 22 #time_dir1 = '20081002_111432_run_final_0_27283_250m_none_kvanputt' 23 #time_dir1 = '20081002_111258_run_final_0_27283_250m_all_kvanputt' 24 time_dir1 = '20081031_120642_run_final_0_27283_alpha0.1_kvanputt' 25 #time_dir3 = '20080815_103818_run_final_0_polyline_newExtent_kvanputt' 23 #time_dir1 = '20081031_133841_run_final_0_27283_alpha0.1_kvanputt' 24 #time_dir1 = '20080924_123626_run_final_0_27283_250m_all_kvanputt' # This uses the 250m bathymetry with all interior polygons 25 #time_dir2 = '20080912_154716_run_final_0_27283_alpha0.1_kvanputt' # This uses original bathyemetry data 26 #time_dir3 = '20080924_123601_run_final_0_27283_250m_none_kvanputt' # This uses the 250m bathymetry without any interior polygons 27 #time_dirs = [time_dir1] #, time_dir2]#, time_dir3] 26 28 27 time_dirs = [time_dir1]#, time_dir2, time_dir3] 29 time_dir1 = '20081009_184721_run_final_0.6_68693_alpha0.1_kvanputt' 30 time_dir2 = '20081031_120515_run_final_0_27255_alpha0.1_kvanputt' 31 time_dir3 = '20081031_120753_run_final_0.6_27283_alpha0.1_kvanputt' 32 time_dir4 = '20081031_120642_run_final_0_27283_alpha0.1_kvanputt' 33 time_dir5 = '20081031_120316_run_final_0_68693_alpha0.1_kvanputt' 34 time_dir6 = '20081111_113832_run_final_0.6_27255_alpha0.1_kvanputt' 28 35 29 #cellsize = 20 30 cellsize = 250 36 time_dirs = [time_dir6] #1, time_dir2, time_dir3, time_dir4, time_dir5] 37 38 39 cellsize = 20 40 #cellsize = 250 31 41 32 42 timestep = None # None means no timestep! … … 36 46 # Set the special areas of interest. If none, do: area='All' 37 47 ###### 38 #area = ['Geordie', 'Sorrento', 'Fremantle', 'Rockingham'] # strings must match keys in var_equations below 39 area = ['All'] # 'All' means no special areas - the whole thing 48 49 area = ['Bunbury', 'Busselton'] # strings must match keys in var_equations below 50 #area = ['All'] # 'All' means no special areas - the whole thing 40 51 41 52 ###### … … 50 61 51 62 # one or more key strings from var_equations above 52 var = [' stage', 'elevation']63 var = ['depth', 'speed'] 53 64 54 65 ###### 55 66 # Start running the various conversions we require. 56 67 ###### 68 57 69 for which_var in var: 58 70 if which_var not in var_equations: … … 60 72 break 61 73 62 asc_name = [] 74 for which_area in area: 75 if which_area == 'All': 76 easting_min = None 77 easting_max = None 78 northing_min = None 79 northing_max = None 80 else: 81 try: 82 easting_min = eval('project.xmin%s' % which_area) 83 easting_max = eval('project.xmax%s' % which_area) 84 northing_min = eval('project.ymin%s' % which_area) 85 northing_max = eval('project.ymax%s' % which_area) 86 except AttributeError: 87 print 'Unrecognized area name: %s' % which_area 88 break 63 89 64 for time_dir in time_dirs: 65 name1 = directory+time_dir+sep+project.scenario_name 66 name2 = directory+time_dir+sep+project.scenario_name+'_time_39600_0' 67 name3 = directory+time_dir+sep+project.scenario_name+'_time_79200_0' 68 names = [name1, name2, name3] 69 70 for name in names: 71 for which_area in area: 72 if which_area == 'All': 73 easting_min = None 74 easting_max = None 75 northing_min = None 76 northing_max = None 77 else: 78 try: 79 easting_min = eval('project.xmin%s' % which_area) 80 easting_max = eval('project.xmax%s' % which_area) 81 northing_min = eval('project.ymin%s' % which_area) 82 northing_max = eval('project.ymax%s' % which_area) 83 except AttributeError: 84 print 'Unrecognized area name: %s' % which_area 85 break 86 90 for time_dir in time_dirs: 91 92 name1 = directory+time_dir+sep+project.scenario_name 93 name2 = directory+time_dir+sep+project.scenario_name+'_time_39600_0' 94 name3 = directory+time_dir+sep+project.scenario_name+'_time_79200_0' 95 96 names = [name1, name2, name3] 97 98 asc_name = [] 99 100 for name in names: 101 87 102 outname = name + '_' + which_area + '_' + which_var 88 103 quantityname = var_equations[which_var] … … 103 118 104 119 asc_name.append(outname + '.asc') 105 106 maxasc_outname = directory+time_dir+sep+project.scenario_name+'_'+which_area+'_'+which_var+'_max.asc' 107 108 maxasc.MaxAsc(maxasc_outname, asc_name) 120 121 maxasc_outname = directory+time_dir+sep+project.scenario_name+'_'+which_area+'_'+which_var+'_max.asc' 109 122 123 print 'max asc outname ', maxasc_outname 124 print 'asc_name ', str(asc_name) 125 126 MaxAsc(maxasc_outname, asc_name)
Note: See TracChangeset
for help on using the changeset viewer.