code: def ratio(self, operand):
          
          if isinstance(operand, string_types):
              if operand == 'mean':
                  operand = self.mean(axis=0)
              elif operand == 'median':
                  operand = self.median(axis=0)
              else:
                  raise ValueError("operand %r unrecognised, please give a "
                                   "Quantity or one of: 'mean', 'median'"
                                   % operand)
          out = self / operand
          return out
docs: Calculate the ratio of this `Spectrogram` against a reference
  
          Parameters
          ----------
          operand : `str`, `FrequencySeries`, `Quantity`
              a `~gwpy.frequencyseries.FrequencySeries` or
              `~astropy.units.Quantity` to weight against, or one of
  
              - ``'mean'`` : weight against the mean of each spectrum
                in this Spectrogram
              - ``'median'`` : weight against the median of each spectrum
                in this Spectrogram
  
          Returns
          -------
          spectrogram : `Spectrogram`
              a new `Spectrogram`
  
          Raises
          ------
          ValueError
              if ``operand`` is given as a `str` that isn't supported