docs: def level(self, channel, axis, npts, *, verbose=True):
          """Subtract the average value of npts at the edge of a given axis.
  
          Parameters
          ----------
          channel : int or str
              Channel to level.
          axis : int
              Axis to level along.
          npts : int
              Number of points to average for each slice. Positive numbers
              take points at leading indicies and negative numbers take points
              at trailing indicies.
          verbose : bool (optional)
              Toggle talkback. Default is True.
          """
          warnings.warn("level", category=wt_exceptions.EntireDatasetInMemoryWarning)
          channel_index = wt_kit.get_index(self.channel_names, channel)
          channel = self.channels[channel_index]
          # verify npts not zero
          npts = int(npts)
          if npts == 0:
              raise wt_exceptions.ValueError("npts must not be zero")
          # get subtrahend
          ss = [slice(None)] * self.ndim
          if npts > 0:
              ss[axis] = slice(0, npts, None)
          else:
              ss[axis] = slice(npts, None, None)
          subtrahend = np.nanmean(channel[ss], axis=axis)
          if self.ndim > 1:
              subtrahend = np.expand_dims(subtrahend, axis=axis)
          # level
          channel -= subtrahend
          # finish
          channel._null = 0
          if verbose:
              print("channel {0} leveled along axis {1}".format(channel.natural_name, axis))