def test_loading_bad_keywords_file(): with within_directory(__example_dir): pha_fn = "example_integral_spi.pha" rsp_fn = "example_integral_spi.rsp" pha_spectrum = PHASpectrum(pha_fn, rsp_file=rsp_fn) assert type(pha_spectrum.is_poisson) == bool ogip = OGIPLike("test_ogip", observation=pha_fn, response=rsp_fn) ogip.__repr__()
def test_loading_a_generic_pha_file(): with within_directory(__example_dir): ogip = OGIPLike("test_ogip", observation="test.pha{1}") pha_info = ogip.get_pha_files() assert ogip.name == "test_ogip" assert ogip.n_data_points == sum(ogip._mask) assert sum(ogip._mask) == ogip.n_data_points assert ogip.tstart == 0.0 assert ogip.tstop == 9.95012 assert "cons_test_ogip" in ogip.nuisance_parameters assert ogip.nuisance_parameters["cons_test_ogip"].fix == True assert ogip.nuisance_parameters["cons_test_ogip"].free == False assert "pha" in pha_info assert "bak" in pha_info assert "rsp" in pha_info ogip.__repr__()
def test_loading_a_loose_ogip_pha_file(): with within_directory(__example_dir): ogip = OGIPLike("test_ogip", observation="example_integral.pha") pha_info = ogip.get_pha_files() assert ogip.name == "test_ogip" assert ogip.n_data_points == sum(ogip._mask) assert sum(ogip._mask) == ogip.n_data_points # assert ogip.tstart is None # assert ogip.tstop is None assert "cons_test_ogip" in ogip.nuisance_parameters assert ogip.nuisance_parameters["cons_test_ogip"].fix == True assert ogip.nuisance_parameters["cons_test_ogip"].free == False assert "pha" in pha_info # assert 'bak' in pha_info assert "rsp" in pha_info ogip.__repr__()
def test_loading_a_generic_pha_file(): with within_directory(__example_dir): ogip = OGIPLike('test_ogip', observation='test.pha{1}') pha_info = ogip.get_pha_files() assert ogip.name == 'test_ogip' assert ogip.n_data_points == sum(ogip._mask) assert sum(ogip._mask) == ogip.n_data_points assert ogip.tstart == 0. assert ogip.tstop == 9.95012 assert 'cons_test_ogip' in ogip.nuisance_parameters assert ogip.nuisance_parameters['cons_test_ogip'].fix == True assert ogip.nuisance_parameters['cons_test_ogip'].free == False assert 'pha' in pha_info assert 'bak' in pha_info assert 'rsp' in pha_info ogip.__repr__()