diff --git a/recipes/background-model/env.yml b/recipes/background-model/env.yml index 5b73b93..014365b 100644 --- a/recipes/background-model/env.yml +++ b/recipes/background-model/env.yml @@ -6,7 +6,8 @@ channels: - conda-forge dependencies: - - gammapy=1.0.1 + - gammapy=1.0.2 - python=3.9 + - scipy<1.12 - jupyter - matplotlib diff --git a/recipes/dark-matter-utilities/astro_dark_matter.ipynb b/recipes/dark-matter-utilities/astro_dark_matter.ipynb index 78eead4..53b3cd1 100644 --- a/recipes/dark-matter-utilities/astro_dark_matter.ipynb +++ b/recipes/dark-matter-utilities/astro_dark_matter.ipynb @@ -136,22 +136,19 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [ - "nbsphinx-thumbnail" - ] - }, + "metadata": {}, "outputs": [], "source": [ "jfact_map = WcsNDMap(geom=geom, data=jfact.value, unit=jfact.unit)\n", - "fig, ax, im = jfact_map.plot(cmap=\"viridis\", norm=LogNorm(), add_cbar=True)\n", - "plt.title(f\"J-Factor [{jfact_map.unit}]\")\n", + "ax = jfact_map.plot(cmap=\"viridis\", norm=LogNorm(), add_cbar=True)\n", + "ax.set_title(f\"J-Factor [{jfact_map.unit}]\")\n", "\n", "# 1 deg circle usually used in H.E.S.S. analyses\n", "sky_reg = CircleSkyRegion(center=position, radius=1 * u.deg)\n", - "pix_reg = sky_reg.to_pixel(wcs=geom.wcs)\n", + "pix_reg = sky_reg.to_pixel(wcs=ax.wcs)\n", "pix_reg.plot(ax=ax, facecolor=\"none\", edgecolor=\"red\", label=\"1 deg circle\")\n", - "plt.legend()" + "ax.legend()\n", + "plt.show()" ] }, { @@ -190,10 +187,12 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "scrolled": false + }, "outputs": [], "source": [ - "fig, axes = plt.subplots(4, 1, figsize=(6, 16))\n", + "fig, axes = plt.subplots(4, 1, figsize=(6, 18))\n", "mDMs = [0.01, 0.1, 1, 10] * u.TeV\n", "\n", "for mDM, ax in zip(mDMs, axes):\n", @@ -201,18 +200,18 @@ " ax.set_title(rf\"m$_{{\\mathrm{{DM}}}}$ = {mDM}\")\n", " ax.set_yscale(\"log\")\n", " ax.set_ylabel(\"dN/dE\")\n", + " ax.yaxis.set_units(u.Unit(\"GeV-1\"))\n", "\n", " for channel in [\"tau\", \"mu\", \"b\", \"Z\"]:\n", " fluxes.channel = channel\n", " fluxes.table_model.plot(\n", - " energy_range=[mDM / 100, mDM],\n", + " energy_bounds=[mDM / 100, mDM],\n", " ax=ax,\n", " label=channel,\n", - " flux_unit=\"1/GeV\",\n", " )\n", "\n", "axes[0].legend()\n", - "plt.subplots_adjust(hspace=0.5)" + "plt.subplots_adjust(hspace=0.3)" ] }, { @@ -246,10 +245,11 @@ "source": [ "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", + "ax = flux_map.plot(cmap=\"viridis\", norm=LogNorm(), add_cbar=True)\n", + "ax.set_title(\n", " f\"Flux [{int_flux.unit}]\\n m$_{{DM}}$={fluxes.mDM.to('TeV')}, channel={fluxes.channel}\"\n", - ");" + ")\n", + "plt.show()" ] }, { @@ -262,7 +262,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -276,10 +276,10 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.0" + "version": "3.10.14" }, "toc": { - "base_numbering": 1.0, + "base_numbering": 1, "nav_menu": {}, "number_sections": false, "sideBar": true, diff --git a/recipes/dark-matter-utilities/env.yml b/recipes/dark-matter-utilities/env.yml index a799368..f6d48aa 100644 --- a/recipes/dark-matter-utilities/env.yml +++ b/recipes/dark-matter-utilities/env.yml @@ -1,18 +1,12 @@ # Declare your specific environment -name: gammapy-recipes +name: gp-dark-matter channels: - conda-forge - - sherpa dependencies: - - gammapy=0.18.2 - - python=3.7 - - jupyter=1.0 - - matplotlib=3.3 - - healpy=1.13 - - reproject=0.7 - - sherpa=4.12 - - iminuit=1.5 - - pandas=1.1 + - gammapy=1.0.2 + - python=3.9 + - scipy<1.12 + - jupyter diff --git a/recipes/interactive-model-editing/env.yml b/recipes/interactive-model-editing/env.yml index 4e3413e..2206bb2 100644 --- a/recipes/interactive-model-editing/env.yml +++ b/recipes/interactive-model-editing/env.yml @@ -1,14 +1,16 @@ # Declare your specific environment -name: gammapy-recipes +name: gp-interactive-model channels: - conda-forge dependencies: - - gammapy=0.19 - - python=3.7 - - jupyter>=1.0 + - gammapy=1.0.2 + - python=3.9 + - jupyter + - jupyterlab<=3.5.3 + - scipy<1.12 - astropy>=4.0 - pandas>=1.1 - qgrid=1.3.1 diff --git a/recipes/mcmc-sampling-emcee/env.yml b/recipes/mcmc-sampling-emcee/env.yml index ff2709c..c1b52a8 100644 --- a/recipes/mcmc-sampling-emcee/env.yml +++ b/recipes/mcmc-sampling-emcee/env.yml @@ -1,20 +1,14 @@ # Declare your specific environment -name: gammapy-recipes +name: gp-mcmc channels: - conda-forge - - sherpa dependencies: - - gammapy=0.18.1 - - python=3.7 - - jupyter=1.0 - - matplotlib=3.3 - - healpy=1.13 - - reproject=0.7 - - sherpa=4.12 - - iminuit=1.5 - - pandas=1.1 + - gammapy=1.0.2 + - python=3.9 + - jupyter + - scipy<1.12 - emcee=2.2.1 - corner=2.1 diff --git a/recipes/mcmc-sampling-emcee/mcmc_sampling.ipynb b/recipes/mcmc-sampling-emcee/mcmc_sampling.ipynb index a4f5dc0..e49bcb3 100644 --- a/recipes/mcmc-sampling-emcee/mcmc_sampling.ipynb +++ b/recipes/mcmc-sampling-emcee/mcmc_sampling.ipynb @@ -310,7 +310,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "scrolled": true + "scrolled": false }, "outputs": [], "source": [ @@ -359,7 +359,7 @@ " spectral_model = dataset.models[\"source\"].spectral_model\n", "\n", " spectral_model.plot(\n", - " energy_range=(emin, emax),\n", + " energy_bounds=(emin, emax),\n", " ax=ax,\n", " energy_power=2,\n", " alpha=0.02,\n", @@ -368,7 +368,7 @@ "\n", "\n", "sky_model_simu.spectral_model.plot(\n", - " energy_range=(emin, emax), energy_power=2, ax=ax, color=\"red\"\n", + " energy_bounds=(emin, emax), energy_power=2, ax=ax, color=\"red\"\n", ");" ] }, @@ -426,11 +426,18 @@ "# plot_trace(sampler, dataset)\n", "# plot_corner(sampler, dataset, nburn=200)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -444,7 +451,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.0" + "version": "3.10.14" } }, "nbformat": 4,