def add_line(self, name, source=None, pars=None, guess_data=None):
    'Adds a new line to a given absorption source.\n        If no source is given, a new one will be created.\n\n        Args:\n            name (str): The name of the line\n            source (str): the name of the source this line will belong to\n            pars (dict): user input parameters\n            guess_data (1darray): flux data to guess with\n\n        '
    assert (source is not None), 'Source must not be None'
    if (source not in self.source_names):
        print()
        print("Could not find source '{}' in source_names.".format(source))
        print("Creating source '{}'".format(source))
        self.add_source(source)
    new_line = VoigtModel(prefix=(((source + '_') + name) + '_'))
    if (guess_data is not None):
        new_pars = new_line.guess(guess_data, x=self.wave)
    else:
        new_pars = new_line.guess(self.flux, x=self.wave)
    if (pars is not None):
        for par in pars:
            par_name = ((((source + '_') + name) + '_') + par)
            new_pars[par_name].set(value=pars[par])
    if (source == 'Telluric'):
        b_name = (source + '_b')
        new_pars[(((source + '_') + name) + '_b')].set(expr=b_name)
    new_pars[(((source + '_') + name) + '_lam_0')].set(min=self.Spectrum.xmin, max=self.Spectrum.xmax)
    self.old_complete_model = self.complete_model
    self.complete_model = (self.complete_model * new_line)
    self.old_all_pars = self.all_pars
    self.all_pars = (self.all_pars + new_pars)
    self.old_cont_model = self.cont_model
    self.old_cont_pars = self.cont_model_pars
    if (source == 'Telluric'):
        try:
            self.old_telluric_model = self.telluric_model
            self.telluric_model = (self.telluric_model * new_line)
        except AttributeError:
            self.old_telluric_model = new_line
            self.telluric_model = new_line
        try:
            self.old_telluric_pars = self.telluric_pars
            self.telluric_pars = (self.telluric_pars + new_pars)
        except AttributeError:
            print('Something bad is probably happening')
            self.old_telluric_pars = new_pars
            self.telluric_pars = new_pars
    else:
        try:
            self.old_nontelluric_model = self.nontelluric_model
            self.nontelluric_model = (self.nontelluric_model * new_line)
        except AttributeError:
            self.old_nontelluric_model = new_line
            self.nontelluric_model = new_line
        try:
            self.old_nontelluric_pars = self.nontelluric_pars
            self.nontelluric_pars = (self.nontelluric_pars + new_pars)
        except AttributeError:
            self.old_nontelluric_pars = new_pars
            self.nontelluric_pars = new_pars
    lambda_name = (((source + '_') + name) + '_lam_0')
    index = bisect.bisect(self.peaks, new_pars[lambda_name])
    self.peaks.insert(index, new_pars[lambda_name])
    self.most_recent = ((source + '_') + name)
    self.n_lines += 1
Adds a new line to a given absorption source.
If no source is given, a new one will be created.

Args:
    name (str): The name of the line
    source (str): the name of the source this line will belong to
    pars (dict): user input parameters
    guess_data (1darray): flux data to guess with
def add_line(self, name, source=None, pars=None, guess_data=None):
    'Adds a new line to a given absorption source.\n        If no source is given, a new one will be created.\n\n        Args:\n            name (str): The name of the line\n            source (str): the name of the source this line will belong to\n            pars (dict): user input parameters\n            guess_data (1darray): flux data to guess with\n\n        '
    assert (source is not None), 'Source must not be None'
    if (source not in self.source_names):
        print()
        print("Could not find source '{}' in source_names.".format(source))
        print("Creating source '{}'".format(source))
        self.add_source(source)
    new_line = VoigtModel(prefix=(((source + '_') + name) + '_'))
    if (guess_data is not None):
        new_pars = new_line.guess(guess_data, x=self.wave)
    else:
        new_pars = new_line.guess(self.flux, x=self.wave)
    if (pars is not None):
        for par in pars:
            par_name = ((((source + '_') + name) + '_') + par)
            new_pars[par_name].set(value=pars[par])
    if (source == 'Telluric'):
        b_name = (source + '_b')
        new_pars[(((source + '_') + name) + '_b')].set(expr=b_name)
    new_pars[(((source + '_') + name) + '_lam_0')].set(min=self.Spectrum.xmin, max=self.Spectrum.xmax)
    self.old_complete_model = self.complete_model
    self.complete_model = (self.complete_model * new_line)
    self.old_all_pars = self.all_pars
    self.all_pars = (self.all_pars + new_pars)
    self.old_cont_model = self.cont_model
    self.old_cont_pars = self.cont_model_pars
    if (source == 'Telluric'):
        try:
            self.old_telluric_model = self.telluric_model
            self.telluric_model = (self.telluric_model * new_line)
        except AttributeError:
            self.old_telluric_model = new_line
            self.telluric_model = new_line
        try:
            self.old_telluric_pars = self.telluric_pars
            self.telluric_pars = (self.telluric_pars + new_pars)
        except AttributeError:
            print('Something bad is probably happening')
            self.old_telluric_pars = new_pars
            self.telluric_pars = new_pars
    else:
        try:
            self.old_nontelluric_model = self.nontelluric_model
            self.nontelluric_model = (self.nontelluric_model * new_line)
        except AttributeError:
            self.old_nontelluric_model = new_line
            self.nontelluric_model = new_line
        try:
            self.old_nontelluric_pars = self.nontelluric_pars
            self.nontelluric_pars = (self.nontelluric_pars + new_pars)
        except AttributeError:
            self.old_nontelluric_pars = new_pars
            self.nontelluric_pars = new_pars
    lambda_name = (((source + '_') + name) + '_lam_0')
    index = bisect.bisect(self.peaks, new_pars[lambda_name])
    self.peaks.insert(index, new_pars[lambda_name])
    self.most_recent = ((source + '_') + name)
    self.n_lines += 1