source: trunk/anuga_work/production/sydney_2006/plot_integral.py @ 7877

Last change on this file since 7877 was 3514, checked in by duncan, 18 years ago

Hi all,
I'm doing a change in the anuga structure, moving the code to

\anuga_core\source\anuga

After you have done an svn update, the PYTHONPATH has to be changed to;
PYTHONPATH = anuga_core/source/

This is part of changes required to make installation of anuga quicker and reducing the size of our sandpits.

If any imports are broken, try fixing them. With adding anuga. to them for example. If this seems to have really broken things, email/phone me.

Cheers
Duncan

File size: 900 bytes
Line 
1"""Read in csv file and plot time series of integral (should be conserved
2once water stops entering the boundary.
3Jane Sexton, GA 2006
4
5"""
6
7import project
8from anuga.pyvolution.util import file_function
9from pylab import *
10
11def get_integral_from_file(filename):
12    fid = open(filename)
13    lines = fid.readlines()
14    fid.close()
15
16    times = []
17    volumes = []
18    for line in lines:
19        fields = line.split(',')
20        time = float(fields[0])
21        volume = float(fields[1])
22        times.append(time)
23        volumes.append(volume)
24       
25    return times, volumes
26
27t, integral = get_integral_from_file(project.integraltimeseries+'.csv')
28
29ion()
30hold(False)
31plot(t, integral, '.-b')
32axis([0, max(t), min(integral)-0.1, min(integral) + 1])
33title('Checking for water conservation')
34xlabel('Time (sec)')
35ylabel('Volume')   
36savefig('Volume conservation')
37   
38# raw_input('Next')
39
40show()
Note: See TracBrowser for help on using the repository browser.