

files = dirs('binfiles/*adu.bin');

i_dday = 1;
i_head = 3;
i_pitch = 4;
i_roll = 5;
i_reacq = 8;

for filei = 1:length(files)
   file = files(filei).name;
   bindata = read_bin(['binfiles/',file]);
   xlim = [min(bindata(1,:)) , max(bindata(1,:))];
   subplot(411);   plot(bindata(i_dday,:), bindata(i_head,:),'k');  
   xl(xlim);title('heading')
   subplot(412);   plot(bindata(i_dday,:), bindata(i_pitch,:),'k');   
   xl(xlim); yl(-6,6); title('pitch')
   subplot(413);   plot(bindata(i_dday,:), bindata(i_roll,:),'r');   
   xl(xlim); yl(-6,6);title('roll')
   subplot(414);   plot(bindata(i_dday,:), bindata(i_reacq,:),'k');
   xl(xlim); yl(0,1.2); title('reaquisition flag')

   paused
end


disp('about to look at gbin files')
paused

files = dirs('gbinfiles/*adu.gbin');

i_dday = 1;
i_head = 3;
i_pitch = 4;
i_roll = 5;

for filei = 1:length(files)
   file = files(filei).name;
   gbindata = read_bin(['gbinfiles/',file], bin_nrows('.adu.gbin'));
   plot(gbindata(1,:))
   rawfilebase
   paused
end
