clear
cdf1='44013tau-a.cdf';
cdf2='logan-a.cdf';
%
u1='east';
v1='north';
u2='east';
v2='north';
%
% Summer
start_time=[1990  4  1  5 0 0];
stop_time= [1990  8 24  4 0 0];
%
% 2nd Winter
%start_time=[1990 10  1  5 0 0];
%stop_time= [1991  3 28  4 0 0];
%
% 1st Winter
%start_time=[1989 11  1  5 0 0];
%stop_time= [1990  4  1  4 0 0];
%
[rho,theta,w1,w2]=bcomcor(cdf1,u1,v1,cdf2,u2,v2,start_time,stop_time);
s1=remat(w1,24)';
s2=remat(w2,24)';
% mean wind at each hour
mean_wind=[mean(s1)' mean(s2)'];
%
%  plot speed
plot([1:24],abs(mean_wind));
titl=['Mean hourly wind: ' date_lbl(start_time,stop_time)]; 
title(titl);
xlabel('Hour of Day (EST)')
ylabel('wind speed (m/s)')
grid
pause
%
plot([1:24],90-angle(mean_wind)*180/pi);
title(titl);
ylabel('wind direction (ocean convention)')
xlabel('Hour of Day (EST)')
grid
