{ "cells": [ { "cell_type": "markdown", "id": "89257e22", "metadata": {}, "source": [ "# Kato 2017 Model" ] }, { "cell_type": "code", "execution_count": null, "id": "3434b585", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from astropy import units as u\n", "\n", "# import the snewpy modules\n", "from snewpy.models import presn\n", "from snewpy.flavor_transformation import NoTransformation, AdiabaticMSW\n", "from snewpy.neutrino import Flavor, MixingParameters" ] }, { "cell_type": "code", "execution_count": null, "id": "62b73c22", "metadata": {}, "outputs": [], "source": [ "# set the plot parameters\n", "plt.rc('grid', ls=':')\n", "plt.rc('axes', grid=True)\n", "plt.rc('legend', fontsize=12, loc='upper right')\n", "\n", "# define drawing styles for each flavor\n", "styles = {f: dict(color='C0' if f.is_electron else 'C1',\n", " ls='-' if f.is_neutrino else ':',\n", " label=f.to_tex()) for f in Flavor}" ] }, { "cell_type": "markdown", "id": "212af44c-6498-4a2c-b1e2-4bc98a1e4645", "metadata": {}, "source": [ "## Initialize the model and calculate the flux" ] }, { "cell_type": "code", "execution_count": null, "id": "e56a06b4", "metadata": {}, "outputs": [], "source": [ "# See what progenitors are available …\n", "print(f\"Available progenitors:\\n{presn.Kato_2017.param}\")\n", "\n", "# … and select one of them to initialise the model\n", "model = presn.Kato_2017(progenitor_mass=15*u.Msun)\n", "model" ] }, { "cell_type": "code", "execution_count": null, "id": "b629c538-005d-43c5-b244-bafc9dcb78dd", "metadata": {}, "outputs": [], "source": [ "# Energy array and time to compute spectra.\n", "# Note that any convenient units can be used and the calculation will remain internally consistent.\n", "E = np.linspace(0, 25, 201) * u.MeV\n", "t = np.geomspace(-2*u.day, -1*u.s, 101)\n", "distance = 1*u.kpc" ] }, { "cell_type": "code", "execution_count": null, "id": "4d0a2218-5955-4d20-89ee-f6de8181bb4c", "metadata": {}, "outputs": [], "source": [ "flux = model.get_flux(t, E,\n", " distance=distance,\n", " flavor_xform=NoTransformation())\n", "flux" ] }, { "cell_type": "markdown", "id": "88e8ce95-6705-4282-82c6-ca797234ca2f", "metadata": {}, "source": [ "## Plotting the integral neutrino fluence and rates" ] }, { "cell_type": "markdown", "id": "522e70c0-e6a3-4d5f-9a80-4f970c23d69b", "metadata": {}, "source": [ "### Integral neutrino fluence vs. Energy for the last hour before collapse" ] }, { "cell_type": "code", "execution_count": null, "id": "c2be68b2-bb67-470e-bc01-74e4e48df195", "metadata": {}, "outputs": [], "source": [ "#integrate the flux over the last hour before the collapse\n", "fluence = flux.integrate('time', limits=[-1, 0]<