def __init__(self, Spectrum, init_cont=True, n_anchors=4):
    self.__dict__.update(Spectrum.__dict__)
    self.wave = Spectrum.wave
    self.flux = Spectrum.flux
    self.Spectrum = Spectrum
    if init_cont:
        cont_model = ContinuumModel(n_anchors=n_anchors)
        cont_pars = cont_model.guess(self.flux, x=self.wave)
        for yname in cont_model.ynames:
            flux_range = (np.max(self.flux) - np.min(self.flux))
            ymin = (cont_pars[yname].value - (flux_range / 2))
            ymax = (cont_pars[yname].value + (flux_range / 2))
            cont_pars[yname].set(min=ymin, max=ymax)
    self.cont_model = cont_model
    self.cont_model_pars = cont_pars
    self.complete_model = cont_model
    self.all_pars = cont_pars
    self.peaks = []
    self.n_anchors = n_anchors
    self.n_lines = 0
    self.num_prior_lines = 0
    self.source_names = []
    self.add_source('Telluric', similar={'b': 2})
    self.add_source('Nontelluric', similar=None)
def __init__(self, Spectrum, init_cont=True, n_anchors=4):
    self.__dict__.update(Spectrum.__dict__)
    self.wave = Spectrum.wave
    self.flux = Spectrum.flux
    self.Spectrum = Spectrum
    if init_cont:
        cont_model = ContinuumModel(n_anchors=n_anchors)
        cont_pars = cont_model.guess(self.flux, x=self.wave)
        for yname in cont_model.ynames:
            flux_range = (np.max(self.flux) - np.min(self.flux))
            ymin = (cont_pars[yname].value - (flux_range / 2))
            ymax = (cont_pars[yname].value + (flux_range / 2))
            cont_pars[yname].set(min=ymin, max=ymax)
    self.cont_model = cont_model
    self.cont_model_pars = cont_pars
    self.complete_model = cont_model
    self.all_pars = cont_pars
    self.peaks = []
    self.n_anchors = n_anchors
    self.n_lines = 0
    self.num_prior_lines = 0
    self.source_names = []
    self.add_source('Telluric', similar={'b': 2})
    self.add_source('Nontelluric', similar=None)