1 | """ |
---|
2 | Generate time series of nominated "gauges". |
---|
3 | Input: sww file from run_model.py |
---|
4 | gauges project.gauge_filename |
---|
5 | Output: csv files stage,speed,depth,elevation over time (sec) |
---|
6 | Stored in the 'outputs_folder' folder for respective .sww file |
---|
7 | |
---|
8 | Note: |
---|
9 | Will run through all .sww files in order of time within each output folder |
---|
10 | """ |
---|
11 | |
---|
12 | from os import sep, rename, listdir, system |
---|
13 | from os.path import join |
---|
14 | from anuga.abstract_2d_finite_volumes.util import sww2csv_gauges,csv2timeseries_graphs |
---|
15 | import project |
---|
16 | |
---|
17 | directory = project.output_folder |
---|
18 | #Folders that contain the sww files of interest found in anuga/outputs |
---|
19 | time_dir1 = '20090619_165107_run_final_0_58260_None_kvanputt' |
---|
20 | time_dir2 = '20090619_165136_run_final_0.8_58260_None_kvanputt' |
---|
21 | |
---|
22 | time_dirs = [time_dir1, time_dir2] |
---|
23 | |
---|
24 | print 'time directories', time_dirs |
---|
25 | |
---|
26 | for time_dir in time_dirs: |
---|
27 | name = join(directory,time_dir,project.scenario_name) |
---|
28 | gauge = project.gauges |
---|
29 | sww2csv_gauges(name+'.sww',gauge, |
---|
30 | quantities = ['stage','speed','depth','elevation'], |
---|
31 | verbose=True) |
---|
32 | |
---|
33 | |
---|