Skip to content

Commit

Permalink
Addressed more comments by reviewer
Browse files Browse the repository at this point in the history
  • Loading branch information
moralejo committed Nov 15, 2024
1 parent eee78fd commit 3770609
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions notebooks/LST1_observation_simulator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -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",
Expand All @@ -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",
"#"
]
},
{
Expand Down Expand Up @@ -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)"
]
},
{
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand All @@ -983,7 +990,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "f3089dde",
"id": "29c63cec",
"metadata": {},
"outputs": [],
"source": []
Expand Down

0 comments on commit 3770609

Please sign in to comment.