def add_fit(self,parameters): if not isinstance(parameters,ndarray) or len(parameters)!=4: raise "parameters must be a ndarray of length 4" self.fits.append(parameters) self.c_amplitude -= fitting.lorenzian(parameters,self.frequency,{'baseline':0}) self.mean = self.c_amplitude.mean() self.std = self.c_amplitude.std() self.target_std = 100.0*sqrt(self.mean*(100.0-self.mean)/(10000.0*self.stats))
def remove_fit(self,index): fit = self.fits[index] self.c_amplitude += fitting.lorenzian(fit,self.frequency,{'baseline':0}) self.mean = self.c_amplitude.mean() self.std = self.c_amplitude.std() self.target_std = 100.0*sqrt(self.mean*(100.0-self.mean)/(10000.0*self.stats)) self.fits.pop(index) return fit
def add_fit(self, parameters): if not isinstance(parameters, ndarray) or len(parameters) != 4: raise "parameters must be a ndarray of length 4" self.fits.append(parameters) self.c_amplitude -= fitting.lorenzian(parameters, self.frequency, {'baseline': 0}) self.mean = self.c_amplitude.mean() self.std = self.c_amplitude.std() self.target_std = 100.0 * sqrt(self.mean * (100.0 - self.mean) / (10000.0 * self.stats))
def remove_fit(self, index): fit = self.fits[index] self.c_amplitude += fitting.lorenzian(fit, self.frequency, {'baseline': 0}) self.mean = self.c_amplitude.mean() self.std = self.c_amplitude.std() self.target_std = 100.0 * sqrt(self.mean * (100.0 - self.mean) / (10000.0 * self.stats)) self.fits.pop(index) return fit