#NEWLINE# def normalize_coherence( x , dof , copy = True ) : #NEWLINE# #INDENT# '\n    The generally accepted choice to transform coherence measures into\n    a more normal distribution\n\n    Parameters\n    ----------\n    x : ndarray, real\n       square-root of magnitude-square coherence measures\n    dof : int\n       number of degrees of freedom in the multitaper model\n    copy : bool\n        Copy or return inplace modified x.\n\n    Returns\n    -------\n    y : ndarray, real\n        The transformed array.\n    ' #NEWLINE# if copy : #NEWLINE# #INDENT# x = x . copy ( ) #NEWLINE# #UNINDENT# np . arctanh ( x , x ) #NEWLINE# x *= np . sqrt ( dof ) #NEWLINE# return copy