  % Decomposition en ondelettes de la NAO. 

clear all

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

addpath /Francia/Estadisticas%aqui esta nanmean
addpath /Francia/Velocidades
load /Francia/vientos/u23c %series compltas de viento pirata en 23 w
load /Francia/vientos/v23c
%load /Francia/vientos/upirata %series correspondientes a fechas adcp pirata en 10 w dudo
%load /Francia/vientos/vpirata
%u=upirata'; 
%v=vpirata';
u=u23c';
v=v23c';
modv=sqrt(u.^2+v.^2);
tu=modv.*u;
tv=modv.*v;
y=v;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%EJE DE TIEMPO
tim=1:1826;
time=datenum(1997,12,31);
%tim=1:372;
%time=datenum(2001,12,10);
%a1=datenum(1999,11,12);
%a2=datenum(2000,11,20);
%time=a1:a2;

time=time+tim;
time=time(785:1814);
xtim=time(1:30:end);
atim=datestr(xtim,4);
dddia=1:1030;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
exp1=2;
exp2=7;
inter=40;
abc
conv_fft_abc

figure;
%initfig;

subplot(2,1,1)
plot(dddia,y,'r')
xlabel('days')
ylabel('u PIRATA 23 W')
set(gca,'xlim',[min(dddia) max(dddia)])%,'XTick',xtim,'XTickLabel',[])

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;
%wave1(:,70:123)=NaN;
%wave1(:,215:264)=NaN;
subplot(2,1,2)
%contourf(time,aver,abs(wave1),[0:0.05:1])
caxis([0 1])
view(0,-90)
hold on
wave(1:55,:)=0;
wave(80:end,:)=0;
maxmax
plot(time,dilat_number,'w','LineWidth',2)


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

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


orient landscape


