code: def diff_flux_threshold(self, skydir, fn, ts_thresh, min_counts):
          
  
          sig, bkg, bkg_fit = self.compute_counts(skydir, fn)
          norms = irfs.compute_norm(sig, bkg, ts_thresh,
                                    min_counts, sum_axes=[2, 3],
                                    rebin_axes=[10, 1],
                                    bkg_fit=bkg_fit)
  
          npred = np.squeeze(np.apply_over_axes(np.sum, norms * sig, [2, 3]))
          norms = np.squeeze(norms)
  
          flux = norms * fn.flux(self.ebins[:-1], self.ebins[1:])
          eflux = norms * fn.eflux(self.ebins[:-1], self.ebins[1:])
          dnde = norms * fn.dnde(self.ectr)
          e2dnde = self.ectr**2 * dnde
  
          return dict(e_min=self.ebins[:-1], e_max=self.ebins[1:],
                      e_ref=self.ectr,
                      npred=npred, flux=flux, eflux=eflux,
                      dnde=dnde, e2dnde=e2dnde)
docs: Compute the differential flux threshold for a point source at
          position ``skydir`` with spectral parameterization ``fn``.
  
          Parameters
          ----------
          skydir : `~astropy.coordinates.SkyCoord`
              Sky coordinates at which the sensitivity will be evaluated.
  
          fn : `~fermipy.spectrum.SpectralFunction`
  
          ts_thresh : float
              Threshold on the detection test statistic (TS).
  
          min_counts : float
              Threshold on the minimum number of counts.