function at_hflf_k % AT_HFLF_K - create plots of K from old deployments and new deployments %========================= % Calculate HF and LF K's %========================= LF = ep_cmpl; ep_ini; lambda = [412 443 490 510 555]; for i = 1:length(LF) HF = netcdf(['d:\www\bog\netcdf\' char(LF(i).id) '.avg.nc']); Thf = HF{'time'}(:); Khf = ones(length(Thf), length(lambda))* NaN; % Get LF time. Correct for 12 or 1230 measurement Hlf = LF(i).dat(:, find(strcmp(ColumnS,'Time'))); Tlf = round(dy2date(LF(i).dat(:,find(strcmp(ColumnS,'Decimal_Year')))+1900)); Tlf = Tlf + 12/24; noonp = find(Tlf == 1230); Tlf(noonp) = Tlf(noonp) + .5/12; Klf = ones(length(Tlf), length(lambda))*NaN; for j = 1:length(lambda) % Get the HF K(lambda) [Ktmp Zhf] = oms_k1(HF, lambda(j)); col = near(Zhf(1, :), -20) Khf(:,j) = Ktmp(:, col); % Get the LF K(lambda) L = num2str(lambda(j)); EsC = find(strcmp(ColumnS,['Ed[3m+]' L])); EdC = find(strcmp(ColumnS,['Ed[20m]' L])); Klf(:,j) = calc_k(LF(i).dat(:,EsC), LF(i).dat(:,EdC), -20); end close(HF); %========= % Plot it %========= figure plot(Thf, Khf); hold on; plot(Tlf, Klf); hold off datetick('x'); hold on plot(get(gca,'XLim'), [0 0], 'k:'); d = oms_deploys(char(LF(i).id)); plot([d d]', repmat(get(gca,'YLim'), length(d),1)', 'k:'); hold off xlabel('Year') ylabel('K') legend(num2str(lambda')); title(char(LF(i).id)); set(gcf,'paperPosition',[0 0 5 4]) writegif([char(LF(i).id) '.k.gif']) end