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

Last change on this file since 4966 was 4966, checked in by nick, 12 years ago

small changes to GetTimeseries?.py

File size: 1.7 KB
Line 
1"""
2Generate time series of nominated "gauges" read from project.gauge_filename. This
3is done by first running sww2csv_gauges on two different directories to make
4'csv' files. Then running csv2timeseries_graphs detailing the two directories
5containing the csv file and produces one set of graphs in the 'output_dir' containing
6the details at the gauges for both these sww files.
7
8Note, this script will only work if pylab is installed on the platform
9
10"""
11
12from os import sep
13import project
14from anuga.abstract_2d_finite_volumes.util import sww2csv_gauges,csv2timeseries_graphs
15
16sww2csv_gauges('slide'+sep+'slidesource.sww',
17                project.gauge_filename,
18                quantities = ['stage','speed','depth','elevation'],
19                verbose=True)
20               
21sww2csv_gauges('fixed_wave'+sep+'fixed_wavesource.sww',
22               project.gauge_filename,
23               quantities = ['stage', 'speed','depth','elevation'],
24               verbose=True)
25
26try: 
27    import pylab
28    csv2timeseries_graphs(directories_dic={'slide'+sep:['Slide',0, 0],
29                                           'fixed_wave'+sep:['Fixed Wave',0,0]},
30                            output_dir='fixed_wave'+sep,
31                            base_name='gauge_',
32                            plot_numbers='',
33                            quantities=['stage','speed','depth'],
34                            extra_plot_name='',
35                            assess_all_csv_files=True,                           
36                            create_latex=False,
37                            verbose=True)
38except ImportError:
39    #ANUGA does not rely on pylab to work
40    print 'must have pylab installed to generate plots'
41   
42
Note: See TracBrowser for help on using the repository browser.