function [Data] = ThrowWrongTimesOut(Data)
%SUBFUNCTION of readDATA, throws away data with wrong times
Data.DateNum = datenum(Data.Year,Data.Month,Data.Day,Data.Hour,0,0);
wrongTime=1;
while wrongTime==1
a=0;
clear L;
for i=2:length(Data.Year)-1
   t=Data.DateNum(i-1:i+1);
   tc=t(~isnan(Data.DateNum(i-1:i+1)));
    if min(tc)~=tc(1)
       j= find(t==min(t));
       a=a+1;
       L(a)=i-2+j; 
       Data.DateNum(i-2+j)=NaN;
    end
    t=Data.DateNum(i-1:i+1);
    tc=t(~isnan(Data.DateNum(i-1:i+1)));
    if max(tc)~=tc(end)
       j= find(t==max(t));
       a=a+1;
       L(a)=i-2+j; 
       Data.DateNum(i-2+j)=NaN;
    end
end
try {L};
   Data.Day(L)=999;
    fprintf(['# wrong times: ', int2str(size(L,2)) '\n'])
catch Exeption
    fprintf('No more wrong times found \n')
    wrongTime=0;
end
    keep=find(isnan(Data.DateNum)==0);
    Data.Year    = Data.Year(keep);
    Data.Month   = Data.Month(keep);
    Data.Day     = Data.Day(keep);
    Data.Hour    = Data.Hour(keep);
    Data.NMeteor = Data.NMeteor(keep);
    Data.Frang   = Data.Frang(keep);
    Data.Rsep    = Data.Rsep(keep);
    Data.Vx      = Data.Vx(keep);
    Data.Vy      = Data.Vy(keep);
    Data.Lat     = Data.Lat(keep);
    Data.Lon     = Data.Lon(keep);
    Data.Vm      = Data.Vm(keep);
    Data.Vm_lat  = Data.Vm_lat(keep);
    Data.Vm_lon  = Data.Vm_lon(keep);
    Data.SD_Vx   = Data.SD_Vx(keep);
    Data.SD_Vy   = Data.SD_Vy(keep);
    Data.DateNum=Data.DateNum(keep);
%    Data.DaySinceStart= Data.DaySinceStart(keep);
end
end

