Code: The Trick


load MBHsmooths1.txt % http://www.climateaudit.info/wp-content/uploads/2009/11/mbhsmooths1.txt
% MBHsmooths1 = [ Year AnnualRecon Instrumental MB98SmoothTrick MBH98SmoothNoTrick MBH99SmoothTrick MBH99SmoothNoTrick ]

[B98,A98]=butter(10,2/50); % '50 year lowpass'

in98=MBHsmooths1(401:981,2); % Annual Recon MBH98,
%source:
% http://www.nature.com/nature/journal/v430/n6995/extref/FigureData/nhmean.txt ,
% col 2

Trick=MBHsmooths1(982:996,3); % pad with instrumental (1981..1995) ..
% source:
% http://www.nature.com/nature/journal/v430/n6995/extref/FigureData/nhmean.txt
% col 3

out98t=flipud(filter(B98,A98,flipud([filter(B98,A98,[in98;Trick;zeros(100,1)])]))); %..then smooth
% Note that filter.m initializes with zeros
out98t=out98t(1:596);
out98tr=out98t(26:576); % smoothed reconstruction with the trick

% no trick
out98nt=flipud(filter(B98,A98,flipud([filter(B98,A98,[in98;zeros(115,1)])]))); %..then smooth
out98nt=out98nt(1:596);
out98ntr=out98nt(26:576); % smoothed reconstruction without the trick

% read image, http://uc00.files.wordpress.com/2010/05/mbh985b.png
A=imread('mbh985b.png'); % from MBH98, copied for scientific purposes

XS=1.1691; % x-scale
YS=-365.7848; % y-scale
XB=-1.5749e+003; % x-bias
YB=281.8316; % y-bias
Year=(1400:1995)';

close all
image(A)

hold on
plot(Year*XS+XB,out98t*YS+YB,'r')
plot(Year*XS+XB,out98nt*YS+YB,'g')

% Note that at the begin red and green lines overlap

% MBH98: Mann, M. E., R. S. Bradley, and M. K. Hughes (1998), Global-scale
% temperature patterns and climate forcing over the past six centuries,
% Nature, 392, 779– 787.

% (C) UC 2010

4 Responses to “Code: The Trick”

  1. UC Says:

    Load

    http://www.climateaudit.info/wp-content/uploads/2009/11/mbhsmooths1.txt

    and

    to current working directory, then this should be turn-key.

  2. Math101 – Filtering Theory » Blog Archive » The Trick Timeline Says:

    [...] Code: The Trick « Some Interesting Figures (II) [...]

  3. Mike’s Nature trick « Climate Audit Says:

    [...] April 1, 2010: UC has created a timeline for the trick and a turn-key Matlab code (the figure below). This entry was written by Jean S, posted on Nov 20, 2009 at 9:59 [...]

  4. uc00 Says:

    This post is now moved to CA, http://climateaudit.org/2010/04/01/code-the-trick/ . Will close the comments here.

Comments are closed.


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: