Esempio n. 1
0
def test_dmfluxmap(jfact):
    emin = 0.1 * u.TeV
    emax = 10 * u.TeV
    massDM = 1 * u.TeV
    channel = "W"

    diff_flux = DarkMatterAnnihilationSpectralModel(mass=massDM,
                                                    channel=channel)
    int_flux = (jfact *
                diff_flux.integral(emin=emin, emax=emax)).to("cm-2 s-1")
    actual = int_flux[5, 5]
    desired = 1.94834138e-12 / u.cm**2 / u.s
    assert_quantity_allclose(actual, desired, rtol=1e-5)
Esempio n. 2
0
def test_DMAnnihilation():
    channel = "b"
    massDM = 5 * u.TeV
    jfactor = 3.41e19 * u.Unit("GeV2 cm-5")
    energy_min = 0.01 * u.TeV
    energy_max = 10 * u.TeV

    model = DarkMatterAnnihilationSpectralModel(
        mass=massDM, channel=channel, jfactor=jfactor
    )
    integral_flux = model.integral(energy_min=energy_min, energy_max=energy_max).to(
        "cm-2 s-1"
    )
    differential_flux = model.evaluate(energy=1 * u.TeV, scale=1).to("cm-2 s-1 TeV-1")

    assert_quantity_allclose(integral_flux.value, 6.19575457e-14, rtol=1e-3)
    assert_quantity_allclose(differential_flux.value, 2.97506768e-16, rtol=1e-3)
Esempio n. 3
0
axes[0].legend()
plt.subplots_adjust(hspace=0.5)


# ## Flux maps
# 
# Finally flux maps can be produced like this:

# In[ ]:


channel = "Z"
massDM = 10 * u.TeV
diff_flux = DarkMatterAnnihilationSpectralModel(mass=massDM, channel=channel)
int_flux = (jfact * diff_flux.integral(emin=0.1 * u.TeV, emax=10 * u.TeV)).to(
    "cm-2 s-1"
)


# In[ ]:


flux_map = WcsNDMap(geom=geom, data=int_flux.value, unit="cm-2 s-1")

fig, ax, im = flux_map.plot(cmap="viridis", norm=LogNorm(), add_cbar=True)
plt.title(
    "Flux [{}]\n m$_{{DM}}$={}, channel={}".format(
        int_flux.unit, fluxes.mDM.to("TeV"), fluxes.channel
    )
);
            ax=ax,
            label=channel,
            flux_unit="1/GeV",
        )

axes[0].legend()
plt.subplots_adjust(hspace=0.5)

# ## Flux maps
#
# Finally flux maps can be produced like this:

# In[11]:

channel = "Z"
massDM = 10 * u.TeV
diff_flux = DarkMatterAnnihilationSpectralModel(mass=massDM, channel=channel)
int_flux = (jfact * diff_flux.integral(energy_min=0.1 * u.TeV,
                                       energy_max=10 * u.TeV)).to("cm-2 s-1")

# In[12]:

flux_map = WcsNDMap(geom=geom, data=int_flux.value, unit="cm-2 s-1")

fig, ax, im = flux_map.plot(cmap="viridis", norm=LogNorm(), add_cbar=True)
plt.title(
    f"Flux [{int_flux.unit}]\n m$_{{DM}}$={fluxes.mDM.to('TeV')}, channel={fluxes.channel}"
)

# In[ ]: