code: def effsnr(snr, reduced_x2, fac=250.):
      
      snr = numpy.array(snr, ndmin=1, dtype=numpy.float64)
      rchisq = numpy.array(reduced_x2, ndmin=1, dtype=numpy.float64)
      esnr = snr / (1 + snr ** 2 / fac) ** 0.25 / rchisq ** 0.25
  
      # If snr input is float, return a float. Otherwise return numpy array.
      if hasattr(snr, '__len__'):
          return esnr
      else:
          return esnr[0]
docs: Calculate the effective SNR statistic. See (S5y1 paper) for definition.