function [Ustream,Vstream,Wstream,alpha,beta]=rotcorr(u,v,w)
Ub=mean(u);
Vb=mean(v);
Wb=mean(w);
Sb=sqrt(Ub^2+Vb^2);
%disp(['Relative 1-hr U = ',num2str(Sb),'  [m/s]'])
%disp(['TRUE Wind From North = ',num2str(-Un),' [m/s]    From West = ',num2str(Ue),' [m/s]     Dir = ',num2str(Twindir)]),
beta=atan2(Wb,Sb);
alpha=atan2(Vb,Ub);
%disp(['Alpha = ',num2str(alpha*180/pi),' deg   Beta = ',num2str(beta*180/pi),' deg'])
Ustream=+u*cos(alpha)*cos(beta)+v*sin(alpha)*cos(beta)+w*sin(beta);
Vstream=-u*sin(alpha)+v*cos(alpha);
Wstream=-u*cos(alpha)*sin(beta)-v*sin(alpha)*sin(beta)+w*cos(beta);
