Documentation of get_ct_regs


Global Index (short | long) | Local contents | Local Index (short | long)


Help text

  Remove annual cycle

Cross-Reference Information

This script calls

Listing of script get_ct_regs


clear
cd /home/disk/tao/data/nmc.reanalysis/monthly
filin = 'air.mon.mean.sfc.48mar01.nc';
varn = 'air';
ctlim = [180 270 -6 6];
lims = [0 360 -90 90];
lev = 1;
tim = 1:636;
ct = getnc2(filin, varn, ctlim, lev, tim);
[sst, lat, lon] = getnc2(filin, varn, lims, lev, tim);
ct = squeeze(mean(mean(shiftdim(ct, 1))));
ct = annave(ct);
sst = annave(sst);

[ntim, nlat, nlon] = size(sst);
sst = reshape(sst, ntim, nlat*nlon);

%  Start with raw regression:
regmap1 = ct'*sst/(var(ct)*(ntim-1));

%  Regression on standardized CT index
ct2 = standardize(ct);
regmap2 = ct2'*sst/(ntim-1);

%  Correlation map
sst2 = standardize(sst);
cormap1 = ct2'*sst2/(ntim-1);

%  For kicks, get landmask
cd /home/disk/tao/data/nmc.reanalysis
load landmask.mat
lm(lm==-1)=NaN;

%  Reshape
regmap1 = reshape(regmap1, nlat, nlon);
regmap2 = reshape(regmap2, nlat, nlon);
cormap1 = reshape(cormap1, nlat, nlon);

%  Save data and indices
cd ~/matlab/Wallace
save CT_regmaps.mat lims tim ct regmap1 regmap2 cormap1 lat lon lm


%%%%%%%%%%%%%%  REDO WITH SLP  %%%%%%%%%%%%%%%%%%%
clear

cd /home/disk/tao/data/nmc.reanalysis/monthly
filin = 'air.mon.mean.sfc.48mar01.nc';
varn = 'air';
ctlim = [180 270 -6 6];
lims = [0 360 -90 90];
lev = 1;
tim = 1:636;

ct = getnc2(filin, varn, ctlim, lev, tim);

filin = 'slp.monthly.nc';
varn = 'slp';
[sst, lat, lon] = getnc2(filin, varn, lims, lev, tim);

ct = squeeze(mean(mean(shiftdim(ct, 1))));

%  Remove annual cycle
ct = annave(ct);
sst = annave(sst);

[ntim, nlat, nlon] = size(sst);
sst = reshape(sst, ntim, nlat*nlon);

%  Start with raw regression:
regmap1_slp = ct'*sst/(var(ct)*(ntim-1));

%  Regression on standardized CT index
ct2 = standardize(ct);
regmap2_slp = ct2'*sst/(ntim-1);

%  Correlation map
sst2 = standardize(sst);
cormap1_slp = ct2'*sst2/(ntim-1);

%  For kicks, get landmask
cd /home/disk/tao/data/nmc.reanalysis
load landmask.mat
lm(lm==-1)=NaN;

%  Reshape
regmap1_slp = reshape(regmap1_slp, nlat, nlon);
regmap2_slp = reshape(regmap2_slp, nlat, nlon);
cormap1_slp = reshape(cormap1_slp, nlat, nlon);

%  Save data and indices
cd ~/matlab/Wallace
save CT_SLP_regmaps.mat lims tim ct lat lon lm ...
    regmap1_slp regmap2_slp cormap1_slp





%  Make maps
clean

cd ~/matlab/Wallace
load CT_regmaps.mat

figure(1); fl(1); clf;
get_global; 
global_figs(8, 5, 0, 0, 1.5);
dg(lat, lon); FRAME = [0 360 -90 90];

%  Start by plotting regmap2

figure(1); fl(1); clf;
sp(1,1); cla;
  maxes('mollweid', [0 200]);  %  Define map axis
  [c, h] = contorm(YAX, XAX, regmap2.*lm, [-1:.1:1], 'k');  %  Contour data
  dcmfill(1);  %  Shade continents over (1) or under (-1) exisiting data
  gridm on;  %  Turn on grid
  axis_limits(100);  %  Expand data to fill axis
  
%  Label the contours - there are several methods here.  Pick one.
%  cl = clabelm(c);  %  Try each of these
  cl = clabelm(c, h, [-1:.2:1]);
%  cl = clabelm(c, h, 'manual');
  set(cl, 'fontsize', 8);
  
  set(gca, 'visible', 'off');  %  Turn off box around graphics
  t1 = title('\bf SST regressed on CT index', 'visible', 'on', ...
	     'fontsize', 12);  %  Add a title
  xl = xlabel('Contour Interval:  0.2 ^\circC std^-^1');  %  Add Xlabel
  set(xl, 'visible', 'on');  %  Change handle properties for Xlabel
  
figure(2); fl(1); clf;
sp(1,1); cla;
  maxes('mollweid', [0 200]);  
  
%  Contour negative contours dashed, positive solid, zero bold  
  [c, h] = contorm(YAX, XAX, regmap2.*lm, [-1:.1:-.1], '--k');
  hold on;
    [c2, h2] = contorm(YAX, XAX, regmap2.*lm, [.1:.1:1], '-k');
    [c3, h3] = contorm(YAX, XAX, regmap2.*lm, [0 0], '-k');
  hold off
  set(h3, 'linewidth', 2);
  
  dcmfill(1); 
  gridm on;  
  axis_limits(100); 
  
  %  No need to label contours - self explanatory
  
  set(gca, 'visible', 'off');  %  Turn off box around graphics
  t1 = title('\bf SST regressed on CT index', 'visible', 'on', ...
	     'fontsize', 12);  %  Add a title
  xl = xlabel('Contour Interval:  0.1 ^\circC std^-^1');  %  Add Xlabel
  set(xl, 'visible', 'on');  %  Change handle properties for Xlabel
  

  
%  Try shading the data

%  Define colormap

figure(3); fl(1); clf;
color_trans;  colormap(cmap);
sp(1,1); cla;
  maxes('mollweid', [0 200]);  
  h1 = surfacem(YAX3, XAX3, regmap2.*lm);
  %  Get rid of nasty NaN problem - I don't know why this works...
  set(h1, 'facecolor', 'flat');
  caxis([-1 1]);
  
  dcmfill(1); 
  gridm on;  
  axis_limits(100); 
  
  %  No need to label contours - self explanatory
  
  set(gca, 'visible', 'off');  %  Turn off box around graphics
  t1 = title('\bf SST regressed on CT index', 'visible', 'on', ...
	     'fontsize', 12);  %  Add a title
  
  cb = colorbar2('horiz');
  set(cb, 'fontsize', 8);
  xl = get(cb, 'XLabel');
  set(xl, 'String', '^\circ C std^-^1', 'fontsize', 10);