code: def values(self, corr, snrv, snr_norm, psd, indices, template):
          
  
          if self.do:
              num_above = len(indices)
              if self.snr_threshold:
                  above = abs(snrv * snr_norm) > self.snr_threshold
                  num_above = above.sum()
                  logging.info('%s above chisq activation threshold' % num_above)
                  above_indices = indices[above]
                  above_snrv = snrv[above]
                  rchisq = numpy.zeros(len(indices), dtype=numpy.float32)
                  dof = -100
              else:
                  above_indices = indices
                  above_snrv = snrv
  
              if num_above > 0:
                  bins = self.cached_chisq_bins(template, psd)
                  dof = (len(bins) - 1) * 2 - 2
                  chisq = power_chisq_at_points_from_precomputed(corr,
                                       above_snrv, snr_norm, bins, above_indices)
  
              if self.snr_threshold:
                  if num_above > 0:
                      rchisq[above] = chisq
              else:
                  rchisq = chisq
  
              return rchisq, numpy.repeat(dof, len(indices))# dof * numpy.ones_like(indices)
          else:
              return None, None
docs: Calculate the chisq at points given by indices.
  
          Returns
          -------
          chisq: Array
              Chisq values, one for each sample index
  
          chisq_dof: Array
              Number of statistical degrees of freedom for the chisq test
              in the given template