def test_load_table_fits(self): # QUS: why is this not in the sherpa-test-data repository? this_dir = os.path.dirname(os.path.abspath(__file__)) ui.load_table(1, os.path.join(this_dir, 'data', 'two_column_x_y.fits.gz')) data = ui.get_data(1) self.assertEqualWithinTol(data.x, [1, 2, 3]) self.assertEqualWithinTol(data.y, [4, 5, 6])
def test_load_table_fits(clean_astro_ui): # QUS: why is this not in the sherpa-test-data repository? this_dir = os.path.dirname(os.path.abspath(__file__)) ui.load_table(1, os.path.join(this_dir, 'data', 'two_column_x_y.fits.gz')) data = ui.get_data(1) assert data.x == pytest.approx([1, 2, 3]) assert data.y == pytest.approx([4, 5, 6])
def test_ui_table_noarg(setup_files, clean_astro_ui): """Don't give a dataset id It also lets us actually check the results of the load_table call """ assert ui.list_data_ids() == [] ui.load_table(setup_files.fits, colkeys=['RMID', 'COUNTS']) assert ui.list_data_ids() == [1] d = ui.get_data() assert d.name.endswith('1838_rprofile_rmid.fits') assert isinstance(d, ui.Data1D) assert len(d.x) == 38 assert d.x[0:5] == pytest.approx([12.5, 17.5, 22.5, 27.5, 32.5]) assert d.y[0:5] == pytest.approx([1529, 2014, 2385, 2158, 2013])
def test_table(self): ui.load_table(1, self.fits) ui.load_table(1, self.fits, 3) ui.load_table(1, self.fits, 3, ["RMID", "SUR_BRI", "SUR_BRI_ERR"]) ui.load_table(1, self.fits, 4, ('R', "SUR_BRI", 'SUR_BRI_ERR'), ui.Data1DInt)
def test_ui_table(setup_files): ui.load_table(1, setup_files.fits) ui.load_table(1, setup_files.fits, 3) ui.load_table(1, setup_files.fits, 3, ["RMID", "SUR_BRI", "SUR_BRI_ERR"]) ui.load_table(1, setup_files.fits, 4, ('R', "SUR_BRI", 'SUR_BRI_ERR'), ui.Data1DInt)
def test_load_table_fits(self): this_dir = os.path.dirname(os.path.abspath(__file__)) ui.load_table(1, os.path.join(this_dir, "data", "two_column_x_y.fits.gz")) data = ui.get_data(1) self.assertEqualWithinTol(data.x, [1, 2, 3]) self.assertEqualWithinTol(data.y, [4, 5, 6])
def test_load_table_fits(self): this_dir = os.path.dirname(os.path.abspath(__file__)) ui.load_table(1, os.path.join(this_dir, 'data', 'two_column_x_y.fits.gz')) data = ui.get_data(1) self.assertEqualWithinTol(data.x, [1, 2, 3]) self.assertEqualWithinTol(data.y, [4, 5, 6])