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

Last change on this file since 4087 was 4087, checked in by sexton, 17 years ago

user manual updates

File size: 1.5 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 getcwd, sep, altsep, mkdir, access, F_OK
19import project
20from anuga.abstract_2d_finite_volumes.util import sww2timeseries
21
22# nominate directory location of sww file with associated attribute
23production_dirs = {'slide': 'Slide'}
24
25# Generate figures
26swwfiles = {}
27for label_id in production_dirs.keys():
28    file_loc = label_id + sep
29    swwfile = file_loc + label_id + 'source.sww'
30    swwfiles[swwfile] = label_id
31
32texname, elev_output = sww2timeseries(swwfiles,
33                                      project.gauge_filename,
34                                      production_dirs,
35                                      report = False,
36                                      reportname = '',
37                                      plot_quantity = ['stage', 'speed'],
38                                      surface = False,
39                                      time_min = None,
40                                      time_max = None,
41                                      title_on = True,
42                                      verbose = True)
Note: See TracBrowser for help on using the repository browser.