docs: def bin(self, n_bins=1, pixels_per_bin=None, wave_min=None, wave_max=None):
          """
          Break the filter up into bins and apply a throughput to each bin,
          useful for G141, G102, and other grisms
  
          Parameters
          ----------
          n_bins: int
              The number of bins to dice the throughput curve into
          pixels_per_bin: int (optional)
              The number of channels per bin, which will be used
              to calculate n_bins
          wave_min: astropy.units.quantity (optional)
              The minimum wavelength to use
          wave_max: astropy.units.quantity (optional)
              The maximum wavelength to use
          """
          # Get wavelength limits
          if wave_min is not None:
              self.wave_min = wave_min
          if wave_max is not None:
              self.wave_max = wave_max
  
          # Trim the wavelength by the given min and max
          raw_wave = self.raw[0]
          whr = np.logical_and(raw_wave * q.AA >= self.wave_min,
                               raw_wave * q.AA <= self.wave_max)
          self.wave = (raw_wave[whr] * q.AA).to(self.wave_units)
          self.throughput = self.raw[1][whr]
          print('Bandpass trimmed to',
                '{} - {}'.format(self.wave_min, self.wave_max))
  
          # Calculate the number of bins and channels
          pts = len(self.wave)
          if isinstance(pixels_per_bin, int):
              self.pixels_per_bin = pixels_per_bin
              self.n_bins = int(pts/self.pixels_per_bin)
          elif isinstance(n_bins, int):
              self.n_bins = n_bins
              self.pixels_per_bin = int(pts/self.n_bins)
          else:
              raise ValueError("Please specify 'n_bins' OR 'pixels_per_bin' as integers.")
  
          print('{} bins of {} pixels each.'.format(self.n_bins,
                                                    self.pixels_per_bin))
  
          # Trim throughput edges so that there are an integer number of bins
          new_len = self.n_bins * self.pixels_per_bin
          start = (pts - new_len) // 2
          self.wave = self.wave[start:new_len+start].reshape(self.n_bins, self.pixels_per_bin)
          self.throughput = self.throughput[start:new_len+start].reshape(self.n_bins, self.pixels_per_bin)