PlotCOPS final

From Pnb
Jump to navigation Jump to search
function plotCOPS_final()
%USAGE
%Run in "final" directory for C-OPS

%[filename,path] = uigetfile('/home/eriks/OCEANCOLOR_PNB/Plumes_and_Blooms/C-OPS/*1.mat','Choose C-OPS final file to plot')
%load([path filename])

%fid = fopen(filename);
   [status,files] = (unix(sprintf('ls kcmb*')));
   files = strtrim(files);
   files2 = strsplit(files, {'\s',' ','\n'}, 'CollapseDelimiters', false,'DelimiterType','RegularExpression');
   files2(strcmp('',files2)) = [];
for ctr = 1:length(files2)
filename = char(files2(ctr))
[head,tail,dat,colnames] = lcdread(filename);

file = 'Copsplotlist.txt';
%columns 5to22 are EdZ C-OPS
%columns 41to58 are Ed0 C-OPS
[bandsToPrcs,minZfit,maxZfit]=readBscalcParams(file);

[isItThere,bandIdx]=ismember(bandsToPrcs,colnames);

comparison_data = dat(:,bandIdx);
bsregr = comparison_data(1,1:18);
Ed0=  comparison_data(:,19:end);

for i = 1:length(Ed0(1,:))
meandat_ED(:,i) = mean(Ed0((Ed0(:,i)>0),i));
end
wvln = [320,340,380,395,412,443,465,490,510,532,555,560,625,665,670,683,710,780];
[status,files] = (unix(sprintf('ls kcmb*')));


figure
plot(wvln,meandat_ED,wvln,bsregr)
legend('Ed0','EdZ0-')
title('Mean Ed0 vs EdZ0-')
xlabel('wvln(nm)')
ylabel('uE.cm^-2.sec^-1')

end