{ "cells": [ { "cell_type": "markdown", "id": "b073b654", "metadata": {}, "source": [ "# Odrzywolek 2010 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": "b0855f1d-17f6-43f5-b4ab-e5d6c109953b", "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.Odrzywolek_2010.param}\")\n", "\n", "# … and select one of them to initialise the model\n", "model = presn.Odrzywolek_2010(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": "b721815e-78eb-47bf-9e55-d2c3b0e28e27", "metadata": {}, "source": [ "## Plotting the integral neutrino fluence and rates" ] }, { "cell_type": "markdown", "id": "53fdc99a-0614-4cce-941e-502a668cb63d", "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]<