Changeset 6017
- Timestamp:
- Nov 28, 2008, 11:32:55 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/busselton/get_timeseries.py
r5702 r6017 1 1 """ 2 Generate time series of nominated "gauges" read from project.gauge_filename. This3 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 time series of nominated "gauges". 3 Input: sww file from run_perth.py 4 gauges project.gauge_filename 5 Output: csv files stage,speed,depth,elevation over time 6 Stored in the 'outputs_dir' folder for respective .sww file 7 7 8 Note, this script will only work if pylab is installed on the platform 9 8 Note: 9 Can run different sww files at the same time 10 make sure if there is a second sww file that it is placed into a folder called sww2 11 Can run different gauges at the same time - ie testing boundary index point 10 12 """ 11 13 12 from os import sep 14 from os import sep, rename, listdir, system 13 15 from anuga.abstract_2d_finite_volumes.util import sww2csv_gauges,csv2timeseries_graphs 14 15 16 import project 16 17 18 directory = project.output_dir 17 19 18 #timestamp='20080724_121200_run_trial_0.6_polyline_alpha0.1_kvanputt' 19 #timestamp='20080724_161830_run_final_0.6_polyline_alpha0.1_kvanputt' 20 timestamp1='20080815_103818_run_final_0_polyline_newExtent_kvanputt' 21 timestamp2='20080815_103708_run_final_0.6_polyline_newExtent_kvanputt' 20 ##time_dir1 = '20081009_184721_run_final_0.6_68693_alpha0.1_kvanputt' 21 ##time_dir2 = '20081031_120515_run_final_0_27255_alpha0.1_kvanputt' 22 time_dir3 = '20081031_120753_run_final_0.6_27283_alpha0.1_kvanputt' 23 ##time_dir4 = '20081031_120642_run_final_0_27283_alpha0.1_kvanputt' 24 ##time_dir5 = '20081031_120316_run_final_0_68693_alpha0.1_kvanputt' 25 ##time_dir6 = '20081111_113832_run_final_0.6_27255_alpha0.1_kvanputt' 22 26 23 timestamps = [timestamp1, timestamp2] 24 for timestamp in timestamps: 27 time_dirs = [time_dir3] #1, time_dir2, time_dir3, time_dir4, time_dir5, time_dir6] 25 28 26 filename1=project.output_dir+timestamp+sep+project.scenario_name+'.sww' 27 filename2=project.output_dir+timestamp+sep+'busselton_time_38340'+sep+project.scenario_name+'_time_38340_0.sww' 29 for time_dir in time_dirs: 30 31 name1 = directory+time_dir+sep+project.scenario_name 32 #name2 = directory+time_dir+sep+project.scenario_name+'_time_39600_0' 33 #name3 = directory+time_dir+sep+project.scenario_name+'_time_79200_0' 28 34 29 filenames = [filename1, filename2] 30 for filename in filenames: 35 names = [name1] #, name2, name3] 31 36 32 sww2csv_gauges(filename, 33 project.gauges_dir_name, 34 #project.gauges_dir_name2, 37 for i, name in enumerate(names): 38 gauge = project.gauges_dir_name 39 40 sww2csv_gauges(name+'.sww',gauge, 35 41 quantities = ['stage','speed','depth','elevation'], 36 42 verbose=True) 37 43 ## for filename in listdir(time_dir): 44 ## total_filename = 'All_' + filename 45 ## if i == 0: 46 ## if filename.startswith('gauge_'): 47 ## rename(filename,total_filename) 48 ## else: 49 ## system('cat %s %s > %s' %(total_filename,filename,total_filename)) 50 ## 51 38 52 39 40
Note: See TracChangeset
for help on using the changeset viewer.