{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Bugli 2021 Models\n", "\n", "Data from M. Bugli et al., with permission for use in SNEWS2.0.\n", "\n", "Reference: M. Bugli, J. Guilet and M. Obergaulin, \"Three-dimensional core-collapse supernovae with complex magnetic structures: I. Explosion dynamics\", MNRAS 507 (2021) 1\n", "- https://doi.org/10.1093/mnras/stab2161\n", "- https://arxiv.org/abs/2105.00665" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "\n", "from snewpy.neutrino import Flavor\n", "from snewpy.models.ccsn import Bugli_2021\n", "\n", "mpl.rc('font', size=16)\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Initialize Models\n", "\n", "To start, let’s see what progenitors are available for the `Bugli_2021` model. We can use the `param` property to view all physics parameters and their possible values:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Bugli_2021.param" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We’ll initialise both of these progenitors. If this is the first time you’re using a progenitor, snewpy will automatically download the required data files for you." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "mhydro = Bugli_2021(Bfield='hydro',direction='average') \n", "mL1 = Bugli_2021(Bfield='L1',direction='average',rotation=90)\n", "mL2 = Bugli_2021(Bfield='L2',direction='average',grav='A')\n", "\n", "mL1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Finally, let’s plot the luminosity of different neutrino flavors for this model." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "fig, axes = plt.subplots(1, 3, figsize=(12, 5), sharex=True, sharey=True, tight_layout=True)\n", "\n", "for i, flavor in enumerate(Flavor):\n", " if i>2:\n", " continue\n", " ax = axes[i]\n", " for model in [mhydro,mL1, mL2]:\n", " ax.plot(model.time, model.luminosity[flavor]/1e51, # Report luminosity in units foe/s\n", " label = model.metadata['Bfield'],\n", " lw=2)\n", " ax.set(xlim=(0.0, 0.5),\n", " xlabel=r'$t-t_{\\rm bounce}$ [s]',\n", " title= flavor.to_tex())\n", " ax.grid()\n", " ax.legend(loc='upper right', ncol=1, fontsize=18)\n", "\n", "axes[0].set(ylabel=r'luminosity [foe s$^{-1}$]');" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.3" }, "vscode": { "interpreter": { "hash": "e2528887d751495e023d57d695389d9a04f4c4d2e5866aaf6dc03a1ed45c573e" } } }, "nbformat": 4, "nbformat_minor": 4 }