From 377060993addf17d38aa79f6e2306beb8d1b4d7f Mon Sep 17 00:00:00 2001 From: Abelardo Moralejo Olaizola Date: Fri, 15 Nov 2024 15:39:08 +0100 Subject: [PATCH] Addressed more comments by reviewer --- notebooks/LST1_observation_simulator.ipynb | 25 ++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/notebooks/LST1_observation_simulator.ipynb b/notebooks/LST1_observation_simulator.ipynb index 919ab3748..6afcba744 100644 --- a/notebooks/LST1_observation_simulator.ipynb +++ b/notebooks/LST1_observation_simulator.ipynb @@ -20,7 +20,7 @@ "from scipy.stats import moyal, norm, skewnorm\n", "from pathlib import Path\n", "from lstchain.io.io import get_resource_path\n", - "from lstchain import version" + "from lstchain.version import version as lstchain_version" ] }, { @@ -271,8 +271,14 @@ "# We will apply the Dominguez EBL model to simulate the absorption\n", "\n", "dominguez_ebl_file = get_resource_path(f'data/ebl_dominguez11.fits.gz')\n", - "dominguez = EBLAbsorptionNormSpectralModel.read(dominguez_ebl_file, redshift=redshift)\n", + "ebl_model = EBLAbsorptionNormSpectralModel.read(dominguez_ebl_file, redshift=redshift)\n", "\n", + "\n", + "###############################################################################################\n", + "#\n", + "# In case you want to use other EBL models available in gammapy (e.g. Franceschini) you can try \n", + "# the lines below: \n", + "#\n", "# Make sure we have the necessary EBL absorption data:\n", "# try:\n", "# os.environ['GAMMAPY_DATA']\n", @@ -286,9 +292,10 @@ "# gammapy_data = ebl_file[:ebl_file.find('/ebl/')]\n", "# os.environ['GAMMAPY_DATA'] = gammapy_data\n", "# print('Set GAMMAPY_DATA to', gammapy_data)\n", - "\n", - "\n", - "# dominguez = EBLAbsorptionNormSpectralModel.read_builtin(\"dominguez\", redshift=redshift)" + "#\n", + "#\n", + "# ebl_model = EBLAbsorptionNormSpectralModel.read_builtin(\"franceschini\", redshift=redshift)\n", + "#" ] }, { @@ -353,7 +360,7 @@ "source": [ "# After EBL absorption:\n", "def dFdE(E):\n", - " return intrinsic_dFdE(E) * dominguez.evaluate(E, redshift, 1)" + " return intrinsic_dFdE(E) * ebl_model.evaluate(E, redshift, 1)" ] }, { @@ -933,7 +940,7 @@ " str += '\\nPoint-like source'\n", " else:\n", " str += f'\\nSource radius: {source_radius:.2f}$^\\\\circ$ ({cut_efficiency:.0%} containment)'\n", - " str += f'\\n\\ncta-lstchain {version.version}'\n", + " str += f'\\n\\ncta-lstchain {lstchain_version}'\n", " \n", " ax.text(0.05, 0.38, str, \n", " transform=ax.transAxes, fontsize=12, verticalalignment='top',\n", @@ -974,7 +981,7 @@ }, { "cell_type": "markdown", - "id": "c927ed19", + "id": "d56d43a4", "metadata": {}, "source": [ "### NOTE: in reality, other systematics from data-MC discrepancies (in Aeff, energy-dependent) may make the point-to point fluctuations larger than shown above. Systematic errors of around a few percent (independent in each bin) are to be expected.\n" @@ -983,7 +990,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f3089dde", + "id": "29c63cec", "metadata": {}, "outputs": [], "source": []