def ratio(self, operand):
if isinstance(operand, string_types):<EOL><INDENT>if operand == '<STR_LIT>':<EOL><INDENT>operand = self.mean(axis=<NUM_LIT:0>)<EOL><DEDENT>elif operand == '<STR_LIT>':<EOL><INDENT>operand = self.median(axis=<NUM_LIT:0>)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>% operand)<EOL><DEDENT><DEDENT>out = self / operand<EOL>return out<EOL>
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