def test_atom_weight_channel2(): xs_cache['E_g'] = np.logspace(-6, 1, 10)[::-1] exp = (sigma_t('H1') * 2.0 + sigma_t('O16')) / 3.0 # Test dict nucspec = {'H1': 2.0, 'O16': 1.0} obs = _atom_mass_channel(sigma_t, nucspec) assert_array_almost_equal(obs, exp) # Test list of tuples nucspec = [('H1', 2.0), ('O16', 1.0)] obs = _atom_mass_channel(sigma_t, nucspec) assert_array_equal(obs, exp) # test material h2o = Material({10010000: 0.11191487328808077, 80160000: 0.8880851267119192}) obs = _atom_mass_channel(sigma_t, h2o) assert_array_almost_equal(obs, exp)
def test_atom_weight_channel2(): xs_cache["E_g"] = np.logspace(-6, 1, 10)[::-1] exp = (sigma_t("H1") * 2.0 + sigma_t("O16")) / 3.0 # Test dict nucspec = {"H1": 2.0, "O16": 1.0} obs = _atom_mass_channel(sigma_t, nucspec) assert_array_almost_equal(obs, exp) # Test list of tuples nucspec = [("H1", 2.0), ("O16", 1.0)] obs = _atom_mass_channel(sigma_t, nucspec) assert_array_equal(obs, exp) # test material h2o = Material({10010000: 0.11191487328808077, 80160000: 0.8880851267119192}) obs = _atom_mass_channel(sigma_t, h2o) assert_array_almost_equal(obs, exp)
def test_atom_weight_channel2(): xs_cache["E_g"] = np.logspace(-6, 1, 10)[::-1] exp = (sigma_t("H1") * 2.0 + sigma_t("O16")) / 3.0 # Test dict nucspec = {"H1": 2.0, "O16": 1.0} obs = _atom_mass_channel(sigma_t, nucspec) assert_array_almost_equal(obs, exp) # Test list of tuples nucspec = [("H1", 2.0), ("O16", 1.0)] obs = _atom_mass_channel(sigma_t, nucspec) assert_array_equal(obs, exp) # test material h2o = Material({10010000: 0.11191487328888054, 80160000: 0.8880851267111195}) obs = _atom_mass_channel(sigma_t, h2o) assert_array_almost_equal(obs, exp)
def test_atom_weight_channel2(): xs_cache['E_g'] = np.logspace(-6, 1, 10)[::-1] exp = (sigma_t('H1') * 2.0 + sigma_t('O16')) / 3.0 # Test dict nucspec = {'H1': 2.0, 'O16': 1.0} obs = _atom_weight_channel(sigma_t, nucspec) assert_array_almost_equal(obs, exp) # Test list of tuples nucspec = [('H1', 2.0), ('O16', 1.0)] obs = _atom_weight_channel(sigma_t, nucspec) assert_array_equal(obs, exp) # test material h2o = Material({10010: 0.11191487328808077, 80160: 0.8880851267119192}) obs = _atom_weight_channel(sigma_t, h2o) assert_array_almost_equal(obs, exp)
def test_sigma_t(): E_g = np.array([10.0, 7.5, 5.0, 2.5, 0.1]) sig_t = sigma_t("U238", 600.0, E_g) observed = (0.0 <= sig_t).all() assert_true(observed) expected = sigma_a("U238", 600.0, E_g) + sigma_s("U238", 600.0, E_g) assert_array_almost_equal(sig_t, expected) sig_t = sigma_t("U238", 600.0, E_g) observed = (0.0 <= sig_t).all() assert_true(observed) expected = sigma_a("U238", 600.0, E_g) + sigma_s("U238", 600.0, E_g) assert_array_almost_equal(sig_t, expected) sig_t = sigma_t("U235") observed = (0.0 <= sig_t).all() assert_true(observed) expected = sigma_a("U235", 600.0) + sigma_s("U235", 600.0, E_g) assert_array_almost_equal(sig_t, expected)
def test_sigma_t(): E_g = np.array([10.0, 7.5, 5.0, 2.5, 0.1]) sig_t = sigma_t('U238', 600.0, E_g) observed = (0.0 <= sig_t).all() assert_true(observed) expected = sigma_a('U238', 600.0, E_g) + sigma_s('U238', 600.0, E_g) assert_array_almost_equal(sig_t, expected) sig_t = sigma_t('U238', 600.0, E_g) observed = (0.0 <= sig_t).all() assert_true(observed) expected = sigma_a('U238', 600.0, E_g) + sigma_s('U238', 600.0, E_g) assert_array_almost_equal(sig_t, expected) sig_t = sigma_t('U235') observed = (0.0 <= sig_t).all() assert_true(observed) expected = sigma_a('U235', 600.0) + sigma_s('U235', 600.0, E_g) assert_array_almost_equal(sig_t, expected)
def test_sigma_t(): E_g = np.array([10.0, 7.5, 5.0, 2.5, 0.1]) E_n = xs_cache['E_n'] phi_n = np.ones(len(E_n) - 1) sig_t = sigma_t('U238', 600.0, E_g, E_n, phi_n) observed = (0.0 <= sig_t).all() assert_true(observed) expected = sigma_a('U238', E_g, E_n, phi_n) + sigma_s('U238', 600.0, E_g, E_n, phi_n) assert_array_almost_equal(sig_t, expected) sig_t = sigma_t('U238', 600.0, E_g, E_n, phi_n) observed = (0.0 <= sig_t).all() assert_true(observed) expected = sigma_a('U238', E_g, E_n, phi_n) + sigma_s('U238', 600.0, E_g, E_n, phi_n) assert_array_almost_equal(sig_t, expected) sig_t = sigma_t('U235') observed = (0.0 <= sig_t).all() assert_true(observed) expected = sigma_a('U235') + sigma_s('U235', 600.0, E_g, E_n, phi_n) assert_array_almost_equal(sig_t, expected)