%usage: r_corr = wind_correction(r,ws);
%
% Uses 3rd order polynomial fit to Koschmeider (1934) data to correct
% R for under catchment errors due to wind speed, WS.
%
%      R - rain rate, mm/hr
%     WS - wind speed, m/s
%
% R_CORR - corrected rain rate, mm/hr
%

%date:  7/00 YS

  function r_corr = wind_correction(r,ws);


V_Kosch=[0:2:16]';  % in m/s
D_Kosch=[0;4;10;19;29;40;51;62;71];  % in %loss
p=polyfit(V_Kosch,D_Kosch,3); %3rd order fit to Koschmieder data
D_data=polyval(p,ws);
r_corr=r + r.*(D_data/100);

