Changeset 5415 for anuga_work/production/perth
- Timestamp:
- Jun 24, 2008, 10:24:21 AM (17 years ago)
- Location:
- anuga_work/production/perth
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
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.