function [t,dat,wla,wlc,itemp,xtemp]=rd_wetview_acs301(fnam)
%
%  Program to read WetView ac-a data files
%
%  INPUTS
%    FNAM = file name to read in.
%
%  OUTPUTS
%    
%  	t-time for acs data in days
%    dat = ACs data
%    T=temp. P=pressure
%
%
%  Written by Emmanuel Boss, UMAINE, 2018 for EXPORTS01.

fid=fopen(fnam,'r')

%skip first 98 lines
for i=1:98   
   line=fgetl(fid);
end
i=1;
%84 wavelengths of 301 in summer 2018
wla=[401.2	404.8	408	411.7	415.1	419	423.1	427.4	431.5	435	438.9	443.5	447.9	452.3	456.6	461	465.2	469.6	474.3	479.2	483.9	488	492.1	496.3	500.3	505	509.5	514.2	518.5	522.9	527.2	531.5	535.3	539.4	543.7	547.6	551.9	556.3	560.6	564.7	568.6	572.4	575.8	579.1	583	586.8	590.8	595.4	599.9	604.3	608.8	613.5	617.9	622.2	626.5	630.5	634.7	639	643.3	647.9	652.2	656.7	661.1	665.7	670	674.2	678.8	682.7	686.8	690.6	694.5	698.1	701.8	705.7	709.5	713.4	716.9	720.8	724.6	728.1	731.5	735.4];
wlc=[399.1	403	406.4	410.3	413.7	417.4	421.4	425.8	430.2	434.1	438	442.5	446.7	451.1	455.9	460.3	464.5	469.1	473.6	478.3	483.1	487.8	491.8	496.1	500.1	505	509.5	514.2	519	523.4	527.7	532	536	540.1	544.2	548.5	552.9	557.5	561.6	565.4	569.3	573.4	577.1	580.3	584.2	588.3	592.8	597.2	601.8	606.1	610.7	615.4	619.7	624.4	628.7	633	637.2	641.5	646.3	650.2	654.9	659.6	663.9	668.2	672.6	677	681.2	685.6	689.5	693.2	697	701	704.9	708.9	712.4	716.3	720.5	723.8	727.6	731.1	734.3	738];
junk=fscanf(fid,'%e',[1]);
N=2*82;
while(feof(fid)==0)
   t(i)=junk;
   junk=fscanf(fid,'%e',[N]);
   if size(junk)<N
       break
   end
   dat(i,:)=junk(1:N)';
   junk=fscanf(fid,'%e',[5]);
   itemp(i)=junk(1);
   xtemp(i)=junk(4);
   i=i+1;
   junk=fscanf(fid,'%e',[1]);
end
fclose(fid);
