code: def make_cdisk_kernel(psf, sigma, npix, cdelt, xpix, ypix, psf_scale_fn=None,
                        normalize=False):
      
  
      sigma /= 0.8246211251235321
  
      dtheta = psf.dtheta
      egy = psf.energies
  
      x = make_pixel_distance(npix, xpix, ypix)
      x *= cdelt
  
      k = np.zeros((len(egy), npix, npix))
      for i in range(len(egy)):
          def fn(t): return psf.eval(i, t, scale_fn=psf_scale_fn)
          psfc = convolve2d_disk(fn, dtheta, sigma)
          k[i] = np.interp(np.ravel(x), dtheta, psfc).reshape(x.shape)
  
      if normalize:
          k /= (np.sum(k, axis=0)[np.newaxis, ...] * np.radians(cdelt) ** 2)
  
      return k
docs: Make a kernel for a PSF-convolved 2D disk.
  
      Parameters
      ----------
  
      psf : `~fermipy.irfs.PSFModel`
  
      sigma : float
        68% containment radius in degrees.