Global Index (short | long) | Local contents | Local Index (short | long)
load MIX_slpx_DYN_ATM_pslpx_LP9.mat; dofilt = 1;
| This script calls | |
|---|---|
clean
cd ~/Papers/mlcsiro/matlab/Data2
load SH_MIX_slpx_DYN_ATM_pslpx_RAW.mat; dofilt = 0;
slpx = -slpx; pslpxd = -pslpxd;
% Get ML data
csirod
load ML_ANN_sst.mat;
back
[xkc, ykc] = keep_var([180 270 -6 6], lon, lat);
ctm = squeeze(mean2(mean2(shiftdim(sst2(:,ykc,xkc), 1))));
ctm = detrend(ctm);
ctc = getct; ctc = detrend(ctc);
% Filter
if dofilt;
[b, a] = butter(9, 2/9);
ctc = filtfilt(b, a, ctc);
ctm = filtfilt(b, a, ctm);
end
num = 1;
lags = [-6:6];
clear cctpc mctpc cctct mctct
for i = 1:length(lags);
cctpc(i) = corr(pslpxd(:,num), ctc, lags(i));
mctpc(i) = corr(slpx(:,num), ctm, lags(i));
cctct(i) = corr(ctc, ctc, lags(i));
mctct(i) = corr(ctm, ctm, lags(i));
end
% ML run
lind = find(lags == 0);
rhom = mctpc(lind)*mctct; % Null hypothesis
sigz = 1/sqrt(0.5*(get_dof(ctm)+get_dof(slpx(:,num)))-3);
mu1 = 0.5*log((1+rhom)./(1-rhom))-1.96*sigz; % Lower bound
mu2 = 0.5*log((1+rhom)./(1-rhom))+1.96*sigz; % Upper bound
mminr = (exp(2*mu1)-1)./(exp(2*mu1)+1);
mmaxr = (exp(2*mu2)-1)./(exp(2*mu2)+1);
% DYN run
lind = find(lags == 0);
rhoc = cctpc(lind)*cctct; % Null hypothesis
sigz = 1/sqrt(0.5*(get_dof(ctc)+get_dof(pslpxd(:,num)))-3);
mu1 = 0.5*log((1+rhoc)./(1-rhoc))-1.96*sigz; % Lower bound
mu2 = 0.5*log((1+rhoc)./(1-rhoc))+1.96*sigz; % Upper bound
cminr = (exp(2*mu1)-1)./(exp(2*mu1)+1);
cmaxr = (exp(2*mu2)-1)./(exp(2*mu2)+1);
% Plot data
figure(3); fo; clf;
sz = get(gcf, 'PaperSize');
hw = 1/sz(1); vw = 1/sz(2); hsz = hw*(2+3/4); vsz = vw*1.5;
bmarg = (sz(2) - 8.5)*0.5; tmarg = (sz(2) - 8.5)*0.5;
mid = 0.5; vsz2 = vw*(0.75);
xtl = ['-8';' ';'-6';' ';'-4';' ';'-2';' ';' 0';' ';...
' 2';' ';' 4';' ';' 6';' ';' 8'];
subplot('position', [(hw*sz(1)-hsz)/2 vw*(sz(2)-tmarg)-vsz hsz vsz])
H = bar(lags, mctpc, 0.65);
hold on;
plot(lags, rhom, '-k', ...
lags, mminr, '--k', ...
lags, mmaxr, '--k');
hold off
axis([-6.5 6.5 -0.15 0.65]);
set(gca, 'YTick', -1:.1:1, 'XTick', -8:1:8);%, 'XTickLabel', xtl);
% grid on
set(gca, 'fontsize', 8)
t1 = text(0, 0.45, 'MIX-SLP');
t2 = text(0, 0.38, 'leads CT');
set([t1], 'fontsize', 9, 'HorizontalAlignment', 'center', 'Position', ...
[-3.8 0.55]);
set([t2], 'fontsize', 9, 'HorizontalAlignment', 'center', 'Position', ...
[-3.8 0.45]);
y1 = ylabel('MIX');
pos2 = get(y1, 'position');
pos2(1) = -8.2;
set(y1, 'position', pos2, 'fontsize', 9);
tit = title(['Correlation: < MIX-SLP, CT >']);
set(tit, 'units', 'normalized', 'HorizontalAlignment', 'left', ...
'VerticalAlignment', 'bottom', 'fontsize', 9);
pos2 = get(tit, 'position');
set(tit, 'position', [0 pos2(2)-0.01 0]);
subplot('position', [(hw*sz(1)-hsz)/2 vw*(sz(2)-tmarg-mid)-2*vsz hsz vsz])
bar(lags, cctpc, 0.65);
hold on;
plot(lags, rhoc, '-k', ...
lags, cminr, '--k', ...
lags, cmaxr, '--k');
hold off
axis([-6.5 6.5 -0.15 0.65]);
set(gca, 'YTick', -1:.1:1, 'XTick', -8:1:8);%, 'XTickLabel', xtl);
% grid on
set(gca, 'fontsize', 8)
t1 = text(0, 0.45, 'DYN-SLP');
t2 = text(0, 0.38, 'leads CT');
set([t1], 'fontsize', 9, 'HorizontalAlignment', 'center', 'Position', ...
[-3.8 0.55]);
set([t2], 'fontsize', 9, 'HorizontalAlignment', 'center', 'Position', ...
[-3.8 0.45]);
y1 = ylabel('DYN');
x1 = xlabel('Lag (years)');
set(x1, 'fontsize', 9);
pos2 = get(y1, 'position');
pos2(1) = -8.2;
set(y1, 'position', pos2, 'fontsize', 9);
tit = title(['Correlation: < DYN-SLP, CT >']);
set(tit, 'units', 'normalized', 'HorizontalAlignment', 'left', ...
'VerticalAlignment', 'bottom', 'fontsize', 9);
pos2 = get(tit, 'position');
set(tit, 'position', [0 pos2(2)-0.01 0]);
colormap(0.55*[1 1 1]);
cd /home/disk/tao/dvimont/Papers/mlcsiro/Figs2
%print -dps2 LAG_CORR_slpx_CT_raw.ps
% LP9:
clean
cd ~/Papers/mlcsiro/matlab/Data2
%load MIX_slpx_DYN_ATM_pslpx.mat; dofilt = 0;
load SH_MIX_slpx_DYN_ATM_pslpx_LP9.mat; dofilt = 1;
% Get ML data
csirod
load ML_ANN_sst.mat;
back
[xkc, ykc] = keep_var([180 270 -6 6], lon, lat);
ctm = squeeze(mean2(mean2(shiftdim(sst2(:,ykc,xkc), 1))));
ctm = detrend(ctm);
ctc = getct; ctc = detrend(ctc);
% Filter
if dofilt;
[b, a] = butter(9, 2/9);
ctc = filtfilt(b, a, ctc);
ctm = filtfilt(b, a, ctm);
end
num = 1;
lags = [-10:10];
clear cctpc mctpc cctct mctct
for i = 1:length(lags);
cctpc(i) = corr(pslpxd(:,num), ctc, lags(i));
mctpc(i) = corr(slpx(:,num), ctm, lags(i));
cctct(i) = corr(ctc, ctc, lags(i));
mctct(i) = corr(ctm, ctm, lags(i));
end
% ML run
lind = find(lags == 0);
rhom = mctpc(lind)*mctct; % Null hypothesis
sigz = 1/sqrt(0.5*(get_dof(ctm)+get_dof(slpx(:,num)))-3);
mu1 = 0.5*log((1+rhom)./(1-rhom))-1.96*sigz; % Lower bound
mu2 = 0.5*log((1+rhom)./(1-rhom))+1.96*sigz; % Upper bound
mminr = (exp(2*mu1)-1)./(exp(2*mu1)+1);
mmaxr = (exp(2*mu2)-1)./(exp(2*mu2)+1);
% DYN run
lind = find(lags == 0);
rhoc = cctpc(lind)*cctct; % Null hypothesis
sigz = 1/sqrt(0.5*(get_dof(ctc)+get_dof(pslpxd(:,num)))-3);
mu1 = 0.5*log((1+rhoc)./(1-rhoc))-1.96*sigz; % Lower bound
mu2 = 0.5*log((1+rhoc)./(1-rhoc))+1.96*sigz; % Upper bound
cminr = (exp(2*mu1)-1)./(exp(2*mu1)+1);
cmaxr = (exp(2*mu2)-1)./(exp(2*mu2)+1);
% Plot data
figure(4); fo; clf;
sz = get(gcf, 'PaperSize');
hw = 1/sz(1); vw = 1/sz(2); hsz = hw*(2+3/4); vsz = vw*1.5;
bmarg = (sz(2) - 8.5)*0.5; tmarg = (sz(2) - 8.5)*0.5;
mid = 0.5; vsz2 = vw*(0.75);
xtl = ['-8';' ';'-6';' ';'-4';' ';'-2';' ';' 0';' ';...
' 2';' ';' 4';' ';' 6';' ';' 8'];
subplot('position', [(hw*sz(1)-hsz)/2 vw*(sz(2)-tmarg)-vsz hsz vsz])
H = bar(lags, mctpc, 0.65);
hold on;
plot(lags, rhom, '-k', ...
lags, mminr, '--k', ...
lags, mmaxr, '--k');
hold off
axis([-8.5 8.5 -0.45 0.85]);
set(gca, 'YTick', -1:.2:1, 'XTick', -8:1:8, 'XTickLabel', xtl);
% grid on
set(gca, 'fontsize', 8)
t1 = text(0, 0.45, 'MIX-SLP');
t2 = text(0, 0.38, 'leads CT');
set([t1], 'fontsize', 9, 'HorizontalAlignment', 'center', 'Position', ...
[-5.8 0.73]);
set([t2], 'fontsize', 9, 'HorizontalAlignment', 'center', 'Position', ...
[-5.8 0.56]);
y1 = ylabel('MIX');
pos2 = get(y1, 'position');
pos2(1) = -11.0;
set(y1, 'position', pos2, 'fontsize', 9);
tit = title(['LP9: Correlation: < MIX-SLP, CT >']);
set(tit, 'units', 'normalized', 'HorizontalAlignment', 'left', ...
'VerticalAlignment', 'bottom', 'fontsize', 9);
pos2 = get(tit, 'position');
set(tit, 'position', [0 pos2(2)-0.01 0]);
subplot('position', [(hw*sz(1)-hsz)/2 vw*(sz(2)-tmarg-mid)-2*vsz hsz vsz])
bar(lags, cctpc, 0.65);
hold on;
plot(lags, rhoc, '-k', ...
lags, cminr, '--k', ...
lags, cmaxr, '--k');
hold off
axis([-8.5 8.5 -0.45 0.85]);
set(gca, 'YTick', -1:.2:1, 'XTick', -8:1:8, 'XTickLabel', xtl);
% grid on
set(gca, 'fontsize', 8)
t1 = text(0, 0.45, 'DYN-SLP');
t2 = text(0, 0.38, 'leads CT');
set([t1], 'fontsize', 9, 'HorizontalAlignment', 'center', 'Position', ...
[-5.8 0.73]);
set([t2], 'fontsize', 9, 'HorizontalAlignment', 'center', 'Position', ...
[-5.8 0.56]);
y1 = ylabel('DYN');
pos2 = get(y1, 'position');
pos2(1) = -11.0;
set(y1, 'position', pos2, 'fontsize', 9);
tit = title(['LP9: Correlation: < DYN-SLP, CT >']);
set(tit, 'units', 'normalized', 'HorizontalAlignment', 'left', ...
'VerticalAlignment', 'bottom', 'fontsize', 9);
pos2 = get(tit, 'position');
set(tit, 'position', [0 pos2(2)-0.01 0]);
colormap(0.55*[1 1 1]);
cd /home/disk/tao/dvimont/matlab/CSIRO/Tony/Figs_28June2000
print -dps2 SH_LAG_CORR_slpx_CT_LP9.ps