function [volume]=getvolume(cutdatehours,cutdischarges,interval)
%invoke me with 
% 

figure(1)
clf
plot(cutdatehours, cutdischarges,'k+')
datetick('x')
hold on
plot(cutdatehours, cutdischarges,'b-')

xi=min(cutdatehours):interval:max(cutdatehours);
yi=interp1(cutdatehours,cutdischarges,xi);
fill(xi,yi,'b')
plot(xi,yi,'r.')


secondsperday=24*60*60;
intervalinseconds=secondsperday*interval;
intervalinminutes=intervalinseconds/60

tf=isfinite(yi);
finiteq=find(tf);
volumematrix=yi(finiteq)*intervalinseconds;
volume=sum(volumematrix)

xlabel('date/time')
ylabel('discharge')
title(['Discharge volume = ',num2str(volume),' ft^3 (', datestr(min(xi),0),' to ',datestr(max(xi),0),')'])







