示例#1
0
def test_trace_vpacket(v_packet, verysimple_numba_model,
                       verysimple_numba_plasma):
    # Set seed because of RNG in trace_vpacket
    np.random.seed(1)

    # Give the vpacket a reasonable line ID
    v_packet_initialize_line_id(v_packet, verysimple_numba_plasma,
                                verysimple_numba_model)

    tau_trace_combined = vpacket.trace_vpacket(v_packet,
                                               verysimple_numba_model,
                                               verysimple_numba_plasma)

    npt.assert_almost_equal(tau_trace_combined, 8164850.891288479)
    npt.assert_almost_equal(v_packet.r, 1286064000000000.0)
    npt.assert_almost_equal(v_packet.nu, 4.0e15)
    npt.assert_almost_equal(v_packet.energy, 0.0)
    npt.assert_almost_equal(v_packet.mu, 0.8309726858508629)
    assert v_packet.next_line_id == 2773
    assert v_packet.current_shell_id == 1
示例#2
0
def test_trace_bad_vpacket(broken_packet, verysimple_numba_model,
                           verysimple_numba_plasma):
    vpacket.trace_vpacket(broken_packet, verysimple_numba_model,
                          verysimple_numba_plasma)