docs: def create_background_map(data, bsx, bsy):
      """Create a background map with a given mesh size"""
      sx, sy = data.shape
      mx = sx // bsx
      my = sy // bsy
      comp = []
      rms = []
      # Rows
      sp = numpy.split(data, numpy.arange(bsx, sx, bsx), axis=0)
      for s in sp:
          # Columns
          rp = numpy.split(s, numpy.arange(bsy, sy, bsy), axis=1)
          for r in rp:
              b, r = background_estimator(r)
              comp.append(b)
              rms.append(r)
  
      # Reconstructed image
      z = numpy.array(comp)
      z.shape = (mx, my)
      # median filter
      ndfilter.median_filter(z, size=(3, 3), output=z)
  
      # Interpolate to the original size
      new = _interpolation(z, sx, sy, mx, my)
  
      # Interpolate the rms
      z = numpy.array(rms)
      z.shape = (mx, my)
      nrms = _interpolation(z, sx, sy, mx, my)
  
      return new, nrms