{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Example how-to create a signal time PDF" ] }, { "attachments": {}, "cell_type": "raw", "metadata": {}, "source": [ "In this example we demonstrate how to create a signal time PDF with a gaussian shape." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "\n", "from matplotlib import (\n", " pyplot as plt,\n", ")\n", "\n", "from skyllh.core.config import (\n", " Config,\n", ")\n", "from skyllh.core.detsigyield import (\n", " NullDetSigYieldBuilder,\n", ")\n", "from skyllh.core.flux_model import (\n", " GaussianTimeFluxProfile,\n", " NullFluxModel,\n", ")\n", "from skyllh.core.livetime import (\n", " Livetime,\n", ")\n", "from skyllh.core.parameters import (\n", " ParameterModelMapper,\n", ")\n", "from skyllh.core.signalpdf import (\n", " SignalTimePDF,\n", ")\n", "from skyllh.core.source_hypo_grouping import (\n", " SourceHypoGroup,\n", " SourceHypoGroupManager,\n", ")\n", "from skyllh.core.source_model import (\n", " SourceModel,\n", ")\n", "from skyllh.core.storage import (\n", " DataFieldRecordArray,\n", ")\n", "from skyllh.core.trialdata import (\n", " TrialDataManager,\n", ")" ] }, { "attachments": {}, "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "The :py:class:`~skyllh.core.signalpdf.SignalTimePDF` class provides a \n", "generalized time PDF class, which requires a \n", ":py:class:`~skyllh.core.livetime.Livetime` instance and a \n", ":py:class:`~skyllh.core.flux_model.TimeFluxProfile` instance." ] }, { "cell_type": "raw", "metadata": {}, "source": [ "First we need to create a (default) configuration:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "cfg = Config()" ] }, { "attachments": {}, "cell_type": "raw", "metadata": {}, "source": [ "Now let's construct the ``Livetime`` instance with three detector on-time\n", "intervals:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "livetime_data = np.array([\n", " [1, 3], \n", " [4, 7],\n", " [8, 9],\n", " ],\n", " dtype=np.float64)\n", "livetime = Livetime(livetime_data)" ] }, { "attachments": {}, "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "Now we can construct the time flux profile. We choose a gaussian profile. \n", "Other profiles exist as well, e.g. the \n", ":py:class:`~skyllh.core.flux_model.BoxTimeFluxProfile`." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "time_flux_profile = GaussianTimeFluxProfile(t0=4, sigma_t=0.2, cfg=cfg)" ] }, { "attachments": {}, "cell_type": "raw", "metadata": {}, "source": [ "The ``t_start`` and ``t_stop`` properties of the profile tell us how far the \n", "time profile extends: " ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "t_start = 2.5132311244600647\n", "t_stop = 5.486768875539935\n" ] } ], "source": [ "print(f't_start = {time_flux_profile.t_start}')\n", "print(f't_stop = {time_flux_profile.t_stop}')" ] }, { "attachments": {}, "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "Finally, we can construct the :py:class:`~skyllh.core.signalpdf.SignalTimePDF`\n", "instance:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "sigpdf = SignalTimePDF( \n", " livetime=livetime, \n", " time_flux_profile=time_flux_profile,\n", " cfg=cfg)" ] }, { "attachments": {}, "cell_type": "raw", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "In order to evaluate our time PDF, we need to create some SkyLLH framework\n", "infrastructure first. The :py:meth:`~skyllh.core.pdf.PDF.get_pd` method requires\n", "a :py:class:`~skyllh.core.trialdata.TrialDataManager` instance, which we create\n", "now. We initialize the trial data manager with trial data containing the \n", "``time`` values we want to evaluate." ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "raw_mimetype": "text/restructuredtext" }, "outputs": [], "source": [ "shg_mgr = SourceHypoGroupManager(\n", " SourceHypoGroup(\n", " sources=SourceModel(),\n", " fluxmodel=NullFluxModel(),\n", " detsigyield_builders=NullDetSigYieldBuilder())\n", ")\n", "\n", "pmm = ParameterModelMapper(\n", " models=shg_mgr.source_list)\n", "\n", "t = np.linspace(0, 10, int(10/0.05))\n", "events = DataFieldRecordArray(np.array(t, dtype=[('time', np.float64)]))\n", "\n", "tdm = TrialDataManager()\n", "tdm.initialize_trial(\n", " shg_mgr=shg_mgr, \n", " pmm=pmm,\n", " events=events)" ] }, { "attachments": {}, "cell_type": "raw", "metadata": {}, "source": [ "The PDF instance needs to get initialized with the trial data:" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "sigpdf.initialize_for_new_trial(tdm=tdm)" ] }, { "attachments": {}, "cell_type": "raw", "metadata": {}, "source": [ "Now we can evaluate PDF. " ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "(pd, grads) = sigpdf.get_pd(\n", " tdm=tdm, \n", " params_recarray=pmm.create_src_params_recarray())" ] }, { "attachments": {}, "cell_type": "raw", "metadata": {}, "source": [ "We can verify the normalization of the PDF to unity by integrating the \n", "probability density values over time:" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "total integral = 1.0200980782124147\n" ] } ], "source": [ "total_integral = np.sum(pd[1:]*np.diff(t))\n", "print(f'total integral = {total_integral}')" ] }, { "attachments": {}, "cell_type": "raw", "metadata": {}, "source": [ "We can also plot the PDF:" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Text(0, 0.5, 'probability density / time$^{-1}$')" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEGCAYAAAB/+QKOAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEA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deAjyZ1j7MGpabmMxGZjdw8Ei+mK6/sVXS6ZDMsCvp2CKDMyuCE4TZCETEE8DP0sXj/3UEt/g74GOSHgQ20ORL3drY5GGuZmaWyTUIMzPL5ARhZmaZnCDMzCyTE4SZmWVygjAzs0xOEGZmlskJwszMMv0/SwagN10omsoAAAAASUVORK5CYII=", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "fig = plt.figure(figsize=(6, 4))\n", "ax = fig.add_subplot()\n", "ax.plot(t, pd, drawstyle='steps')\n", "ax.set_xlabel('time')\n", "ax.set_ylabel(r'probability density / time$^{-1}$')" ] } ], "metadata": { "kernelspec": { "display_name": ".venv", "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.10.6" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }