Documentation of time_freq_anal


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


Help text

  Plot hoffmoeller diagram of heat content and SST

Cross-Reference Information

This script calls

Listing of script time_freq_anal


clear
tim = 1:1000;
ct = getnc('temp', [178 272 -6 6], 1, tim);
ct = squeeze(mean2(mean2(shiftdim(ct, 1))));
ct = detrend(ct);
clear
cd /home/disk/tao/dvimont/matlab/CSIRO/Thesis/Data
load seas_ct.mat
ntim = length(ct1);
ct = detrend(ct1);
nfft = 128*4; noverlap = 3*nfft/4;
npt = ((ntim+1)/4 - 200)/25+1;
clear spec;
for i = 1:npt;
  if i < npt;
    ind = 100*(i-1) + [1:800];
  else
    ind = 100*(i-1) + [1:799];
  end
  tser = ct(ind);
  [p, f] = spectrum(tser, nfft, noverlap);
  spec(:,i) = p(:,1);
end
spec2 = spec';
spec2 = spec2 ./ (ones(npt, 1) * mean(spec2));
sd(1);
  contourf(2*f, [200:25:900], log(spec'), [-6:.5:2]);
  axis([2*f(3) 0.5 200 900]);
  xlabel('Frequency (yr^-^1)');
  ylabel('Time (yr)')
  hold on;
    hline(550, '-k');
  hold off;
  caxis([-6 1.5])
  colormap('pink');
  a = colormap;
  colormap(flipud(a));
  title('Time - Frequency Plot for CT index (log(power) is shaded)');
  colorbar2
sd(2);
     semilogy(f2, p(:,1), 'b-', f2, rn, 'b-', ...
	      f2, rner5, 'b--', f2, rner1, 'b-.')
     set(gca, 'YTick', [.1 1 10 100], 'XTick', [0:.05:.5]);
     set(gca, 'YTickLabel', [0.1 1 10])
     axis([f2(3) 0.5 .02 3])
     grid
     ylabel(tit);
     title(['Power Spectrum for CT index (seasonal data)']);
     xlabel(['Frequency:  yr^-^1']);%
child = get(gcf, 'Children');
pos3 = get(child(3), 'Position');
pos2 = get(child(2), 'Position');
pos = [pos2(1:2) pos3(3) pos2(4)];
set(child(2), 'Position', pos);
cd /home/disk/tao/dvimont/matlab/CSIRO/Thesis/Chap1/Plots

%  HP10:
tim = 331:380;
tim = 581:630;
tim = 181:230;
tim = 781:830;
tim = 101:150;
tim = 921:970;
lims = [105 285 -6 6];

%  LP9:  
tim = 800:950;
tim = 300:450;
lims = [105 285 -6 6];

temp = getnc('temp', lims, 1, tim);
hc = getheat(lims, 4:7, tim);
hc2 = getheat([105 285 5 15], 4:7, tim);

[lat, lon] = getll('temp', lims);

temp = shiftdim(squeeze(mean2(shiftdim(temp, 1))), 1);
hc = shiftdim(squeeze(mean2(shiftdim(hc, 1))), 1);
hc2 = shiftdim(squeeze(mean2(shiftdim(hc2, 1))), 1);

temp = detrend(temp);
hc = detrend(hc);
hc2 = detrend(hc2);

[b, a] = butter(9, 2/10);
temp = filtfilt(b, a, temp);
hc = filtfilt(b, a, hc);
hc2 = filtfilt(b, a, hc);

figure(1); fo(1);

xt = 120:30:270;
xtl = ['120E'; '150E'; '180 '; '150W'; '120W'; '90W '];
yt = min(tim):10:max(tim);
subplot(1,2,1);
  set(gca, 'Position', [0.2 0.17 0.3170 0.7150]);
  contourf(lon, tim, temp, [-.7:.05:.7]);
  caxis([-.4 .4])
  shading flat
  hold on;
    [h, c] = contour(lon, tim, temp, [0 0], '-k');
    vline(xt, ':k');
    hline(yt, ':k');
  hold off
  set(c, 'linewidth', 2);
  box off
  set(gca, 'XTick', xt, 'XTickLabel', xtl, 'YTick', yt);
  title('HP10:  0-80m HC');
  ylabel('Year')
  colorbar2

subplot(1,2,2);
  set(gca, 'Position', [0.580 0.17 0.3170 0.7150]);
  contourf(lon, tim, 1e-6*hc, 100*[-5:.25:5]);
  caxis(100*[-3 3])
  shading flat
  hold on;
    [h, c] = contour(lon, tim, hc, [0 0], '-k');
    vline(xt, ':k');
    hline(yt, ':k');
  hold off
  set(c, 'linewidth', 2);
  box off
  set(gca, 'XTick', xt, 'XTickLabel', xtl, 'YTick', yt);
  title('HP10:  80-270m HC');
  colorbar2


cd ~/Thesis/Chap4
%print -dps2 HC80_HC80-270_timelon.ps

ct = getct(1:1000);
[b, a] = butter(9, 2/9);
ct = detrend(ct); 
ct = filtfilt(b, a, ct);

figure(2); fo(1);
for i = 1:4;
ind = 250*(i-1)+[1:250];
subplot(4,1,i);
plot(ind,ct(ind))
axis([min(ind) max(ind) -.7 .7]);
end

figure(2); fo(1);
  subplot(1,1,1);
  contourf(1e-6*[fliplr(hc2) hc fliplr(hc2)], 100*[-9:.5:9]);
  caxis(100*[-5 5]);
  shading flat