def test_verysimple_single_packet_loop(
    verysimple_numba_model,
    verysimple_numba_plasma,
    verysimple_estimators,
    verysimple_vpacket_collection,
    verysimple_packet_collection,
):
    packet_collection = verysimple_packet_collection
    vpacket_collection = verysimple_vpacket_collection
    numba_model = verysimple_numba_model
    numba_plasma = verysimple_numba_plasma
    numba_estimators = verysimple_estimators

    i = 0
    r_packet = RPacket(
        verysimple_numba_model.r_inner[0],
        packet_collection.packets_input_mu[i],
        packet_collection.packets_input_nu[i],
        packet_collection.packets_input_energy[i],
        i,
    )
    single_packet_loop(
        r_packet,
        numba_model,
        numba_plasma,
        numba_estimators,
        vpacket_collection,
    )

    npt.assert_almost_equal(r_packet.nu, 1053057938883272.8)
    npt.assert_almost_equal(r_packet.mu, 0.9611146425440562)
    npt.assert_almost_equal(r_packet.energy, 0.10327717505563379)
Exemple #2
0
def static_packet():
    return RPacket(
        r=7.5e14,
        nu=0.4,
        mu=0.3,
        energy=0.9,
        seed=1963,
        index=0,
    )
Exemple #3
0
def packet(verysimple_packet_collection):
    return RPacket(
        r=7.5e14,
        nu=verysimple_packet_collection.packets_input_nu[0],
        mu=verysimple_packet_collection.packets_input_mu[0],
        energy=verysimple_packet_collection.packets_input_energy[0],
        seed=1963,
        index=0,
    )