def test_missmatch_arf(make_data_path): ui.load_pha(1, make_data_path("source1.pi")) ui.load_bkg(1, make_data_path("back1.pi")) ui.load_arf(1, make_data_path("arf_1024.fits")) ui.load_rmf(1, make_data_path("rmf_1024.fits")) ui.set_method('levmar') ui.set_model(ui.powlaw1d.p1 * ui.xswabs.abs1) ui.set_par('p1.ampl', 0.0001) ui.set_stat('cash') ui.fit() parvals = ui.get_fit_results().parvals assert parvals[0] == approx(1.47969, rel=1.0e-3) assert parvals[1] == approx(0.0019491, rel=1.0e-3) assert parvals[2] == approx(2.35452, rel=1.0e-3)
def test_load_multi_arfsrmfs(make_data_path): pha_pi = make_data_path("3c273.pi") ui.load_pha(1, pha_pi) ui.load_pha(2, pha_pi) bkg_pi = make_data_path("3c273_bg.pi") ui.load_bkg(1, bkg_pi) ui.load_bkg(2, bkg_pi) arf = make_data_path("3c273.arf") ui.load_multi_arfs(1, [arf, arf], [1, 2]) ui.load_multi_arfs(2, [arf, arf], [1, 2]) rmf = make_data_path("3c273.rmf") ui.load_multi_rmfs(1, [rmf, rmf], [1, 2]) ui.load_multi_rmfs(2, [rmf, rmf], [1, 2]) ui.set_model(1, ui.xsapec.src) ui.set_model(2, ui.xsapec.src) ui.fit() parvals = ui.get_fit_results().parvals assert (parvals[0] == pytest.approx(1.03364, rel=1.0e-3)) assert (parvals[1] == pytest.approx(4.56712e-05, rel=1.03e-3))