1 | """ |
---|
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 | |
---|
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 |
---|
12 | """ |
---|
13 | |
---|
14 | from os import sep, rename, listdir, system |
---|
15 | from anuga.abstract_2d_finite_volumes.util import sww2csv_gauges,csv2timeseries_graphs |
---|
16 | import project |
---|
17 | |
---|
18 | directory = project.output_folder |
---|
19 | |
---|
20 | time_dir1 = '20090520_144937_run_final_0.0_58272_jgriffin' |
---|
21 | time_dir2 = '20090520_145453_run_final_0.0_58115_jgriffin' |
---|
22 | time_dir3 = '20090520_145156_run_final_1.0_58272_jgriffin' |
---|
23 | time_dir4 = '20090520_145208_run_final_0.0_51445_jgriffin' |
---|
24 | time_dir5 = '20090520_145510_run_final_0.0_58129_jgriffin' |
---|
25 | time_dir6 = '20090520_145608_run_final_0.0_58226_jgriffin' |
---|
26 | time_dir7 = '20090520_145616_run_final_0.0_58284_jgriffin' |
---|
27 | time_dir8 = '20090520_145700_run_final_0.0_58286_jgriffin' |
---|
28 | time_dir9 = '20090525_093040_run_final_1.0_51445_jgriffin' |
---|
29 | |
---|
30 | |
---|
31 | time_dirs = [time_dir1, time_dir2, time_dir3, time_dir4, time_dir5, time_dir6, time_dir7, time_dir8, time_dir9] |
---|
32 | |
---|
33 | |
---|
34 | for time_dir in time_dirs: |
---|
35 | name = directory+sep+time_dir+sep+project.scenario_name |
---|
36 | gauge = project.gauges |
---|
37 | sww2csv_gauges(name+'.sww',gauge, |
---|
38 | quantities = ['stage','speed','depth'], |
---|
39 | verbose=True) |
---|
40 | |
---|
41 | |
---|