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 |
---|
2 | once water stops entering the boundary. |
---|
3 | Jane Sexton, GA 2006 |
---|
4 | |
---|
5 | """ |
---|
6 | |
---|
7 | import project |
---|
8 | from pyvolution.util import file_function |
---|
9 | from pylab import * |
---|
10 | |
---|
11 | def 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 | |
---|
27 | t, integral = get_integral_from_file(project.integraltimeseries+'.csv') |
---|
28 | |
---|
29 | ion() |
---|
30 | hold(False) |
---|
31 | plot(t, integral, '.-b') |
---|
32 | title('Checking for water conservation') |
---|
33 | xlabel('Time (sec)') |
---|
34 | ylabel('Volume') |
---|
35 | savefig('Volume conservation') |
---|
36 | |
---|
37 | # raw_input('Next') |
---|
38 | |
---|
39 | show() |
---|
Note: See
TracBrowser
for help on using the repository browser.