function at_lookFoulingRatio(id, Date1, Date2)
% AT_FRAT_PLOT - Create plots of fouling ratios for the entire deployment
%
% Use as: at_frat_plot(e,ep, Filename)
%
% Inputs: e = output from ep_cmpl
%         ep = Eqpac mooring ID (1 or 2)
%         Filename = Name of gif file to save plot as (optional: if not 
%                    specified no file is create


% Brian Schlining
% 13 Aug 1999


warning off
ep_ini;                             % Load the header of each column of data (ColumnS) and the units (UnitS)

% Set the path to the data file depending on what type of machine this function is run from
switch lower(id)
case 'ep1'
   loc = '0 155W';
   FileName = 'ep1_specprr_full.nc';
   lon = -155;
   dat = ep1;
case 'ep2'
   loc = '2S 170W';
   FileName = 'ep2_specprr_full.nc';
   lon = -170;
   dat = ep2;
otherwise
   loc = [];
   return
end

FileLoc = fullfile(getOasisPath, 'eqpac', 'netcdf', FileName);

ep       = netcdf(FileLoc);
Lu683_1  = ep{'Lu683_1_7'}(:);
Lu555_1  = ep{'Lu555_1_5'}(:);
Lu683_20 = ep{'Lu683_3_7'}(:);
Lu555_20 = ep{'Lu555_3_5'}(:);
sdn = nctime(ep);
ncquit(ep);

% Remove bad or missing values
Lu683_1(find(Lu683_1 == -999))   = NaN;
Lu555_1(find(Lu555_1 == -999))   = NaN;
Lu683_20(find(Lu683_20 == -999)) = NaN;
Lu555_20(find(Lu555_20 == -999)) = NaN;

% Prompt for input if no input arguments are specified
if nargin == 1 
   Date1 = 30;
end

if nargin < 3
   Date1 = max(sdn - Date1);
   Date2 = max(sdn);
end

Position = get(0, 'ScreenSize');
Position = [Position(1:3) Position(4) - Position(4)*.1];

goodTime = find(sdn >= Date1 & sdn <= Date2); % Find Points within the Date Limits
if isempty(goodTime)
   goodTime = length(sdn);
end

%========================
% Fouling ration at 1.5m
%========================
f(:,1) = Lu683_1./Lu555_1;

%=======================
% Fouling ration at 20m
%=======================
f(:,2) =  Lu683_20./Lu555_20;

plot(sdn(goodTime),f(goodTime, :))
datetick('x')
set(gca,'YLim',[0 .35])
ylabel('Fouling ratio (Lu683/Lu555)')
legend('1.5 m','20 m',0);


