"""Read in csv file and plot time series of integral (should be conserved once water stops entering the boundary. Jane Sexton, GA 2006 """ import project from pyvolution.util import file_function from pylab import * def get_integral_from_file(filename): fid = open(filename) lines = fid.readlines() fid.close() times = [] volumes = [] for line in lines: fields = line.split(',') time = float(fields[0]) volume = float(fields[1]) times.append(time) volumes.append(volume) return times, volumes t, integral = get_integral_from_file(project.integraltimeseries+'.csv') ion() hold(False) plot(t, integral, '.-b') axis([0, max(t), min(integral)-0.1, min(integral) + 1]) title('Checking for water conservation') xlabel('Time (sec)') ylabel('Volume') savefig('Volume conservation') # raw_input('Next') show()