  % Decomposition en ondelettes de la NAO. 

clear all

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Chargement des donnees a etudier
addpath /Francia/vientos
load vgral10
load ugral10
load p23w_0
p23w_0=p23w_0(27:end);
load p10w_0
p10w_0=p10w_0(27:end);
load tempsin
y=ugral10;
for i=1:length(ugral10)-15
    ugral10f(i)=mean(ugral10(i:i+15));
       
   end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%EJE DE TIEMPO
tim=1:1826;
time=datenum(1997,12,31);
time=time+tim;
xtim=time(1:90:end);
atim=datestr(xtim,12);
exp1=2;
exp2=9;
inter=40;
abc
conv_fft_abc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

figure;
%initfig;

subplot(2,1,1)
plot(time,y,'r')
xlabel('days')
ylabel('SST at 10W')
set(gca,'xlim',[min(time) max(time)],'XTick',xtim,'XTickLabel',[])

hold on

aver=1:281;
subplot(2,1,2)
contourf(time,aver,abs(wave),[0:0.05:1])
caxis([0 1])
view(0,-90)
%colorbar
hold on
%plot([1 200],[75 75],'w')
ylim([0 200])
r=30:30:200;
%set(gca,'YTick',[6 46 70 86 99 109 118 126 133 139] ,'YTickLabel',[10:10:100])
set(gca,'ylim',[0 150],'YTick',r,'YTickLabel',floor(period(r)))
set(gca,'xlim',[min(time) max(time)],'XTick',xtim,'XTickLabel',atim)
xlabel('days')
ylabel('period(days)')

wave1=wave;
wave(1:55,:)=0;
wave(70:end,:)=0;
maxmax
plot(time,dilat_number,'w','LineWidth',2)

subplot(2,1,1)
plot(time,ridge,'k','LineWidth',2)

orient landscape

A=corrcoef(y,ridge);
pourvar=round(A(1,2)^2*1000)/10


orient landscape


