Fix dark matter notebook
" profiles,\n",
" JFactory,\n",
" PrimaryFlux,\n",
- " compute_dm_flux,\n",
+ " DMAnnihilModel,\n",
")\n",
"\n",
"from gammapy.maps import WcsGeom, WcsNDMap\n",
"metadata": {},
"outputs": [],
"source": [
- "flux = compute_dm_flux(\n",
- " jfact=jfact,\n",
- " prim_flux=fluxes,\n",
- " x_section=\"1e-26 cm3s-1\",\n",
- " energy_range=[0.1, 10] * u.TeV,\n",
+ "channel = \"Z\"\n",
+ "massDM = 10 * u.TeV\n",
+ "diff_flux = DMAnnihilModel(mass=massDM, channel=channel)\n",
+ "int_flux = (jfact * diff_flux.integral(emin=0.1 * u.TeV, emax=10 * u.TeV)).to(\n",
+ " \"cm-2 s-1\"\n",
")"
]
},
"metadata": {},
"outputs": [],
"source": [
- "flux_map = WcsNDMap(geom=geom, data=flux.value, unit=flux.unit)\n",
+ "flux_map = WcsNDMap(geom=geom, data=int_flux.value, unit=\"cm-2 s-1\")\n",
"\n",
"fig, ax, im = flux_map.plot(cmap=\"viridis\", norm=LogNorm(), add_cbar=True)\n",
"plt.title(\n",
" \"Flux [{}]\\n m$_{{DM}}$={}, channel={}\".format(\n",
- " flux_map.unit, fluxes.mDM.to(\"TeV\"), fluxes.channel\n",
+ " int_flux.unit, fluxes.mDM.to(\"TeV\"), fluxes.channel\n",
" )\n",
");"
]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
}
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3",
+ "display_name": "gammapy-dev",
"language": "python",
- "name": "python3"
+ "name": "gammapy-dev"
},
"language_info": {
"codemirror_mode": {
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.0"
+ },
+ "toc": {
+ "base_numbering": 1,
+ "nav_menu": {},
+ "number_sections": false,
+ "sideBar": true,
+ "skip_h1_title": false,
+ "title_cell": "Table of Contents",
+ "title_sidebar": "Contents",
+ "toc_cell": false,
+ "toc_position": {},
+ "toc_section_display": true,
+ "toc_window_display": false
}
},
"nbformat": 4,
