 rep=input('enter directory to work on \n','s') ; 
     [sweepfile,pathname] = uigetfile('*.','Select the sweepfile');
mod_data=load(['C:\Documents and Settings\sylvie lorsolo\My Documents\research\isabel\data\modified\',rep,'\',sweepfile]);
mod_az=mod_data(length(mod_data),:);
mod_az=mod_az';
azi=mod_az;
mod_data=mod_data(1:length(mod_data)-1,:);
w=find(mod_az >=270 & mod_az <360);
a=mod_az;
a(w)=360-a(w)+90;
w=find(mod_az>=0 & mod_az<270);
a(w)=90-a(w);
 [th,r]=meshgrid(deg2rad(a),0:67:67*499);
  [x,y]=pol2cart(th,r);
  h=pcolor(x,y,mod_data(1:500,:));
  shading flat
  v=[-7 7];
  caxis(v)
velcolor=load(['C:\Documents and Settings\sylvie lorsolo\My Documents\research\programs\carbon43.dat']);
colormap(velcolor);
colorbar
zoom on;
zoom off
 [x1,y1]=ginput;
r1=sqrt(x1^2+y1^2);
dif=abs(r1-r(:,1));
range=find(dif==min(dif));
azimuth=rad2deg(atan(y1/x1));
 if x1 > 0 & y1 > 0
     azimuth=90-azimuth
 elseif x1 > 0& y1 < 0
     azimuth=90-azimuth
 elseif x1 < 0 & y1 < 0
     azimuth=270-azimuth
 elseif x1 < 0 & y1 > 0
azimuth=270-azimuth
end
dif=abs(azimuth-mod_az);
azimuth=find(dif==min(dif));
