source: anuga_core/documentation/user_manual/demos/cairns/GetTimeseries.py @ 4948

Last change on this file since 4948 was 4948, checked in by nick, 17 years ago

update user manual

File size: 1.8 KB
Line 
1"""
2Generate time series of nominated "gauges"
3Note, this script will only work if pylab is installed on the platform
4
5Inputs:
6
7production dirs: dictionary of production directories with a
8                 association to that simulation run, eg high tide,
9                 magnitude, etc.
10                   
11Outputs:
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
18from os import sep
19import project
20from anuga.abstract_2d_finite_volumes.util import sww2csv_gauges,csv2timeseries_graphs
21
22sww2csv_gauges('slide'+sep+'slidesource.sww',
23                project.gauge_filename,
24                quantities = ['stage','speed','depth','elevation'],
25                verbose=True)
26               
27sww2csv_gauges('fixed_wave'+sep+'fixed_wavesource.sww',
28               project.gauge_filename,
29               quantities = ['stage', 'speed','depth','elevation'],
30               verbose=True)
31
32try: 
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)
44except 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
Note: See TracBrowser for help on using the repository browser.