Documentation of composite_1


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


Help text

  Load various maps (warm and cold);

Cross-Reference Information

This script calls

Listing of script composite_1


clear
cd ~/matlab/CSIRO/Data
load butter_4.5_ctstar.mat 
tim = 101:550;
ct = ctstar(tim);
ntim = length(tim);
[b, a] = butter(6, 2/8);
ct = filtfilt(b, a, ct);
ct = (ct - mean(ct)) ./ std(ct);
figure(1); clf;
for i = 1:5;
  subplot(5,1,i);
  tind = (ntim/5)*(i-1) + [1:(ntim/5)];
  plot(tim(tind), ct(tind));
  axis([min(tim(tind)-1) max(tim(tind)+1) -3 3]);
  set(gca, 'YTick', [-3:1.5:3]);
  grid on;
end
tem = find(ct >= 1.5);
tem2 = [1; find(diff(tem) ~= 1)+1];
wind = [];
for i = 1:(length(tem2)-1);
  tind = tem(tem2(i)):(tem(tem2(i+1)-1));
  wind = [wind; find(ct == max(ct(tind)))];
end
tem = find(ct <= -1.5);
tem2 = [1; find(diff(tem) ~= 1)+1];
cind = [];
for i = 1:(length(tem2)-1);
  tind = tem(tem2(i)):(tem(tem2(i+1)-1));
  cind = [cind; find(ct == min(ct(tind)))];
end
for i = 1:5;
  subplot(5,1,i);
  hold on;
  tind = (ntim/5)*(i-1) + [1:(ntim/5)];
    tem = wind(wind >= min(tind) & wind <= max(tind));
    plot(tim(tem), ct(tem), 'x');
    tem = cind(cind >= min(tind) & cind <= max(tind));
    plot(tim(tem), ct(tem), 'o');
  hold off;
end

temp = [];
tim = [101:550];

cd /home/disk/hayes2/dvimont/csiro/data
filin = 'temp_A_L1-10.nc';
nc = netcdf(filin, 'nowrite');
  depth = nc{'depth'}(:);
  lat = nc{'latitude'}(:);
  lon = nc{'longitude'}(:);
  ctlim = [110 300 -60 60];
  [xk, yk] = keep_var(ctlim, lon, lat);

  for i = 1:4;
    temp(:,i,:,:) = nc{'temp'}(tim, 2*(i-1)+1, yk, xk);
  end
  mv = nc{'temp'}.missing_value(:);
nc = close(nc);
temp(temp == mv) = NaN;
lat = lat(yk); lon = lon(xk);

[ntim, nlev, nlat, nlon] = size(temp);
temp = reshape(temp, ntim, nlev*nlat*nlon);
temp = detrend(temp);
temp = reshape(temp, ntim, nlev, nlat, nlon);

%  Plot some of this
default_global;

lag = 0;
indw = wind - lag;
indc = cind - lag;

cint = 0.2; clev = [-2:cint:2];
figure(2); clf; figure_orient;
for lev = 1:4;
  tem = squeeze(mean(temp(indw-lev,3,:,:)));
  subplot(4,2,(2*(lev-1)+1));
    gcont(tem, clev);
    dc;
end
for lev = 1:4;
  tem = squeeze(mean(temp(indc-lev,3,:,:)));
  subplot(4,2,(2*(lev-1)+2));
    gcont(tem, clev);
    dc;
end