function ep_lookMorelChl(id, Date1, Date2)
%
% This function is meant to be called from at_eqpac but will also
% work as a standalone program.
%
% Use as: ep_lookMorelChl(ep, Date1, Date2)
%
% Inputs: ep = Eqpac mooring ID (1 or 2)
%         Date1 = minimum date fo 

% 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);
PathS = fullfile(getOasisPath, 'eqpac', id);

ep       = netcdf(FileLoc);
X        = ep_cmplNc(ep);
sdn = X.t;
ncquit(ep);


%===============================
% Calculate Morel's Chlorophyll
%===============================
lambda = [412 443 490 510 555];
for i = 1:length(lambda)
   m(:,i) = morel_chl2(X.K(:,i), lambda(i));
end

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

   
plot(sdn(goodTime),m(goodTime, :))
datetick('x')
set(gca,'YLim',[0 1])
title('Morel''s Chl at from different wavelengths')
ylabel('\mug L^-^1')
xlabel('Date')
legend('412nm','443nm','490nm','510nm','555nm','670nm',0);
