%desfase
clear
addpath /Francia/Velocidades
addpath /Francia/imagenest
addpath /Francia/vsatelite
addpath /Francia/Programitas

load uvmoy
addpath /Francia/Estadisticas%aqui esta nanmean
vq=uvmoy(4,378:end)';vq=completo_series1(vq,5);
vq=vq(2:end-1);
uq=uvmoy(4,1:377)';uq=completo_series1(uq,5);
uq=uq(2:end-1);
load N3u
load S1u
load S1v
load Y3v
load resnueva
addpath /Francia/annie
load v8023w
load u4023w
load v4023w

load v15010w
load u15010w
load T23p125Nscasa
load Tp125Sscasa
load Tp2gNscasa
load Tp2gSscasa
load T23p2gSscasa
load T23p2gNscasa
load T10p2gNscasa_2
load T102002scasaS
load v230
load u230
load adcpfil ;vadcp=adcpfil(:,2); %360
%y2=resnueva(1:294,4);
%y1=T23p125Nscasa';
load sst23w
load xs23w
load wu23
y2=sst23w1;%T23p125Nscasa';
y1=v4023w';

%y1=v230;

exp1=2;
exp2=8;
inter=40;
y=y1;
abc
%aa=aa(50:135);
%period=period(50:135); %1:240
period=period(1:240);

conv_fft_abc

y1=y;
convolution1=wave;
y=y2;
%abc
conv_fft_abc;
y2=y;
convolution2=wave;
integration_essai;
%phase=unwrap(phase);
delay=(t.*phase/(2*pi));
for i=1:n1;
   xx(i)=i+delay(i);
%xx(i)=i-delay(i);
end;

%eje de tiempo
fecha=datenum(2001,12,14); %para 23w
fet=1:372;fet=fet+fecha;

%load tt
%fet=tt(6:end-5);
%fet=1:372;%tt;

%fety1=fet(1:234);
fety1=fet;%(1:375);
x=fet(1):60:fet(end);
a=datestr(x,1);

subplot(2,1,1)
plot(fety1,y1)
hold on
plot(fety1,y2,'r')
set(gca,'xlim',[min(fet)-3 max(fet)+3],'xtick',x,'xticklabel',[])
title('Normalized meridional component of the north and south signals')

subplot(2,1,2)
delay=unwrap(delay);
plot(fety1,delay,'k')
ylabel('delay (days)')

set(gca,'xlim',[min(fet)-3 max(fet)+3],'xtick',x,'xticklabel',a)

figure
contourf(abs(cross_wave))
caxis([0 1])
view(0,-90)
%colorbar
hold on
%plot([1 200],[75 75],'w')
%ylim([0 240])
%r=30:30:240;
ylim([0 180])
r=30:30:180;
%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')
