1 | """ |
---|
2 | Generate time series of nominated "gauges" |
---|
3 | Note, this script will only work if pylab is installed on the platform |
---|
4 | |
---|
5 | Inputs: |
---|
6 | |
---|
7 | production dirs: dictionary of production directories with a |
---|
8 | association to that simulation run, eg high tide, |
---|
9 | magnitude, etc. |
---|
10 | |
---|
11 | Outputs: |
---|
12 | |
---|
13 | * figures stored in same directory as sww file |
---|
14 | * time series data stored in csv files in same directory as sww file |
---|
15 | * elevation at nominated gauges (elev_output) |
---|
16 | """ |
---|
17 | |
---|
18 | from os import sep |
---|
19 | import project |
---|
20 | from anuga.abstract_2d_finite_volumes.util import sww2csv_gauges,csv2timeseries_graphs |
---|
21 | |
---|
22 | sww2csv_gauges('slide'+sep+'slidesource.sww', |
---|
23 | project.gauge_filename, |
---|
24 | quantities = ['stage','speed','depth','elevation'], |
---|
25 | verbose=True) |
---|
26 | |
---|
27 | sww2csv_gauges('fixed_wave'+sep+'fixed_wavesource.sww', |
---|
28 | project.gauge_filename, |
---|
29 | quantities = ['stage', 'speed','depth','elevation'], |
---|
30 | verbose=True) |
---|
31 | |
---|
32 | try: |
---|
33 | import pylab |
---|
34 | csv2timeseries_graphs(directories_dic={'slide'+sep:['Slide',0, 0], |
---|
35 | 'fixed_wave'+sep:['Fixed Wave',0,0]}, |
---|
36 | output_dir='',#fixed_wave'+sep, |
---|
37 | base_name='gauge_', |
---|
38 | plot_numbers='', |
---|
39 | quantities=['stage','speed','depth'], |
---|
40 | extra_plot_name='', |
---|
41 | assess_all_csv_files=True, |
---|
42 | create_latex=False, |
---|
43 | verbose=True) |
---|
44 | except ImportError: |
---|
45 | #ANUGA don't need pylab to work so the system doesn't |
---|
46 | #rely on pylab being installed |
---|
47 | print 'must have pylab install to generate plots' |
---|
48 | |
---|
49 | |
---|