def separate(self, data, x, old=False, plot=True):
    'Separate the sources that were added to Sightline.\n\n        Args:\n            data (1darray): FLux data to use for separation\n            x (1darray): Wavelength array to use\n            old (bool): If true, uses the older, second-most recent model and parameters\n            plot (bool): If true, plots separted spectrum\n\n        '
    assert (len(self.telluric_pars) > 0)
    assert (len(self.nontelluric_pars) > 0)
    if (old is True):
        model = self.old_complete_model
        params = self.old_all_pars
        telluric_model = self.old_telluric_model
        telluric_params = self.old_telluric_pars
        nontelluric_model = self.old_nontelluric_model
        nontelluric_params = self.old_nontelluric_pars
        cont_model = self.old_cont_model
        cont_params = self.old_cont_pars
    else:
        model = self.complete_model
        params = self.all_pars
        telluric_model = self.telluric_model
        telluric_params = self.telluric_pars
        nontelluric_model = self.nontelluric_model
        nontelluric_params = self.nontelluric_pars
        cont_model = self.cont_model
        cont_params = self.cont_model_pars
    if (len(self.source_names) == 2):
        complete_out = model.eval(data=data, params=params, x=x)
        telluric_out = telluric_model.eval(data=data, params=telluric_params, x=x)
        nontelluric_out = nontelluric_model.eval(data=data, params=nontelluric_params, x=x)
        cont_out = cont_model.eval(data=data, params=cont_params, x=x)
        if plot:
            plt.plot(x, data, label='Data', color='k')
            plt.plot(x, complete_out, label='Final model', color='r')
            plt.plot(x, (data - complete_out), label='Residual', color='g')
            plt.plot(x, (telluric_out * cont_out), label='Telluric model')
            plt.plot(x, (nontelluric_out * cont_out), label='Non-telluric model')
            plt.xlabel('Wavelength ($\\AA$)', fontsize=14)
            plt.ylabel('Flux', fontsize=14)
            plt.legend()
            plt.show()
        return (complete_out, telluric_out, nontelluric_out, cont_out)
Separate the sources that were added to Sightline.

Args:
    data (1darray): FLux data to use for separation
    x (1darray): Wavelength array to use
    old (bool): If true, uses the older, second-most recent model and parameters
    plot (bool): If true, plots separted spectrum
def separate(self, data, x, old=False, plot=True):
    'Separate the sources that were added to Sightline.\n\n        Args:\n            data (1darray): FLux data to use for separation\n            x (1darray): Wavelength array to use\n            old (bool): If true, uses the older, second-most recent model and parameters\n            plot (bool): If true, plots separted spectrum\n\n        '
    assert (len(self.telluric_pars) > 0)
    assert (len(self.nontelluric_pars) > 0)
    if (old is True):
        model = self.old_complete_model
        params = self.old_all_pars
        telluric_model = self.old_telluric_model
        telluric_params = self.old_telluric_pars
        nontelluric_model = self.old_nontelluric_model
        nontelluric_params = self.old_nontelluric_pars
        cont_model = self.old_cont_model
        cont_params = self.old_cont_pars
    else:
        model = self.complete_model
        params = self.all_pars
        telluric_model = self.telluric_model
        telluric_params = self.telluric_pars
        nontelluric_model = self.nontelluric_model
        nontelluric_params = self.nontelluric_pars
        cont_model = self.cont_model
        cont_params = self.cont_model_pars
    if (len(self.source_names) == 2):
        complete_out = model.eval(data=data, params=params, x=x)
        telluric_out = telluric_model.eval(data=data, params=telluric_params, x=x)
        nontelluric_out = nontelluric_model.eval(data=data, params=nontelluric_params, x=x)
        cont_out = cont_model.eval(data=data, params=cont_params, x=x)
        if plot:
            plt.plot(x, data, label='Data', color='k')
            plt.plot(x, complete_out, label='Final model', color='r')
            plt.plot(x, (data - complete_out), label='Residual', color='g')
            plt.plot(x, (telluric_out * cont_out), label='Telluric model')
            plt.plot(x, (nontelluric_out * cont_out), label='Non-telluric model')
            plt.xlabel('Wavelength ($\\AA$)', fontsize=14)
            plt.ylabel('Flux', fontsize=14)
            plt.legend()
            plt.show()
        return (complete_out, telluric_out, nontelluric_out, cont_out)