def addComponent(self): function = self.getSelectedModel() sp_adjust.adjust(function, self.x, self.y) self._addComponentToActive(function) self.treeView.clearSelection()
def finalizeAddingComponent(self, name): # this should perhaps be done by instantiating from a # class. We instead resort to brute force and copy the # instance instead. It works..... if name in models_registry.registry: component = models_registry.registry[name].copy() if component: sp_adjust.adjust(component, self.x, self.y) self.models_gui.updateModel(component)
def _addComponentToActive(self, component): name = models_registry.getComponentName(component) # this should be done by instantiating from a class, but that is # not possible yet (the astropy dev version can't be compiled due # to a Cython syntax error...). So we resort to brute force and # copy the instances instead. component = models_registry.registry[name].copy() if component: sp_adjust.adjust(component, self.x, self.y) self.models_gui.updateModel(component)
def addComponent(self, component): ''' Adds a new spectral component to the manager. Parameters ---------- component: astropy.modeling.Fittable1DModel The component to be added to the manager. ''' component = sp_adjust.adjust(component, self.x, self.y) self.models_gui.updateModel(component)