{ "cells": [ { "cell_type": "markdown", "id": "3fab591f", "metadata": {}, "source": [ "# Yoshida 2016 Model" ] }, { "cell_type": "code", "execution_count": null, "id": "83d2d170-a5b3-44d9-ad05-762448b08c80", "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": "f2ad86ec-ff7e-4ef6-818e-f244ac8112f4", "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={'E':'C0','MU':'C1','TAU':'C2'}[f.lepton],\n", " ls='-' if f.is_neutrino else ':',\n", " label=f.to_tex()) for f in Flavor}" ] }, { "cell_type": "markdown", "id": "4f1b6439-6702-417a-a9b6-0ca0d5798f47", "metadata": {}, "source": [ "## Initialize the model and calculate the flux" ] }, { "cell_type": "code", "execution_count": null, "id": "ffff2732-a87a-401c-b85d-a0f0d5598657", "metadata": {}, "outputs": [], "source": [ "# See what progenitors are available …\n", "print(f\"Available progenitors:\\n{presn.Yoshida_2016.param}\")\n", "\n", "# … and select one of them to initialise the model\n", "model = presn.Yoshida_2016(progenitor_mass=15*u.Msun)\n", "model" ] }, { "cell_type": "code", "execution_count": null, "id": "4d8e7b15-0a7e-49f3-b6bd-9463e8b371a5", "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": "efb466d7-1b4c-4949-a983-5134fba3f35b", "metadata": {}, "outputs": [], "source": [ "flux = model.get_flux(t, E,\n", " distance=distance,\n", " flavor_xform=NoTransformation())\n", "flux" ] }, { "cell_type": "markdown", "id": "f06fc5ed-e39f-4f91-a8c6-09a671a7f6d0", "metadata": {}, "source": [ "## Plotting the integral neutrino fluence and rates" ] }, { "cell_type": "markdown", "id": "34cd5637-201f-493c-9aa8-10a653d4158b", "metadata": {}, "source": [ "### Integral neutrino fluence vs. Energy for the last hour before collapse" ] }, { "cell_type": "code", "execution_count": null, "id": "4f8f5b53-257d-43b7-b933-415738e8b4a1", "metadata": {}, "outputs": [], "source": [ "#integrate the flux over the last hour before the collapse\n", "fluence = flux.integrate('time', limits=[-1, 0]<