def _lombscargle_cdf(z, N, normalization, dH=1, dK=3):
 if ((dK - dH) != 2):
  raise NotImplementedError('Degrees of freedom != 2')
 Nk = (N - dK)
 if (normalization == 'psd'):
  return (1 - np.exp((- z)))
 elif (normalization == 'standard'):
  return (1 - ((1 + z) ** ((-0.5) * Nk)))
 elif (normalization == 'model'):
  return (1 - ((1 - z) ** (0.5 * Nk)))
 elif (normalization == 'log'):
  return (1 - np.exp((((-0.5) * Nk) * z)))
 else:
  raise ValueError("normalization='{0}' is not recognized".format(normalization))

def _lombscargle_cdf ( z , N , normalization , dH = 1 , dK = 3 ) : if ( ( dK - dH ) != 2 ) : raise NotImplementedError ( 'Degrees of freedom != 2' ) Nk = ( N - dK ) if ( normalization == 'psd' ) : return ( 1 - np . exp ( ( - z ) ) ) elif ( normalization == 'standard' ) : return ( 1 - ( ( 1 + z ) ** ( ( - 0.5 ) * Nk ) ) ) elif ( normalization == 'model' ) : return ( 1 - ( ( 1 - z ) ** ( 0.5 * Nk ) ) ) elif ( normalization == 'log' ) : return ( 1 - np . exp ( ( ( ( - 0.5 ) * Nk ) * z ) ) ) else : raise ValueError ( "normalization='{0}' is not recognized" . format ( normalization ) )
cumulative distribution for the lomb-scargle periodogram compute the expected cumulative distribution of the periodogram for the null hypothesis - i .