% testflag.m
% compare les trois flags de "a_new.mat" et "skaphi.mat"
% les 4 vitesses, les 4 int et les 4 cor

cd e:\Gatti2\golts\Survey\Survey081203\ADCPTethys\data081203\new
load 807a_new.mat
waterFlag_new=waterFlag;
bottomFlag_new=bottomFlag;
filterFlag_new=filterFlag;
indnanve=find(isnan(ve)==1);
indnanvn=find(isnan(vn)==1);
indnanvz=find(isnan(vz)==1);
indnanverr=find(isnan(verr)==1);
ve_new=ve;
ve_new(indnanve)=0;
vn_new=vn;
vn_new(indnanvn)=0;
vz_new=vz;
vz_new(indnanvz)=0;
verr_new=verr;
verr_new(indnanverr)=0;
int1_new=int1;
int2_new=int2;
int3_new=int3;
int4_new=int4;
cor1_new=cor1;
cor2_new=cor2;
cor3_new=cor3;
cor4_new=cor4;
clear waterFlag bottomFlag filterFlag ve vn vz verr ...
  int1 int2 int3 int4 cor1 cor2 cor3 cor4 indnanve indnanven indnanvz indnanverr

cd ../skaphi
load 807skaphi.mat
waterFlag_sk=waterFlag;
bottomFlag_sk=bottomFlag;
filterFlag_sk=filterFlag;
indnanve=find(isnan(ve)==1);
indnanvn=find(isnan(vn)==1);
indnanvz=find(isnan(vz)==1);
indnanverr=find(isnan(verr)==1);
ve_sk=ve;
ve_sk(indnanve)=0;
vn_sk=vn;
vn_sk(indnanvn)=0;
vz_sk=vz;
vz_sk(indnanvz)=0;
verr_sk=verr;
verr_sk(indnanverr)=0;
int1_sk=int1;
int2_sk=int2;
int3_sk=int3;
int4_sk=int4;
cor1_sk=cor1;
cor2_sk=cor2;
cor3_sk=cor3;
cor4_sk=cor4;

[indw1,indw2]=find(waterFlag_new~=waterFlag_sk);
[indb1,indb2]=find(bottomFlag_new~=bottomFlag_sk);
[indf1,indf2]=find(filterFlag_new~=bottomFlag_sk);
[indve1,indve2]=find(ve_new~=ve_sk);
[indvn1,indvn2]=find(vn_new~=vn_sk);
[indvz1,indvz2]=find(vz_new~=vz_sk);
[indver1,indver2]=find(verr_new~=verr_sk);
[indint11,indint12]=find(int1_new~=int1_sk);
[indint21,indint22]=find(int2_new~=int2_sk);
[indint31,indint32]=find(int3_new~=int3_sk);
[indint41,indint42]=find(int4_new~=int4_sk);
[indcor11,indcor12]=find(cor1_new~=cor1_sk);
[indcor21,indcor22]=find(cor2_new~=cor2_sk);
[indcor31,indcor32]=find(cor3_new~=cor3_sk);
[indcor41,indcor42]=find(cor4_new~=cor4_sk);



