%aquisition of SR2 data over Clear Tower during Hurricane Frances deployement 
rep='\temp';%input('enter directory to work on \n','s'); 
az=216;%input('enter the azimuth from true North \n');
ref_el=1.5;%input('enter the reference elevation \n');
HR=1174;%distance radar-tower in meters
vel=[];
hurricane='isabel';
% rep=input('enter directory to work on \n','s'); 
files=dir(['C:\Documents and Settings\sylvie lorsolo\My Documents\research\',hurricane,'\data\modified\',rep,'\*1.5*dat']); 
for fil=1:length(files);
    sweepfile=files(fil).name;
    el=str2num(sweepfile(30:32));
    mod_data=load(['C:\Documents and Settings\sylvie lorsolo\My Documents\research\',hurricane,'\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);
        temp=mod_data(rge,azimuth);
        vel=[vel;temp];
    end
end
 %save(['C:\Documents and Settings\sylvie lorsolo\My Documents\research\',hurricane,'\data\residual_over_clear_timeseries.dat'],'vel','-ascii')
