function at_morelchl_plot(e,ep,Filename) % % This function is meant to be called from at_eqpac but will also % work as a standalone program. % % Use as: at_morelchl_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 ep_ini i = strcmp(ColumnS,'Decimal_Year'); %======================================= % Get the dates, Correct for Y2K issues %======================================= sdn = e(ep).dat(:,i) + 1900; %y2k = find(sdn >= 85 & sdn <= 99.9999); %sdn(y2k) = sdn(y2k) + 1900; %y2k = find(sdn >= 0 & sdn < 85); %sdn(y2k) = sdn(y2k) + 2000; sdn = dy2date(sdn); % Get Dates %========================================================= % Refine the approximate dates to make them more accurate %========================================================= [Year Month Day Hour Minute Second] = datevec(sdn); i = strcmp(ColumnS,'Time'); Hour = e(ep).dat(:,i); Hour(find(Hour == 1200)) = 12/24; Hour(find(Hour == 1230)) = 12.5/24; Day = round(Day) + Hour; % Correct the day to the local time sdn = datenum(Year, Month, Day); %=============================== % Calculate Morel's Chlorophyll %=============================== lambda = [412 443 490 510 555]; for i = 1:length(lambda) nm = num2str(lambda(i)); Ed0 = e(ep).dat(:,strmatch(['Ed[3m+]' nm], ColumnS)); EdZ = e(ep).dat(:,strmatch(['Ed[20m]' nm], ColumnS)); Z = e(ep).dat(:,strmatch('Pressure', ColumnS)); m(:,i) = morel_chl(Ed0,EdZ,Z,lambda(i)); end %i = strmatch('K412',ColumnS); %m = ((e(ep).dat(:,i) - 0.0196)./.1125).^(1/0.680); %i = strmatch('K443',ColumnS); %m(:,2) = ((e(ep).dat(:,i) - 0.0166)./.0996).^(1/0.704); %i = strmatch('K490',ColumnS); %m(:,3) = ((e(ep).dat(:,i) - 0.0217)./.0690).^(1/0.702); %i = strmatch('K510',ColumnS); %m(:,4) = ((e(ep).dat(:,i) - 0.0384)./.0578).^(1/0.690); %i = strmatch('K555',ColumnS); %m(:,5) = ((e(ep).dat(:,i) - 0.0683)./.0400).^(1/0.645); %i = strmatch('K670',ColumnS); %m(:,6) = ((e(ep).dat(:,i) - 0.4300)./.0515).^(1/0.695); plot(sdn,m) 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); %========================= % Make a gif if specified %========================= if nargin > 2 at_setfontsize PaperPosition = [.25 2.5 4.5 3.25]; set(gcf,'PaperPosition',PaperPosition); writegif(Filename); close all end