function [time wl dat]=rd_bb9(fnam)
%
%  Program to read DH-4/WAP BB9 file
%
%  INPUTS
%    FNAM = file name to read in.
%
%  OUTPUTS
%    
%  	 time = timestmap from WAP
%
%    dat = analog data
%
%
%  Written by Emmanuel Boss, U of Maine, 2018 for EXPORTS01.
%   

fid=fopen(fnam,'r')
%clear all
%fid=fopen('C:\Documents and Settings\Emmanuel Boss\Desktop\RIVET2012\day1\archive_24_T_ASCII.000','r')
%skip first line  
%   line=fgetl(fid);
line=fgetl(fid);
junk=0;
i=1;
while(feof(fid)==0);
      junk=fscanf(fid,'%f',[1]);
      if isempty(junk);
          break
      end
      time(i)=junk;
      dat1=fscanf(fid,'%f',[36]);
      dat(i,:)=dat1([1:4:36]);
      i=i+1;
      clear junk dat1
end
wl=[412,440,488,510,532,595,650,715,880];
fclose(fid);