files=dir('C:\Documents and Settings\sylvie lorsolo\My Documents\research\frances\data\modified\tr20dd\*EV*dat'); 

for fil=89%:length(files)
   
    sweepfile=files(fil).name;
    radar_data=load(['C:\Documents and Settings\sylvie lorsolo\My Documents\research\frances\data\modified\tr20dd\',sweepfile]);
    vel=radar_data(1:600,:);
    az=radar_data(length(radar_data),:);
    
    az=az';
    temp_vel=vel;
    [vel_row,vel_col]=size(vel);
%mean_wind=load(['C:\Documents and Settings\sylvie lorsolo\My Documents\research\frances\data\total_wind\',filename]);
for rg=1:600%length(vel)
        
        wd_mean=wd(rg,1);
        ws_mean=ws(rg,1);
        
        if isnan(wd_mean)==1
            mean_radial_vel_tower1(rg,1:vel_col)=NaN*ones(1,1:vel_col);
            meanless(rg,1:vel_col)=NaN*ones(1,1:vel_col);
        else
            beta=abs(az-wd_mean);
            
            u_toward=find(beta < 90  | beta >= 270);
            toward=-ws_mean*cos(deg2rad(beta(u_toward)));
            
            
            u_away=find(beta >= 90  & beta <270);
            beta(u_away)=abs(beta(u_away)-180);
            away=ws_mean*cos(deg2rad(beta(u_away)));
            
            
            mean_radial_vel_tower1(rg,u_away)=away';
            mean_radial_vel_tower1(rg,u_toward)=toward';
            
            
            meanless(rg,:)=vel(rg,:)-mean_radial_vel_tower1(rg,:);
        end
    end
        w=find(az >=270 & az <360);
a=az;
a(w)=360-a(w)+90;
w=find(az>=0 & az<270);
a(w)=90-a(w);
 az=a;
 [th,r]=meshgrid(deg2rad(az),0:67:67*149);
  [x,y]=pol2cart(th,r);
  h=pcolor(x,y,meanless(1:150,:));
  shading flat
  v=[-8 8];
   caxis(v)
    velcolor=load(['C:\Documents and Settings\sylvie lorsolo\My Documents\research\programs\carbon43.dat']);
colormap(velcolor);
colorbar
end