Skip to content

Commit

Permalink
Remove useless test spectra
Browse files Browse the repository at this point in the history
  • Loading branch information
op3 committed Jan 17, 2024
1 parent 5633d24 commit c26ec61
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions tests/fitxml/test_cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
from hdtv.plugins.specInterface import spec_interface

testspectrum = os.path.join(os.path.curdir, "tests", "share", "osiris_bg.spc")
testspectrum_h1 = os.path.join(os.path.curdir, "tests", "share", "binning_h1.tv")
testspectrum_h2 = os.path.join(os.path.curdir, "tests", "share", "binning_h2.tv")


NBINS = 2000
Expand All @@ -57,28 +55,14 @@


@pytest.fixture(autouse=True)
def prepare():
def prepare(tmp_path):
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.0 * PEAK_VOLUME * norm.pdf(
bins_h2, loc=0.5 * NBINS, scale=PEAK_WIDTH
)
savetxt(testspectrum_h2, spectrum_h2)


def get_markers(fit=None):
if fit is None:
Expand Down

0 comments on commit c26ec61

Please sign in to comment.