Changeset 5415
- Timestamp:
- Jun 24, 2008, 10:24:21 AM (16 years ago)
- Location:
- anuga_work/production
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/busselton/build_busselton.py
r5387 r5415 37 37 #------------------------------------------------------------------------------ 38 38 39 start_screen_catcher(project.output_build_time_dir)40 41 print 'time stamp: ',project.time42 print 'USER: ', project.user43 44 45 39 copy_code_files(project.output_build_time_dir,__file__, 46 40 dirname(project.__file__)+sep+ project.__name__+'.py' ) 47 41 42 start_screen_catcher(project.output_build_time_dir) 48 43 44 print 'USER: ', project.user 49 45 50 46 #------------------------------------------------------------------------------- … … 55 51 # Fine pts file to be clipped to area of interest 56 52 #------------------------------------------------------------------------------- 53 print"project.poly_all",project.poly_all 54 print"project.combined_dir_name",project.combined_dir_name 57 55 58 56 # topography directory filenames … … 60 58 coast_in_dir_name = project.coast_in_dir_name 61 59 coast_in_dir_name1 = project.coast_in_dir_name1 62 #island_in_dir_name = project.island_in_dir_name63 60 offshore_in_dir_name = project.offshore_in_dir_name 61 offshore_in_dir_name1 = project.offshore_in_dir_name1 62 offshore_in_dir_name2 = project.offshore_in_dir_name2 63 64 64 65 65 onshore_dir_name = project.onshore_dir_name 66 66 coast_dir_name = project.coast_dir_name 67 67 coast_dir_name1 = project.coast_dir_name1 68 #island_dir_name = project.island_dir_name69 68 offshore_dir_name = project.offshore_dir_name 69 offshore_dir_name1 = project.offshore_dir_name1 70 offshore_dir_name2 = project.offshore_dir_name2 70 71 71 72 # creates DEM from asc data … … 91 92 G3 = Geospatial_data(file_name = coast_in_dir_name1 + '.txt',verbose=True) 92 93 G_off = Geospatial_data(file_name = offshore_in_dir_name + '.txt',verbose=True) 94 G_off1 = Geospatial_data(file_name = offshore_in_dir_name1 + '.txt',verbose=True) 95 G_off2 = Geospatial_data(file_name = offshore_in_dir_name2 + '.txt',verbose=True) 93 96 94 97 print'add all geospatial objects' 95 G = G1 + G2 + G3 + G_off 98 G = G1 + G2 + G3 + G_off + G_off1 + G_off2 96 99 97 100 print'clip combined geospatial object by bounding polygon' 98 #G_clipped = G.clip(project.bounding_polygon) 99 #FIXME: add a clip function to pts 100 #print'shape of clipped data', G_clipped.get_data_points().shape 101 G_clipped = G.clip(project.poly_all) 101 102 102 103 print'export combined DEM file' 103 104 if access(project.topographies_dir,F_OK) == 0: 104 105 mkdir (project.topographies_dir) 105 G.export_points_file(project.combined_dir_name + '.txt') 106 #G_clipped.export_points_file(project.combined_dir_name + '.xya') 106 G_clipped.export_points_file(project.combined_dir_name + '.txt') 107 107 108 108 print'project.combined_dir_name + .txt',project.combined_dir_name + '.txt' -
anuga_work/production/busselton/export_results.py
r5409 r5415 6 6 7 7 time_dir = '20080530_170705_run_final_0.6_exmouth_kvanputt' 8 time_dir = '20080619_115523_run_trial_0.6_exmouth_current_kvanputt' 9 8 10 cellsize = 25 9 11 #cellsize = 150 10 12 #timestep = 0 11 13 directory = project.output_dir 12 name = directory+ time_dir+sep+project.scenario_name14 name = directory+sep+'test'+sep+time_dir+sep+project.scenario_name 13 15 14 16 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts -
anuga_work/production/busselton/project.py
r5408 r5415 13 13 # file and system info 14 14 #--------------------------------- 15 #codename = 'project.py' 15 16 16 17 home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir 17 18 user = get_user_name() 18 19 host = get_host_name() 20 19 21 # INUNDATIONHOME is the inundation directory, not the data directory. 20 21 #needed when running using mpirun, mpirun doesn't inherit umask from .bashrc22 umask(002)23 22 24 23 #time stuff 25 24 time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir 25 gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir 26 26 build_time = time+'_build' 27 27 run_time = time+'_run' 28 29 tide = 0.6 28 print 'gtime: ', gtime 30 29 31 30 #Making assumptions about the location of scenario data … … 34 33 scenario = 'busselton_tsunami_scenario' 35 34 36 #Maybe will try to make project a class to allow these parameters to be passed in. 35 tide = 0.6 36 37 37 alpha = 0.1 38 38 friction=0.01 39 39 starttime=0 40 midtime=21600 41 #finaltime=25000 42 finaltime=86000 40 finaltime=80000 43 41 export_cellsize=25 44 42 setup='final' … … 62 60 yieldstep=60 63 61 64 dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(user) 65 66 67 # onshore data provided by WA DLI 68 #onshore_name = 'DLI_orthophoto_DEM' # original 69 onshore_name = 'dli_dem_clipped' # original 70 #islands 62 rev_num = 'current' 63 ##rev_num = '4695' # 2nd Sept 2007 64 ##rev_num = '4743' # 3nd Oct 2007 65 ##rev_num = '4777' # 1st Nov 2007 66 ##rev_num = '4874' # 3rd Dec 2007 67 ##rev_num = '4901' # 3rd Jan 2007 68 ##rev_num = '4990' # 5th Feb 2007 69 ##rev_num = '5103' # 3rd March 2007 70 ##rev_num = '5185' # 1st April 2007 71 ##rev_num = '5273' # 2nd May 2007 72 73 74 dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(rev_num)+'_'+str(user) 75 76 77 # onshore data provided by WA DLI - provided by Hamish on the 17th June 2008 78 79 onshore_name = 'busselton_v2_gda94_mga50' # original 71 80 72 81 # AHO + DPI data 73 coast_name = 'coastline_excluding_beach_survey' 74 coast_name1 = 'bussleton_beach_data' 75 offshore_name = 'Busselton_bathymetry' 82 coast_name = 'Contour_0' # provided by hamish, represent better coastline than the 100km as compared to charts 83 coast_name1 = 'beach_survey_final' 84 offshore_name = 'Bathymetry_final' 85 offshore_name1 = 'Busselton_Chart' 86 offshore_name2 = 'Busselton_Digitised' 76 87 77 88 #final topo name … … 82 93 83 94 topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep 84 topographies_dir = home+state+sep+scenario+sep+'anuga'+sep+'topographies'+sep95 topographies_dir = anuga_dir+'topographies'+sep 85 96 86 97 # input topo file location … … 89 100 coast_in_dir_name = topographies_in_dir + coast_name #coastline 90 101 coast_in_dir_name1 = topographies_in_dir + coast_name1 #beach survey 102 91 103 offshore_in_dir_name = topographies_in_dir + offshore_name #bathymetry 104 offshore_in_dir_name1 = topographies_in_dir + offshore_name1 #bathymetry Charts 105 offshore_in_dir_name2 = topographies_in_dir + offshore_name2 #Digitised Fairsheet 92 106 93 107 #output to anuga from build file … … 96 110 coast_dir_name = topographies_dir + coast_name 97 111 coast_dir_name1 = topographies_dir + coast_name1 112 98 113 offshore_dir_name = topographies_dir + offshore_name 114 offshore_dir_name1 = topographies_dir + offshore_name1 115 offshore_dir_name2 = topographies_dir + offshore_name2 99 116 100 117 #final topo files … … 108 125 tide_dir = anuga_dir+'tide_data'+sep 109 126 127 #boundaries_source = '1' 128 110 129 if source=='exmouth': 111 130 boundaries_name = 'busselton_3103_30052008' #exmouth gun … … 114 133 if source=='test': 115 134 boundaries_name = 'other' #exmouth gun 116 boundaries_in_dir = anuga_dir+'boundaries'+sep +'urs'+sep+'exmouth'+sep+'1_10000'+sep135 boundaries_in_dir = anuga_dir+'boundaries'+sep 117 136 118 137 … … 124 143 #output locations 125 144 output_dir = anuga_dir+'outputs'+sep 126 output_build_time_dir = output_dir +build_time+dir_comment+sep145 output_build_time_dir = output_dir +'test'+sep + build_time + dir_comment + sep 127 146 #output_run_time_dir = output_dir +run_time+dir_comment+sep 128 output_run_time_dir = anuga_dir+sep+'outputs'+sep+run_time+dir_comment+sep147 output_run_time_dir = output_dir +'test'+sep + run_time + dir_comment +sep # take test out 129 148 output_run_time_dir_name = output_run_time_dir + scenario_name #Used by post processing 130 149 131 150 #gauges 132 gauge_name = ' ???.csv'151 gauge_name = 'busselton.csv' 133 152 gauges_dir = home+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep 134 153 gauges_dir_name = gauges_dir + gauge_name … … 151 170 res_poly_all = 100000*res_factor 152 171 172 173 ############################### 174 # Interior region definitions 175 ############################### 176 177 #digitized polygons 178 poly_large = read_polygon(polygons_dir+'coast_5km_d20m.csv') 179 res_large = 1000*res_factor 180 181 poly_busselton = read_polygon(polygons_dir+'busselton_1km.csv') 182 res_busselton = 500*res_factor 183 184 poly_bunbury = read_polygon(polygons_dir+'bunbury_1km.csv') 185 res_bunbury = 500*res_factor 186 187 188 interior_regions = [[poly_large,res_large],[poly_busselton,res_busselton],[poly_bunbury,res_bunbury]] 189 190 191 boundary_tags={'back': [0, 1, 2, 3, 4, 9], 192 'side': [5], 'ocean': [6, 7, 8]} 193 194 trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all) 195 196 poly_mainland=read_polygon(polygons_dir+'initial_condition.csv') 197 198 print 'min number triangles', trigs_min 199 200 153 201 ################################################################### 154 202 # Clipping regions for export to asc and regions for clipping data 155 203 ################################################################### 156 204 157 # exporting asc grid 158 eastingmin = 340000 159 eastingmax = 350000 160 northingmin = 6273400 161 northingmax = 6277700 162 163 ############################### 164 # Interior region definitions 165 ############################### 166 167 #digitized polygons 168 poly_busselton1 = read_polygon(polygons_dir+'neg20_pos10_polygon.csv') 169 res_busselton1 = 10000*res_factor 170 171 poly_busselton2 = read_polygon(polygons_dir+'neg5_pos5_poly.csv') 172 res_busselton2 = 500*res_factor 173 174 #plot_polygons([polyAll,poly_broome1,poly_broome2,poly_broome3],figname='boundingpoly2',verbose=False) 175 176 interior_regions = [[poly_busselton1,res_busselton1],[poly_busselton2,res_busselton2]] 177 print 'Hello',interior_regions 178 179 boundary_tags={'back': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 14], 180 'side': [10], 'ocean': [11, 12, 13]} 181 182 trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all) 183 184 poly_mainland=read_polygon(polygons_dir+'initial_condition.csv') 185 186 print 'min number triangles', trigs_min 187 188 205 # exporting asc grid for Busselton 206 xminBusselton = 325000 207 xmaxBusselton = 360000 208 yminBusselton = 6273000 209 ymaxBusselton = 6290000 210 211 # exporting asc grid for Busselton 212 xminBunbury = 370000 213 xmaxBunbury = 386000 214 yminBunbury = 6305000 215 ymaxBunbury = 6334000 -
anuga_work/production/busselton/run_busselton.py
r5408 r5415 173 173 Br = Reflective_boundary(domain) 174 174 Bd = Dirichlet_boundary([kwargs['tide'],0,0]) 175 175 Bo = Dirichlet_boundary([kwargs['tide']+10.0,0,0]) # To be deleted for FESA runs 176 176 177 177 Bf = Field_boundary(kwargs['boundary_file'], … … 181 181 domain.set_boundary({'back': Bd, 182 182 'side': Bd, 183 'ocean': B f})183 'ocean': Bd}) #changed from Bf to Bd for large wave 184 184 185 185 kwargs['input_start_time']=domain.starttime … … 192 192 t0 = time.time() 193 193 194 for t in domain.evolve(yieldstep = 240, finaltime = kwargs['finaltime']): 194 for t in domain.evolve(yieldstep = project.yieldstep, finaltime = kwargs['finaltime'] 195 ,skip_initial_step = False ): 195 196 domain.write_time() 196 domain.write_boundary_statistics(tags = 'ocean') 197 domain.write_boundary_statistics(tags = 'ocean') 198 199 # To be deleted for FESA runs 200 if allclose(t, 240): 201 domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bo}) 202 203 if allclose(t, 1440): 204 domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bd}) 205 206 197 207 198 208 x, y = domain.get_maximum_inundation_location() … … 222 232 kwargs['starttime']=project.starttime 223 233 kwargs['yieldstep']=project.yieldstep 224 kwargs['midtime']=project.midtime225 234 kwargs['finaltime']=project.finaltime 226 235 -
anuga_work/production/perth/GetTimeseries.py
r5409 r5415 1 1 """ 2 Generate time series of nominated "gauges" read from project.gauge_filename. This 3 is done by first running sww2csv_gauges on two different directories to make 4 'csv' files. Then running csv2timeseries_graphs detailing the two directories 5 containing the csv file and produces one set of graphs in the 'output_dir' containing 6 the details at the gauges for both these sww files. 2 Generate images of "gauges" for production run 7 3 8 Note, this script will only work if pylab is installed on the platform 4 Inputs: 5 6 production dirs: dictionary of production directories with a 7 association to that simulation run, eg high tide, 8 low tide and MSL. 9 10 Outputs: 11 12 * figures used for report stored in the report_figure directory 9 13 10 14 """ 15 from os import getcwd, sep, altsep, mkdir, access, F_OK 16 import project 17 from anuga.abstract_2d_finite_volumes.util import sww2timeseries 11 18 12 from os import sep 13 import project 14 from anuga.abstract_2d_finite_volumes.util import sww2csv_gauges,csv2timeseries_graphs 19 production_dirs = {'20080619_115643_run_trial_0.6_exmouth_kvanputt': ''} 15 20 16 sww2csv_gauges('slide'+sep+'slidesource.sww', 17 project.gauge_filename, 18 quantities = ['stage','speed','depth','elevation'], 19 verbose=True) 20 21 sww2csv_gauges('fixed_wave'+sep+'fixed_wavesource.sww', 22 project.gauge_filename, 23 quantities = ['stage', 'speed','depth','elevation'], 24 verbose=True) 21 is_parallel = False 25 22 26 try: 27 import pylab 28 csv2timeseries_graphs(directories_dic={'slide'+sep:['Slide',0, 0], 29 'fixed_wave'+sep:['Fixed Wave',0,0]}, 30 output_dir='fixed_wave'+sep, 31 base_name='gauge_', 32 plot_numbers='', 33 quantities=['stage','speed','depth'], 34 extra_plot_name='', 35 assess_all_csv_files=True, 36 create_latex=False, 37 verbose=True) 38 except ImportError: 39 #ANUGA does not rely on pylab to work 40 print 'must have pylab installed to generate plots' 23 if is_parallel is True: 24 no_nodes = 4 41 25 26 if is_parallel is False: 27 28 swwfiles = {} 29 for label_id in production_dirs.keys(): 30 31 file_loc = project.output_dir + label_id + sep 32 swwfile = file_loc + project.scenario_name + '.sww' 33 swwfiles[swwfile] = label_id 34 35 texname, elev_output = sww2timeseries(swwfiles, 36 project.gauges_dir_name, 37 production_dirs, 38 report = False, 39 plot_quantity = ['stage', 'speed', 'depth'], 40 generate_fig = False, 41 surface = False, 42 time_min = None, 43 time_max = None, 44 time_unit = 'mins', 45 title_on = False, 46 use_cache = True, 47 verbose = True) 42 48 49 if is_parallel is True: 50 51 for count in range(no_nodes): 52 swwfiles = {} 53 for label_id in production_dirs.keys(): 54 55 file_loc = project.output_dir + label_id + sep 56 extra = '_P%i_%i' %(count,no_nodes) 57 swwfile = file_loc + project.scenario_name + extra + '.sww' 58 swwfiles[swwfile] = label_id 59 60 texname, elev_output = sww2timeseries(swwfiles, 61 project.gauges_dir_name, 62 production_dirs, 63 report = False, 64 plot_quantity = ['stage', 'speed'], 65 generate_fig = False, 66 surface = False, 67 time_min = None, 68 time_max = None, 69 time_unit = 'mins', 70 title_on = False, 71 use_cache = True, 72 verbose = True) 73 -
anuga_work/production/perth/export_results.py
r5409 r5415 6 6 7 7 #time_dir = '20080526_104946_run_final_0.6_test_kvanputt' 8 time_dir = '20080530_170833_run_final_0.6_exmouth_kvanputt'9 8 #time_dir = '20080530_170833_run_final_0.6_exmouth_kvanputt' 9 time_dir = '20080619_115643_run_trial_0.6_exmouth_kvanputt' 10 10 11 11 cellsize = 25 -
anuga_work/production/perth/export_results_all.py
r5409 r5415 7 7 #time_dir = '20080526_104946_run_final_0.6_test_kvanputt' 8 8 #time_dir = '20080530_170833_run_final_0.6_exmouth_kvanputt' 9 time_dir = '2008061 2_102742_run_final_0.6_exmouth_kvanputt'9 time_dir = '20080619_115643_run_trial_0.6_exmouth_kvanputt' 10 10 11 11 12 12 13 cellsize = 2513 cellsize = 10 14 14 #cellsize = 150 15 #timestep = 015 timestep = 0 16 16 directory = project.output_dir 17 17 name = directory+time_dir+sep+project.scenario_name … … 53 53 northing_max = project.ymaxRockingham 54 54 55 var = [2,3,4] # depth and speed55 # var = [2,3,4] # depth and speed 56 56 #var = [2] # depth 57 #var = [4]57 var = [0,4] 58 58 59 59 for which_var in var: … … 86 86 sww2dem(namei, basename_out = outnamei, 87 87 quantity = quantityname, 88 #timestep = timestep,88 timestep = timestep, 89 89 cellsize = cellsize, 90 90 easting_min = project_grad.e_min_area, … … 99 99 sww2dem(name, basename_out = outname, 100 100 quantity = quantityname, 101 #timestep = timestep,101 timestep = timestep, 102 102 cellsize = cellsize, 103 103 easting_min = easting_min, -
anuga_work/production/perth/project.py
r5408 r5415 37 37 alpha = 0.1 38 38 friction=0.01 39 starttime= 1000039 starttime=0 40 40 finaltime=80000 41 export_cellsize= 5042 setup=' final'41 export_cellsize=25 42 setup='trial' 43 43 source='exmouth' 44 44 … … 143 143 #gauges 144 144 gauge_name = 'perth.csv' 145 gauges_dir = anuga_dir+'gauges'+sep 145 146 gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep 147 beach_gauges = gauges_dir + 'beach_gauges.csv' 146 148 gauges_dir_name = gauges_dir + gauge_name 147 149 -
anuga_work/production/perth/run_perth.py
r5408 r5415 193 193 t0 = time.time() 194 194 195 for t in domain.evolve(yieldstep = 240, finaltime = kwargs['finaltime']196 ,skip_initial_step = True):195 for t in domain.evolve(yieldstep = project.yieldstep, finaltime = kwargs['finaltime'] 196 ,skip_initial_step = False): 197 197 domain.write_time() 198 198 domain.write_boundary_statistics(tags = 'ocean')
Note: See TracChangeset
for help on using the changeset viewer.