code: def _pad_data(self, yextra, xextra):
          
  
          ypad = 0
          xpad = 0
          if yextra > 0:
              ypad = self.box_size[0] - yextra
          if xextra > 0:
              xpad = self.box_size[1] - xextra
          pad_width = ((0, ypad), (0, xpad))
  
          # mode must be a string for numpy < 0.11
          # (see https://github.com/numpy/numpy/issues/7112)
          mode = str('constant')
          data = np.pad(self.data, pad_width, mode=mode,
                        constant_values=[1.e10])
  
          # mask the padded regions
          pad_mask = np.zeros_like(data)
          y0 = data.shape[0] - ypad
          x0 = data.shape[1] - xpad
          pad_mask[y0:, :] = True
          pad_mask[:, x0:] = True
  
          # pad the input mask separately (there is no np.ma.pad function)
          if self.mask is not None:
              mask = np.pad(self.mask, pad_width, mode=mode,
                            constant_values=[True])
              mask = np.logical_or(mask, pad_mask)
          else:
              mask = pad_mask
  
          return np.ma.masked_array(data, mask=mask)
docs: Pad the ``data`` and ``mask`` to have an integer number of
          background meshes of size ``box_size`` in both dimensions.  The
          padding is added on the top and/or right edges (this is the best
          option for the "zoom" interpolator).
  
          Parameters
          ----------
          yextra, xextra : int
              The modulus of the data size and the box size in both the
              ``y`` and ``x`` dimensions.  This is the number of extra
              pixels beyond a multiple of the box size in the ``y`` and
              ``x`` dimensions.
  
          Returns
          -------
          result : `~numpy.ma.MaskedArray`
              The padded data and mask as a masked array.