function [t,dat,wla,wlc,itemp,xtemp]=rd_wetview_acs298(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 298 in summer 2018
wla=[398.4	401.9	405.5	409.1	412.6	416.2	420.3	424.4	428.6	432.7	436.6	440.3	444.8	449.5	453.9	458.2	462.4	466.8	471.3	475.7	480.4	485	489.4	493.5	497.9	502.4	506.8	511.4	515.9	520.6	524.9	529.1	533.4	537.5	541.6	545.6	549.8	554.1	558.6	562.7	566.8	570.7	574.4	578.1	579.5	583.4	587.3	591.5	595.9	600.1	604.5	608.8	613.4	617.7	622	626.2	630.5	634.5	638.7	643	647.3	651.7	656	660.5	664.9	669.1	673.7	677.8	681.7	685.9	689.8	693.9	697.8	701.7	705.5	709.5	713.4	716.9	720.5	724.6	728.4	731.9	735.6	738.9];
wlc=[401	405	408.2	411.6	415.1	419.2	423.3	427.8	431.5	435.4	439.3	443.7	448.1	452.7	456.6	460.8	464.8	469.4	474	478.5	483.2	487.6	491.8	496.1	500.1	504.7	509.2	514	518.4	522.9	527.2	531.3	535.3	539.4	543.7	547.8	552.1	556.3	560.6	564.7	568.6	572.5	576.1	579.7	583.2	587.5	591.5	595.7	599.9	604.3	608.7	613	617.5	621.7	626	630.4	634.4	638.7	643	647.3	651.7	656.2	660.6	664.9	669.1	673.6	677.6	681.9	685.9	690	693.7	697.9	701.8	705.5	709.2	713.2	717.1	721.1	724.8	728.6	732.1	735.8	739.6	742.9];
junk=fscanf(fid,'%e',[1]);
N=2*84;
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);
