function Intz = diskhist(DAtimeseries,twindow)
tic
duration = size(DAtimeseries,1);
Intz = zeros(duration,2);
for i=0:duration-twindow
    Intz(i+1+twindow/2,1)=size(find(DAtimeseries(i+1:i+twindow,1)),1);
    Intz(i+1+twindow/2,2)=size(find(DAtimeseries(i+1:i+twindow,2)),1);
end;
toc
t=toc


% function Intz = diskhist(DAtimeseries,twindow)
% duration = size(DAtimeseries,1);
% Intz = zeros(1:duration,1:2);
% for i=0:floor(duration/twindow)-1
%     Intz(i+1,1)=size(find(DAtimeseries(i*twindow+1:i*twindow+twindow,1)),1);
%     Intz(i+1,2)=size(find(DAtimeseries(i*twindow+1:i*twindow+twindow,2)),1);
% end;
%     