code: def _create_srcmap(self, name, src, **kwargs):
          
  
          psf_scale_fn = kwargs.get('psf_scale_fn', None)
          skydir = src.skydir
          spatial_model = src['SpatialModel']
          spatial_width = src['SpatialWidth']
          xpix, ypix = self.geom.to_image().coord_to_pix(skydir)
          exp = self._bexp.interp_by_coord(
              (skydir, self._bexp.geom.axes[0].center))
          cache = self._srcmap_cache.get(name, None)
          if cache is not None:
              k = cache.create_map([ypix, xpix])
          else:
              k = srcmap_utils.make_srcmap(self._psf, exp, spatial_model,
                                           spatial_width,
                                           npix=self.npix, xpix=xpix, ypix=ypix,
                                           cdelt=self.config['binning']['binsz'],
                                           psf_scale_fn=psf_scale_fn,
                                           sparse=True)
  
          return k
docs: Generate the source map for a source.