plan_perp_roll=112;
  limit_sup=5*10^(-3);
  limit_inf=5*10^(-4);
R_max_unaliased=5800;
hurricane='frances';
rep='meanless\vert\filtered\2000\gridded_data';
 files=dir(['C:\Documents and Settings\sylvie lorsolo\My Documents\research\',hurricane,'\data\modified\',rep,'\*.mat']);
 for fil=15%:length(files)
    trans=200:200:3400;
    for ii=1:length(trans)
        load(['C:\Documents and Settings\sylvie lorsolo\My Documents\research\',hurricane,'\data\modified\',rep,'\',files(fil).name]);
        u_count=find(count < 15);

        vel(u_count)=NaN;
        [x_3dgrid,y_3dgrid,z_3dgrid]=meshgrid(xc,yc,zc);
        pas=25;
        x1=-10000:pas:10000;
        y1=-10000:pas:10000;
        L=length(x1);
        plan_axis=ones(L,1)*x1;
        hsp = surf(x1,y1,zeros(length(x1)));
        rotate(hsp,[1,0,0],90);
        rotate(hsp,[0,0,1],plan_perp_roll);
        xd = get(hsp,'XData');
        yd = get(hsp,'YData');
        zd = get(hsp,'ZData');
        xd1=xd+trans(ii);
        yd1=yd+trans(ii);
        comple=180-plan_perp_roll;

            xd2=xd1;
            yd2=yd1;
            zd2=zd;
            plan_axis2=plan_axis;
        
            h=slice(x_3dgrid,y_3dgrid,z_3dgrid,vel,xd2,yd2,zd2);
        x_section = get(h,'CData');
        
        delta_x=pas;
        
        u=find(zd2(:,1)>=0 & zd2(:,1) <=max(zc));
        x_section=x_section(u,:);
        plan_axis2=plan_axis2(u,:);
        yd2=yd2(u,:);
        zd2=zd2(u,:);
        close all
        z_data=[];
        lambda(ii).trans=trans(ii);
        for height=1:600/fix(zc(2)-zc(1))
            temp=x_section(height,:);
            
            
            
            
            
%             %%%%%%%%%%%%Filtering%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%             
%             u_NaN = find(~isnan(temp));
%         temp2=temp(u_NaN)';
%         Fs=1/(delta_x);
%         NFFT=length(temp2);
%         NumUniquePts = ceil((NFFT+1)/2);
%         f = (0:NumUniquePts-1)*Fs/NFFT;
%        
%         
%         if length(temp2)> 40
%              [b,a] = butter(5,limit_inf/(Fs/2),'high');  
%             Hd = dfilt.df2t(b,a); 
%             zfilt = filter(Hd,temp2);
%            
%             if limit_sup/(Fs/2) <= 1
%                 [b,a] = butter(5,limit_sup/(Fs/2));
%                 Hd = dfilt.df2t(b,a);        
%                 zfilt = filter(Hd,zfilt);
%             end
%           temp(u_NaN)=zfilt';
%        end
%             
            
%             %%%%%%%%%%Fin de %%%%%%%%%%filtering%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            z_data=[z_data temp'];
        end
         lambda(ii).plan_axis2=plan_axis2;
        lambda(ii).zd2=zd2;
        lambda(ii).z_data=z_data;
    end
end
