def test_jet(plot=True):
    #print('--------> plot',plot)
    from jetset.jet_model import Jet
    j = Jet()
    j.eval()
    j.energetic_report()

    if plot is True:
        j.plot_model()
        j.emitters_distribution.plot()
        j.emitters_distribution.plot2p()
        j.emitters_distribution.plot3p()
        j.emitters_distribution.plot3p(energy_unit='eV')
        j.emitters_distribution.plot3p(energy_unit='erg')
    j.save_model('test_jet.pkl')
    j_new = Jet.load_model('test_jet.pkl')
示例#2
0
def test_jet(plot=True):
    print('--------> test_jet', plot)
    from jetset.jet_model import Jet
    j = Jet()
    j.eval()
    j.energetic_report()
    sum1 = j.spectral_components.Sum.SED.nuFnu
    if plot is True:
        j.plot_model()
        j.emitters_distribution.plot()
        j.emitters_distribution.plot2p()
        j.emitters_distribution.plot3p()
        j.emitters_distribution.plot3p(energy_unit='eV')
        j.emitters_distribution.plot3p(energy_unit='erg')
    j.save_model('test_jet.pkl')
    j_new = Jet.load_model('test_jet.pkl')
    j_new.eval()
    sum2 = j_new.spectral_components.Sum.SED.nuFnu
    np.testing.assert_allclose(sum2, sum1, rtol=1E-5)
示例#3
0
def test_my_foo():
    from jetset.plot_sedfit import plt
    plt.ioff()
    j = Jet()
    j.eval()
    j.energetic_report()
示例#4
0
def test_jet():
    from jetset.jet_model import Jet
    j = Jet()
    j.eval()
    j.energetic_report()