code: def power_chisq_bins_from_sigmasq_series(sigmasq_series, num_bins, kmin, kmax):
      
      sigmasq = sigmasq_series[kmax - 1]
      edge_vec = numpy.arange(0, num_bins) * sigmasq / num_bins
      bins = numpy.searchsorted(sigmasq_series[kmin:kmax], edge_vec, side='right')
      bins += kmin
      return numpy.append(bins, kmax)
docs: Returns bins of equal power for use with the chisq functions
  
      Parameters
      ----------
  
      sigmasq_series: FrequencySeries
          A frequency series containing the cumulative power of a filter template
          preweighted by a psd.
      num_bins: int
          The number of chisq bins to calculate.
      kmin: int
          DOCUMENTME
      kmax: int
          DOCUMENTME
  
      Returns
      -------
  
      bins: List of ints
          A list of the edges of the chisq bins is returned.