code: def _deconv_rl_np_fft(data, h, Niter=10,
                        h_is_fftshifted=False):
      
  
      if data.shape!=h.shape:
          raise ValueError("data and h have to be same shape")
  
      if not h_is_fftshifted:
          h = np.fft.fftshift(h)
  
      hflip = h[::-1, ::-1]
  
      # set up some gpu buffers
      y_g = OCLArray.from_array(data.astype(np.complex64))
      u_g = OCLArray.from_array(data.astype(np.complex64))
  
      tmp_g = OCLArray.empty(data.shape, np.complex64)
  
      hf_g = OCLArray.from_array(h.astype(np.complex64))
      hflip_f_g = OCLArray.from_array(hflip.astype(np.complex64))
  
      # hflipped_g = OCLArray.from_array(h.astype(np.complex64))
  
      plan = fft_plan(data.shape)
  
      # transform psf
      fft(hf_g, inplace=True)
      fft(hflip_f_g, inplace=True)
  
      for i in range(Niter):
          logger.info("Iteration: {}".format(i))
          fft_convolve(u_g, hf_g,
                       res_g=tmp_g,
                       kernel_is_fft=True)
  
          _complex_divide_inplace(y_g, tmp_g)
  
          fft_convolve(tmp_g, hflip_f_g,
                       inplace=True,
                       kernel_is_fft=True)
  
          _complex_multiply_inplace(u_g, tmp_g)
  
      return np.abs(u_g.get())
docs: deconvolves data with given psf (kernel) h
  
      data and h have to be same shape
  
  
      via lucy richardson deconvolution