
function x = cs_lengths
% cs_lengths
%   This function simply determines the lengths of the laboratory cross 
%   section arrays. 

% ARGUMENTS:		none
% INPUT FILES:		none
% CALLS:				none
% CALLED BY:		input.m

% OTHER COMMENTS:
% Do we still need to be able to select among all of these different file types?
%
% July 17	- 	no longer using this procedure; instead, read in absorber array
%					lengths during program execution.

global ext
global len_crs

x = 1; % Set this to zero if we get an error somewhere along the way

if (ext(1,1:3) == 'ref') | (ext(1,1:3) == 'REF')   		% O3                
   len_crs(1) = 3382;
elseif (ext(1,1:3) == '510') | (ext(1,1:3) == '510')
   len_crs(1) = 3327;
elseif (ext(1,1:3) == 'eur') | (ext(1,1:3) == 'EUR')                           
   len_crs(1) = 3327;
elseif (ext(1,1:3) == '425') | (ext(1,1:3) == '468')                           
   len_crs(1) = 3327;
elseif (ext(1,1:3) == '420')	% new file size 8feb00 EKS               
   len_crs(1) = 3319;
else
   len_crs(1) = 3327;
   disp('FUNCTION cs_lengths: Error - check O3 cross section')
%   x = 0;
%   return
end 

if (ext(2,1:3) == 'ref') | (ext(2,1:3) == 'REF')             % NO2
   len_crs(2) = 3275;
elseif (ext(2,1:3) == '510') | (ext(2,1:3) == '510')                            
   len_crs(2) = 3405;
elseif (ext(2,1:3) == 'eur') | (ext(2,1:3) == 'EUR') 
   len_crs(2) = 3405;
elseif (ext(2,1:3) == '425') | (ext(2,1:3) == '468') 
   len_crs(2) = 3405;
elseif (ext(2,1:3) == '420')   % new file size 8feb00 EKS               
   len_crs(2) = 2281;
else
   len_crs(2) = 3405;
   disp('FUNCTION cs_lengths: Error - check NO2 cross section')
%   x = 0;
%   return
end

if (ext(3,1:3) == 'ref') | (ext(3,1:3) == 'REF')             % OClO
   len_crs(3) = 2413;
elseif (ext(3,1:3) == '510') | (ext(3,1:3) == 'nul') 
   len_crs(3) = 2413;
elseif (ext(3,1:3) == 'EUR') | (ext(3,1:3) == 'eur') 
   len_crs(3) = 2413;
elseif (ext(3,1:3) == '425') | (ext(3,1:3) == '468') 
   len_crs(3) = 2413;
elseif (ext(3,1:3) == '420')   % old file size okay 8feb00 EKS               
   len_crs(3) = 2413;
else
   len_crs(2) = 3405;
	disp('FUNCTION cs_lengths: Error - check OCLO cross section')
%   x = 0;
%   return
end

if (ext(4,1:3) == 'ref') | (ext(4,1:3) == 'REF')             % O4
   len_crs(4) = 2535;
elseif (ext(4,1:3) == '255') | (ext(4,1:3) == '255') 
   len_crs(4) = 2535;
elseif (ext(4,1:3) == '510') | (ext(4,1:3) == '510') 
   len_crs(4) = 2535;
elseif (ext(4,1:3) == 'EUR') | (ext(4,1:3) == 'eur') 
   len_crs(4) = 2535;
elseif (ext(4,1:3) == '425') | (ext(4,1:3) == '468') 
   len_crs(4) = 2535;
elseif (ext(4,1:3) == '420')   % old file size okay 8feb00 EKS               
   len_crs(4) = 2535;
else
   len_crs(4) = 2535;
   disp('FUNCTION cs_lengths: Error - check O4 cross section')
%   x = 0;
%   return
end

if (ext(5,1:3) == 'ref') | (ext(5,1:3) == 'REF')             % H2O
   len_crs(5) = 266;
elseif (ext(5,1:3) == '510') | (ext(5,1:3) == '510') 
   len_crs(5) = 266;
elseif (ext(5,1:3) == 'eur') | (ext(5,1:3) == 'EUR') 
   len_crs(5) = 266;
elseif (ext(5,1:3) == '425') | (ext(5,1:3) == '468') 
   len_crs(5) = 266;
elseif (ext(5,1:3) == '420')   % old file size okay 8feb00 EKS               
   len_crs(5) = 266;
else
   len_crs(5) = 266;
	disp('FUNCTION cs_lengths: Error - check H2O cross section')
%   x = 0;
%   return
end

if (ext(6,1:3) == 'ref') | (ext(6,1:3) == 'REF')             % BrO
   len_crs(6) = 1910;
elseif (ext(6,1:3) == '510') | (ext(6,1:3) == 'nul') 
   len_crs(6) = 1910;
elseif (ext(6,1:3) == 'eur') | (ext(6,1:3) == 'EUR') 
   len_crs(6) = 1910;
elseif (ext(6,1:3) == '425') | (ext(6,1:3) == '468') 
   len_crs(6) = 1910;
elseif (ext(6,1:3) == '420')   % old file size okay 8feb00 EKS               
   len_crs(6) = 1910;
else
   len_crs(6) = 1910;
	disp('FUNCTION cs_lengths: Error - check BrO cross section')
%   x = 0;
%   return
end

% For Ring: 
%           ring_crs.KIM = new correctly generated crs from UVISTAR spectra
%           ring_crs.CAL = simulated UV Ring cross section
%           ring_crs.VIS = simulated visible Ring cross section
%           ring_crs.van = generated crs from measurements in MANTRA '98
%           ring_crs.kel = modelled crs from Kelly Chance

if (ext(7,1:3) == 'kim') | (ext(7,1:3) == 'KIM')             % Ring or NO3
   len_crs(7) = 1151;
elseif (ext(7,1:3) == 'cal') | (ext(7,1:3) == 'CAL')  
   len_crs(7) = 852;
elseif (ext(7,1:3) == 'vis') | (ext(7,1:3) == 'VIS')  
   len_crs(7) = 3393;
elseif (ext(7,1:3) == '510') | (ext(7,1:3) == '510') 
   len_crs(7) = 23999;                             
elseif (ext(7,1:3) == 'EUR') | (ext(7,1:3) == 'eur') 
   len_crs(7) = 16100;
elseif (ext(7,1:3) == '425') | (ext(7,1:3) == '468') 
   len_crs(7) = 23999;
elseif (ext(7,1:3) == '420')   % new file size 8feb00 EKS               
   len_crs(7) = 24000;
else        
   len_crs(7) = 23999;
	disp('FUNCTION cs_lengths: Error - check Ring/NO3 cross section')
%   x = 0;
%   return
end
