r=67:67:67*200;
c=1; %initialize counter
for e=1:5
    if e==1
        zz=r*sin(deg2rad(0.8));
        ppi=ppi1;
    elseif e==2
        zz=r*sin(deg2rad(2.2));
        ppi=ppi2;
    elseif e==3
        zz=r*sin(deg2rad(3.8));
        ppi=ppi3;
    elseif e==4
        zz=r*sin(deg2rad(5.2));
        ppi=ppi4;
    elseif e==5
        zz=r*sin(deg2rad(6.8));
        ppi=ppi5;
    end 
    for a=1:max(size(azimuth))
        for rr=1:200 %assumes 200 gates of data
        [h,i,j]=pol2cart(deg2rad(azimuth(a)),r(rr),zz(rr));    
        x(c)=h;
        y(c)=i;
        z(c)=j;
        vel(c)=ppi(rr,a);
        c=c+1;
        end
    end
end
u_NaN=find(~isnan(vel));
x=x(u_NaN);
y=y(u_NaN);
z=z(u_NaN);
vel=vel(u_NaN);
[xi,yi,zi]=meshgrid(-8000:100:-4000,-5000:100:0,5:50:1500);
%  w=griddata3(x,y,z,vel,xi,yi,zi);


        
        
    



