%aquisition of SR2 data over Clear Tower during Hurricane Frances deployement 
rep='\meanless\temp';%input('enter directory to work on \n','s'); 
az=333;%input('enter the azimuth from true North \n');
ref_el=3;%input('enter the reference elevation \n');
HR=392;%distance radar-tower in meters
vel=[];
% rep=input('enter directory to work on \n','s'); 
files=dir(['C:\Documents and Settings\sylvie lorsolo\My Documents\research\frances\data\modified\',rep,'\*dat']); 
for fil=1:110%length(files);
    sweepfile=files(fil).name;
    el=str2num(sweepfile(30:32));
    mod_data=load(['C:\Documents and Settings\sylvie lorsolo\My Documents\research\frances\data\modified\',rep,'\',sweepfile]);
    mod_az=mod_data(length(mod_data),:);
    mod_az=mod_az';
    mod_data=mod_data(1:length(mod_data)-1,:);
    dif=abs(az-mod_az);
    azimuth=find(dif==min(dif));
    if length(azimuth) >1
        break
    else
        rge=(HR/cos(deg2rad(ref_el)))/66.7;
        rge=round(rge)+1;
        temp=mod_data(rge,azimuth);
        vel=[vel;temp];
    end
end
 save(['C:\Documents and Settings\sylvie lorsolo\My Documents\research\frances\data\residual_over_clear_timeseries.dat'],'vel','-ascii')
