Example #1
0
def test_rmf_get_x_unit():
    session = Session()
    rmf_x_lo, rmf_x_hi = np.array([21.0, 21.1, 21.2]), np.array([21.1, 21.2, 21.3])
    rmf = session.create_rmf(rmf_x_lo, rmf_x_hi)
    expected_rmf_x = (rmf_x_hi + rmf_x_lo)/2
    actual_rmf_x = rmf.get_x()
    np.testing.assert_array_almost_equal(expected_rmf_x, actual_rmf_x)
Example #2
0
def test_rmf_get_x_unit():
    session = Session()
    rmf_x_lo, rmf_x_hi = np.array([21.0, 21.1,
                                   21.2]), np.array([21.1, 21.2, 21.3])
    rmf = session.create_rmf(rmf_x_lo, rmf_x_hi)
    expected_rmf_x = (rmf_x_hi + rmf_x_lo) / 2
    actual_rmf_x = rmf.get_x()
    np.testing.assert_array_almost_equal(expected_rmf_x, actual_rmf_x)
def test_create_rmf(make_data_path):
    from sherpa.astro.ui.utils import Session
    ui = Session()
    energ = np.arange(0.05, 1.1, 0.05)
    rmflo = energ[:-1]
    rmfhi = energ[1:]
    fname = make_data_path('test_rmfimg.fits')
    datarmf = ui.create_rmf(rmflo, rmfhi, fname=fname)
    assert len(datarmf._fch) == 1039
    assert len(datarmf._nch) == 1039
    assert len(datarmf.n_grp) == 900
    assert datarmf._rsp.shape[0] == 380384
Example #4
0
def test_create_rmf(make_data_path):
    from sherpa.astro.ui.utils import Session
    ui = Session()
    energ = np.arange(0.05, 1.1, 0.05)
    rmflo = energ[:-1]
    rmfhi = energ[1:]
    fname= make_data_path('test_rmfimg.fits')
    datarmf = ui.create_rmf(rmflo, rmfhi, fname=fname)
    assert len(datarmf._fch) == 1039
    assert len(datarmf._nch) == 1039
    assert len(datarmf.n_grp) == 900
    assert datarmf._rsp.shape[0] == 380384