Last change
on this file since 4344 was
3514,
checked in by duncan, 19 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 |
---|
2 | once water stops entering the boundary. |
---|
3 | Jane Sexton, GA 2006 |
---|
4 | |
---|
5 | """ |
---|
6 | |
---|
7 | import project |
---|
8 | from anuga.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 | axis([0, max(t), min(integral)-0.1, min(integral) + 1]) |
---|
33 | title('Checking for water conservation') |
---|
34 | xlabel('Time (sec)') |
---|
35 | ylabel('Volume') |
---|
36 | savefig('Volume conservation') |
---|
37 | |
---|
38 | # raw_input('Next') |
---|
39 | |
---|
40 | show() |
---|
Note: See
TracBrowser
for help on using the repository browser.