source: production/sydney_2006/plot_integral.py @ 3330

Last change on this file since 3330 was 3190, checked in by sexton, 18 years ago

MOST and ANUGA comparisons and updates

File size: 894 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 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.