def circcorrcoef(alpha, beta, axis=None, weights_alpha=None, weights_beta=None):
 if (np.size(alpha, axis) != np.size(beta, axis)):
  raise ValueError(u'alpha and beta must be arrays of the same size')
 mu_a = circmean(alpha, axis, weights_alpha)
 mu_b = circmean(beta, axis, weights_beta)
 sin_a = np.sin((alpha - mu_a))
 sin_b = np.sin((beta - mu_b))
 rho = (np.sum((sin_a * sin_b)) / np.sqrt((np.sum((sin_a * sin_a)) * np.sum((sin_b * sin_b)))))
 return rho

def circcorrcoef ( alpha , beta , axis = None , weights_alpha = None , weights_beta = None ) : if ( np . size ( alpha , axis ) != np . size ( beta , axis ) ) : raise ValueError ( u'alpha and beta must be arrays of the same size' ) mu_a = circmean ( alpha , axis , weights_alpha ) mu_b = circmean ( beta , axis , weights_beta ) sin_a = np . sin ( ( alpha - mu_a ) ) sin_b = np . sin ( ( beta - mu_b ) ) rho = ( np . sum ( ( sin_a * sin_b ) ) / np . sqrt ( ( np . sum ( ( sin_a * sin_a ) ) * np . sum ( ( sin_b * sin_b ) ) ) ) ) return rho
computes the circular correlation coefficient between two array of circular data .