% Decomposition en ondelettes de la NAO. 

clear all
clear
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Chargement des donnees a etudier

load /Francia/vientos/cuatrovientos


addpath /Francia/Estadisticas%aqui esta nanmean
addpath /Francia/Velocidades
jj=find(isnan(imag(viento1))==1);
viento1=completo_series1(imag(viento4),5);
y=viento1;%(116:492);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%EJE DE TIEMPO
time=tt(1:end-1);
%time=time(116:492);
xtim=time(1:100:end);
atim=datestr(xtim,12);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

exp1=2;
exp2=7;
inter=40;
abc
conv_fft_abc

figure;

subplot(2,1,1)
plot(time,y,'r')
xlabel('days')
ylabel('u component 0w Equator')
set(gca,'xlim',[min(time) max(time)],'XTick',xtim,'XTickLabel',atim)

hold on
aver=1:201;
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:60,:)=0;
wave(75: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
tt1=['Signal a 14 jours, (' num2str(pourvar) '% de variance expliquee)']




