code: def make_srcmap_old(psf, spatial_model, sigma, npix=500, xpix=0.0, ypix=0.0,
                      cdelt=0.01, rebin=1, psf_scale_fn=None):
      
      if rebin > 1:
          npix = npix * rebin
          xpix = xpix * rebin + (rebin - 1.0) / 2.
          ypix = ypix * rebin + (rebin - 1.0) / 2.
          cdelt = cdelt / rebin
  
      if spatial_model == 'RadialGaussian':
          k = utils.make_cgauss_kernel(psf, sigma, npix, cdelt,
                                       xpix, ypix, psf_scale_fn)
      elif spatial_model == 'RadialDisk':
          k = utils.make_cdisk_kernel(psf, sigma, npix, cdelt,
                                      xpix, ypix, psf_scale_fn)
      elif spatial_model == 'PointSource':
          k = utils.make_psf_kernel(psf, npix, cdelt,
                                    xpix, ypix, psf_scale_fn)
      else:
          raise Exception('Unsupported spatial model: %s', spatial_model)
  
      if rebin > 1:
          k = utils.sum_bins(k, 1, rebin)
          k = utils.sum_bins(k, 2, rebin)
  
      k *= psf.exp[:, np.newaxis, np.newaxis] * np.radians(cdelt) ** 2
      return k
docs: Compute the source map for a given spatial model.
  
      Parameters
      ----------
      psf : `~fermipy.irfs.PSFModel`
      spatial_model : str
          Spatial model.
      sigma : float
          Spatial size parameter for extended models.
      xpix : float
          Source position in pixel coordinates in X dimension.
      ypix : float
          Source position in pixel coordinates in Y dimension.
      rebin : int    
          Factor by which the original map will be oversampled in the
          spatial dimension when computing the model.
      psf_scale_fn : callable        
          Function that evaluates the PSF scaling function.
          Argument is energy in MeV.