%################################################################
%################################################################
%################################################################
% this is s really important file to make all kind of proxy network
%################################################################
%################################################################
%################################################################

clear all; close all;
%--------
%first run doannsst to get clidata
doannsst

%+++ step1 +++
clear all; close all;

proxy; % to generate proxy matrix

% for full calib use 1850-1995, and for split calib/valid use 1896-1995, calib/1850-1899 valid...

propick; % row1 long., row2 lat., row3 id, row4 corrcoef
% switch line 56-61 to get entire (1850-1995) and  late 1896-1995


%

clear all; close all;

proxyhybrid;

clihybrid;

clear all; close all;

propickh;
% switch line 56-61 to get entire (1850-1995) and  late 1896-1995


%

clear all; close all;

propickl;
% switch line 56-61 to get entire (1850-1995) and  late 1896-1995


%

%####################################################################
%------- the following is for generating corr matrix --------------------
%####################################################################


%---------------------------------------------------------

clear all; close all;
%@@@@@@@@@@@@@@@@@@@@@@@@
hhhigh=0; % 0 means screening on raw data  (old)
          % 1 means screening on high-f data (new)
%@@@@@@@@@@@@@@@@@@@@@@@@@

if hhhigh==0
load /holocene/s1/zuz10/work1/temann/data/info
load /holocene/s1/zuz10/work1/temann/data/infol
load /holocene/s1/zuz10/work1/temann/data/infolater96
load /holocene/s1/zuz10/work1/temann/data/infollater96
infohl=info; %raw 1850-1995
infohl(5,:)=infol(4,:); %low-f
infohl(6,:)=infolater96(4,:); %raw 1896-1995...it is now the interval
infohl(7,:)=infollater96(4,:); % low-f 
save('/holocene/s1/zuz10/work1/temann/data/rtable1209','infohl','-ascii')

else
load /holocene/s1/zuz10/work1/temann/data/infoh
load /holocene/s1/zuz10/work1/temann/data/infol
load /holocene/s1/zuz10/work1/temann/data/infohlater96
load /holocene/s1/zuz10/work1/temann/data/infollater96
infohl=infoh; %raw 1850-1995
infohl(5,:)=infol(4,:); %low-f
infohl(6,:)=infohlater96(4,:); %raw 1896-1995...it is now the interval
infohl(7,:)=infollater96(4,:); % low-f 
save('/holocene/s1/zuz10/work1/temann/data/rtable1209','infohl','-ascii')

end

%-----------------------------------------------------------

