  % Decomposition en ondelettes de la NAO. 

clear all

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Chargement des donnees a etudier

%load /usr/home/lbulod/Francia/Velocidades/S4v
load /Francia/Velocidades/Y2u
load /Francia/vientos/vel
addpath /Francia/annie
addpath /Francia/vientos
addpath /Francia/imagenest

%N1u=-N1u;
load /Francia/adcp/u80
load /Francia/Velocidades/uvmoy
load te80i
te80i=te80i(12:end-1)';

addpath /Francia/Estadisticas%aqui esta nanmean
addpath /Francia/Velocidades
load /Francia/vientos/u23c
load /Francia/vientos/upirata23

v=uvmoy(4,378:end)';v=completo_series1(v,5);
v=v(2:end-1);
u=uvmoy(4,1:377)';u=completo_series1(u,5);
u=u(2:end-1);
load resnueva
load N1v
load resn4
%y=resnueva(:,4);
load filtradas
load vm
load adcpfil
load N4fil
load resy1
load v4023w
load v80
load ugral10fscas %viento a 10 w sin ciclo anual ni semi anual
%load vientochristinescasaf
%load topexscasaf
load topexsca
%load vientochristinesca
%ugral10f son las series de NCEP a 10w filtradas. ugral10fsc son sin el cilco anual
%y ugral10fscas sin el anual ni el semianual
%y=filtradas(:,5);
%y=adcpfil(:,1);
%y=N4fil(:,1);
y=ugral10fscas';
%y=resn4;
%y=vientochristinescasaf';
%load Tp125Nsca
load T10tot2gNscasa %T23p125Sscasa
%y=T10tot2gNscasa'; %T23p125Sscasa';
load u23windcompletoscasa
load wu23cortadoscasaf
%y=u23windcompletoscasa';
%y=wu23cortadoscasaf';
%y=vientochristinesca';
load vientoscaf
load pruebav
%y=pruebav;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
media=mean(y);
estan=std(y);
exp1=2;
exp2=10;
inter=40;
abc
conv_fft_abc


figure;
%initfig;

subplot(2,1,1)
plot(y,'r')
xlabel('days')
ylabel('u component S1 840m')
hold on

subplot(2,1,2)
contourf(abs(wave),[0:0.05:1])
caxis([0 1])
view(0,-90)
%colorbar
hold on
%plot([1 200],[75 75],'w')
%ylim([0 300])
%r=30:30:300;
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,'YTick',r,'YTickLabel',floor(period(r)))
xlabel('days')
ylabel('period(days)')

wave1=wave;
wave(1:50,:)=0;
wave(85:end,:)=0;
maxmax
plot(dilat_number,'w','LineWidth',2)


subplot(2,1,1)
plot(ridge,'k','LineWidth',2)
%NAO_filtree=real(wave(75,:));
%plot(NAO_filtree,'r')
A=corrcoef(y,ridge);
pourvar=round(A(1,2)^2*1000)/10
tt1=['Signal a 33 ans extrait (' num2str(pourvar) '% de variance expliquee)']

%legend('NAO moyenne annuelle',tt1)


tini=datenum(1999,7,20);
tfin=datenum(2004,5,20);
ejet=tini:tfin;

