def series_capacitance(self, channel, resistor_index=None):
        '''
        Parameters
        ----------
        channel : int
            Analog channel index.
        resistor_index : int, optional
            Series resistor channel index.

            If :data:`resistor_index` is not specified, the resistor-index from
            the current context _(i.e., the result of
            :attr:`series_resistor_index`)_ is used.

            Otherwise, the series-resistor is temporarily set to the value of
            :data:`resistor_index` to read the capacitance before restoring
            back to the original value.

            See definition of :meth:`safe_series_resistor_index_read`
            decorator.

        Returns
        -------
        float
            Return the current series capacitance value for the specified
            channel.
        '''
        if resistor_index is None:
            resistor_index = self.series_resistor_index(channel)
        value = self._series_capacitance(channel)
        try:
            if channel == 0:
                self.calibration.C_hv[resistor_index] = value
            else:
                self.calibration.C_fb[resistor_index] = value
        except:
            pass
        return value