source: production/sydney_2006/plot_integral.py @ 2763

Last change on this file since 2763 was 2487, checked in by sexton, 19 years ago

New run_sydney file incorporating (1) reading in polygons (created by GIS guys) to create the interior regions, (2) allocating a test data set (defined in project.py) for elevation to test for the black screen of death and (3) track the volume in time (plot_integral.py is the script to plot the output)

File size: 838 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')
32title('Checking for water conservation')
33xlabel('Time (sec)')
34ylabel('Volume')   
35savefig('Volume conservation')
36   
37# raw_input('Next')
38
39show()
Note: See TracBrowser for help on using the repository browser.