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

Last change on this file since 7064 was 7064, checked in by rwilson, 15 years ago

Fiddling with layout of user guide.

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
11from os import sep
12import project
13from anuga.abstract_2d_finite_volumes.util import sww2csv_gauges,csv2timeseries_graphs
14
15sww2csv_gauges('slide'+sep+'slidesource.sww',
16                project.gauge_filename,
17                quantities=['stage','speed','depth','elevation'],
18                verbose=True)
19               
20sww2csv_gauges('fixed_wave'+sep+'fixed_wavesource.sww',
21               project.gauge_filename,
22               quantities=['stage', 'speed','depth','elevation'],
23               verbose=True)
24
25try: 
26    import pylab
27    csv2timeseries_graphs(directories_dic={'slide'+sep: ['Slide',0, 0],
28                                           'fixed_wave'+sep: ['Fixed Wave',0,0]},
29                          output_dir='fixed_wave'+sep,
30                          base_name='gauge_',
31                          plot_numbers='',
32                          quantities=['stage','speed','depth'],
33                          extra_plot_name='',
34                          assess_all_csv_files=True,                           
35                          create_latex=False,
36                          verbose=True)
37except ImportError:
38    #ANUGA does not rely on pylab to work
39    print 'must have pylab installed to generate plots'
Note: See TracBrowser for help on using the repository browser.