docs: def averaging_even_kernel(kernel_high_res, subgrid_res):
      """
      makes a lower resolution kernel based on the kernel_high_res (odd numbers) and the subgrid_res (even number), both
      meant to be centered.
  
      :param kernel_high_res: high resolution kernel with even subsampling resolution, centered
      :param subgrid_res: subsampling resolution (even number)
      :return: averaged undersampling kernel
      """
      n_high = len(kernel_high_res)
      n_low = int((n_high + 1) / subgrid_res)
      kernel_low_res = np.zeros((n_low, n_low))
      # adding pixels that are fully within a single re-binned pixel
      for i in range(subgrid_res-1):
          for j in range(subgrid_res-1):
              kernel_low_res += kernel_high_res[i::subgrid_res, j::subgrid_res]
      # adding half of a pixel that has over-lap with two pixels
      i = subgrid_res - 1
      for j in range(subgrid_res - 1):
          kernel_low_res[1:, :] += kernel_high_res[i::subgrid_res, j::subgrid_res] / 2
          kernel_low_res[:-1, :] += kernel_high_res[i::subgrid_res, j::subgrid_res] / 2
      j = subgrid_res - 1
      for i in range(subgrid_res - 1):
          kernel_low_res[:, 1:] += kernel_high_res[i::subgrid_res, j::subgrid_res] / 2
          kernel_low_res[:, :-1] += kernel_high_res[i::subgrid_res, j::subgrid_res] / 2
      # adding a quarter of a pixel value that is at the boarder of four pixels
      i = subgrid_res - 1
      j = subgrid_res - 1
      kernel_edge = kernel_high_res[i::subgrid_res, j::subgrid_res]
      kernel_low_res[1:, 1:] += kernel_edge / 4
      kernel_low_res[:-1, 1:] += kernel_edge / 4
      kernel_low_res[1:, :-1] += kernel_edge / 4
      kernel_low_res[:-1, :-1] += kernel_edge / 4
      return kernel_low_res