pingpath = 'adcp_pings';
files = dirs(fullfile(pingpath, '*.raw'));

gps_nrows = 5;

start_end = [];
allsec = [];

for filei = 1:length(files)
   rawfile = files(filei).name;
   rawfilebase = rawfile(1:end-4);
   
   gpsdata = read_bin(fullfile('gbinfiles', [rawfilebase, '.gps.gbin']))
   badi = find(isnan(gpsdata(1,:)));
   gpsdata(:,badi)=[];
   logger_timerange = [gpsdata(1,1) gpsdata(1,end)];
   %bindata is [logger_dday, fullggadday, sec_pc_minus_utc, lon, lat]
   allsec = [alldt gpsdata(3,:)];
   start_end = [start_end ; logger_timerange];
end

clf
subplot(211)
plot(86400*(start_end(2:end,1) - start_end(1:end-1,2)),'.-')
title('difference  in logger times at end(file1) to start(file2)')
yl(0,5)
subplot(212)
plot(allsec)
title('pc - utc in seconds')
yl(0,2)

