def prepare(): fit_interface.ResetFitterParameters() hdtv.options.Set("table", "classic") hdtv.options.Set("uncertainties", "short") spectra.Clear() yield spectra.Clear() fit_interface.ResetFitterParameters()
def prepare(request): fit_interface.ResetFitterParameters() # original_wd = os.path.abspath(os.path.join(__file__, os.pardir)) original_wd = os.getcwd() os.chdir(original_wd) yield os.chdir(original_wd) session.Clear()
def prepare(): fit_interface.ResetFitterParameters() hdtv.options.Set("table", "classic") hdtv.options.Set("uncertainties", "short") for _ in range(3): spec_interface.LoadSpectra(testspectrum) spectra.ActivateObject("0") yield spectra.Clear()
def prepare(): fit_interface.ResetFitterParameters() hdtv.options.Set("table", "classic") hdtv.options.Set("uncertainties", "short") spec_interface.LoadSpectra(testspectrum) for i in range(5): spec_interface.LoadSpectra(testspectrum) spectra.Get(str(i)).cal = [0, (i + 1) * 0.5] yield spectra.Clear()
def prepare(): fit_interface.ResetFitterParameters() hdtv.options.Set("table", "classic") hdtv.options.Set("uncertainties", "short") spec_interface.LoadSpectra(testspectrum) yield spectra.Clear() bins_h1 = linspace(0.5, NBINS + 0.5, NBINS) spectrum_h1 = BG_PER_BIN * ones(NBINS) spectrum_h1 = spectrum_h1 + PEAK_VOLUME * norm.pdf( bins_h1, loc=0.5 * NBINS, scale=PEAK_WIDTH) savetxt(testspectrum_h1, spectrum_h1) bins_h2 = linspace(0.5, NBINS + 0.5, int(0.5 * NBINS)) spectrum_h2 = 0.5 * BG_PER_BIN * ones(int(0.5 * NBINS)) spectrum_h2 = spectrum_h2 + 2. * PEAK_VOLUME * norm.pdf( bins_h2, loc=0.5 * NBINS, scale=PEAK_WIDTH) savetxt(testspectrum_h2, spectrum_h2)