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_dir |
---|
19 | |
---|
20 | ##time_dir1 = '20081031_133353_run_final_0.6_68693_alpha0.1_kvanputt'+sep+'gauge' |
---|
21 | ##time_dir2 = '20081031_133511_run_final_0_68693_alpha0.1_kvanputt'+sep+'gauge' |
---|
22 | ##time_dir3 = '20081031_133624_run_final_0_27255_alpha0.1_kvanputt'+sep+'gauge' |
---|
23 | time_dir4 = '20081031_133735_run_final_0.6_27255_alpha0.1_kvanputt' |
---|
24 | ##time_dir5 = '20081031_133841_run_final_0_27283_alpha0.1_kvanputt'+sep+'gauge' |
---|
25 | ##time_dir6 = '20081031_133925_run_final_0.6_27283_alpha0.1_kvanputt'+sep+'gauge' |
---|
26 | |
---|
27 | time_dirs = [time_dir4] #[time_dir1, time_dir2, time_dir3, time_dir4, time_dir5, time_dir6] |
---|
28 | |
---|
29 | for time_dir in time_dirs: |
---|
30 | name = directory+time_dir+sep+project.scenario_name |
---|
31 | gauge = project.gauges_dir_name |
---|
32 | sww2csv_gauges(name+'.sww',gauge, |
---|
33 | quantities = ['stage','speed','depth','elevation'], |
---|
34 | verbose=True) |
---|
35 | |
---|
36 | |
---|
37 | ## name1 = directory+time_dir+sep+project.scenario_name |
---|
38 | #### name2 = directory+time_dir+sep+project.scenario_name+'_time_43380_0' |
---|
39 | #### name3 = directory+time_dir+sep+project.scenario_name+'_time_78360_0' |
---|
40 | ## |
---|
41 | ## names = [name1]#, name2, name3] |
---|
42 | ## |
---|
43 | ## for i, name in enumerate(names): |
---|
44 | ## gauge = project.gauges_dir_name |
---|
45 | #### out_name = 'gauge_%d_' % i |
---|
46 | ## print name |
---|
47 | ## sww2csv_gauges(name+'.sww',gauge,#out_name = out_name, |
---|
48 | ## quantities = ['stage','speed','depth','elevation'], |
---|
49 | ## verbose=True) |
---|
50 | ## |
---|