function out =  prod_view(infile)

%	1-412,2-443,3-490,4-510,5-555(e.g. Kd(:,1) refers to wavelength 412 SPMRdata);
filename=char(ncnames(infile));
[f p e]=fileparts(filename);

out.t = nctime(infile);                % Time in serial days

out.lambda = [412 443 490 510 555 656 665 670 683]; % nm

out.Depth = infile{'Depth_2_10'}(:);       % Depth (m) of 20m sensor
out.Depth(find(out.Depth == -999)) = NaN;

if ~isempty(infile{'Lu656_3_6'}(:))
	out.Lu = [infile{'Lu412_3_1'}(:) ...   % 20m radiance EP2
      infile{'Lu443_3_2'}(:) ...
      infile{'Lu490_3_3'}(:) ...
      infile{'Lu510_3_4'}(:) ...
      infile{'Lu555_3_5'}(:) ...
      infile{'Lu656_3_6'}(:) ...
      infile{'Lu665_3_6'}(:) ...
      infile{'Lu670_3_6'}(:) ...
      infile{'Lu683_3_7'}(:)];

out.Luname(:,1)=412;
out.Luname(:,2)=443;
out.Luname(:,3)=490;
out.Luname(:,4)=510;
out.Luname(:,5)=555;
out.Luname(:,6)=656;
out.Luname(:,7)=670;
out.Luname(:,8)=683;

else
   out.Lu = [infile{'Lu412_3_1'}(:) ...   % 20m radiance EP1
      infile{'Lu443_3_2'}(:) ...
      infile{'Lu490_3_3'}(:) ...
      infile{'Lu510_3_4'}(:) ...
      infile{'Lu555_3_5'}(:) ...
      infile{'Lu670_3_6'}(:) ...
      infile{'Lu683_3_7'}(:)];

out.Luname(:,1)=412;
out.Luname(:,2)=443;
out.Luname(:,3)=490;
out.Luname(:,4)=510;
out.Luname(:,5)=555;
out.Luname(:,6)=670;
out.Luname(:,7)=683;

end;

out.Lu(find(out.Lu == -999)) = NaN;

for i=1:5
   
   out.K(:,i)=oms_k1mod(infile,out.lambda(i),0);
   out.Kf(:,i)=oms_k1mod(infile,out.lambda(i));
   out.Kpure(:,i)=repmat(morel_k(0, out.lambda(i)), length(out.t), 1);
   out.Lw(:,i)=calc_lw(out.Lu(:,i),out.K(:,i),out.Depth);
   out.Lwf(:,i)=calc_lw(out.Lu(:,i),out.K(:,i),20);
   out.Lwn(:,i)=lw2lwn(out.Lw(:,i),out.t,infile{'latitude'}(:), infile{'longitude'}(:),out.lambda(i));
   out.Lwnf(:,i)=lw2lwn(out.Lwf(:,i),out.t,infile{'latitude'}(:), infile{'longitude'}(:),out.lambda(i));
   
   
end;
out.Morel=morel_chl2(out.K(:,3), 490);
out.Morelf=morel_chl2(out.Kf(:,3),490);
if strcmp(p(1:3),'ep1')
   Seawif=load('G:\variables\Ep1SeaWifChl');
elseif strcmp(p(1:3),'ep2')
   Seawif=load('G:\variables\Ep2SeaWifChl');
end;
flortime=floor(out.t);
for i=1:length(flortime)
    temp=find(flortime(i)==Seawif(:,1));
    if ~isempty(temp)
        SeaChl(i)=Seawif(temp,2);
    else
        SeaChl(i)=NaN;
    end;
end;
clear flortime;
clear Seawif;
out.SeaChl = SeaChl';
        

