def METHOD_NAME(self, type, f_data=None, z_data_raw=None):
    if f_data is None:
        f_data = self.frequency
    if z_data_raw is None:
        if hasattr(self, 'real') and hasattr(self, 'imag'):
            z_data_raw = self.real + 1j * self.imag
        elif hasattr(self, 'amplitude') and hasattr(self, 'phase'):
            z_data_raw = self.amplitude + np.exp(1j * self.phase)
        else:
            raise NameError('no S21 data available. Please load either real and imaginary data or amplitude and phase data.')
    self.circlefit = {'reflection': self.circuit.reflection_port,
                      'notch': self.circuit.notch_port}[type](f_data=f_data,
                                                              z_data_raw=z_data_raw)