code: def psf_convolution(self, grid, grid_scale, psf_subgrid=False, subgrid_res=1):
          
          psf_type = self.psf_type
          if psf_type == 'NONE':
              return grid
          elif psf_type == 'GAUSSIAN':
              sigma = self._sigma_gaussian/grid_scale
              img_conv = ndimage.filters.gaussian_filter(grid, sigma, mode='nearest', truncate=self._truncation)
              return img_conv
          elif psf_type == 'PIXEL':
              if psf_subgrid:
                  kernel = self.subgrid_pixel_kernel(subgrid_res)
              else:
                  kernel = self._kernel_pixel
              img_conv1 = signal.fftconvolve(grid, kernel, mode='same')
              return img_conv1
          else:
              raise ValueError('PSF type %s not valid!' % psf_type)
docs: convolves a given pixel grid with a PSF