function S = oms_getinfo(infile)
% OMS_GETINFO - Get useful variable attribute info from OMS files
% The information in the structure is useful for searching for a variable
% with desired attributes.
%
% Use as: S = oms_getinfo(infile)
%
% Inputs: infile = an oms netcdf file object
%
% Output: S = attribute info structure with the follwing fields
%          name   = the name of the variable
%          symbol = a cell array of symbols for each variable converted
%                   to all lower case characters
%          wavelength = a vector of measured wavelengths (nm) for each sensor
%          oasis_bank  = the Oasis Bank of each variable
%          instrument_depth = The depth of the instrument

% Brian Schlining
% 13 Dec 1999


v = var(infile);

for i = 1:length(v)
   
   S.name(i) = ncnames(v{i});
   
   s = lower(v{i}.symbol(:));
   if (isempty(s))
      S.symbol{i} = 'null';
   else
      S.symbol{i} = s;
   end
   
   u = v{i}.units(:);
   if (isempty(s))
      S.units{i} = 'null';
   else
      S.units{i} = u;
   end
   
   wl = v{i}.wavelength(:);
   if (isempty(wl) | wl == v{i}.FillValue_(:))
      S.wavelength(i) = NaN;
   else
      S.wavelength(i) = wl;
   end
   
   b = v{i}.bank(:);
   if (isempty(b) | b == v{i}.FillValue_(:))
      S.bank(i) = NaN;
   else
      S.bank(i) = b;
   end
   
   d = v{i}.instrumentDepth(:);
   if (isempty(d) | d == v{i}.FillValue_(:))
      S.instrumentDepth(i) = NaN;
   else
      S.instrumentDepth(i) = d;
   end
end