Skip to content

Commit

Permalink
Addressed reviewer's comments, several small changes for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
moralejo committed Nov 24, 2023
1 parent 9018718 commit 9484b0f
Showing 1 changed file with 17 additions and 27 deletions.
44 changes: 17 additions & 27 deletions notebooks/calculate_sensitivity_from_Crab.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
"from ctapipe_io_lst import LSTEventSource\n",
"from ctapipe.io import read_table\n",
"\n",
"%matplotlib inline\n",
"\n",
"#%load_ext filprofiler"
"%matplotlib inline"
]
},
{
Expand Down Expand Up @@ -99,8 +97,8 @@
"# Assumed (effective) observation time for the calculation (note: it has nothing to do with \n",
"# the actual observation time of the sample used for the calculation!):\n",
"obs_time = 50 * u.h \n",
"# obs_time = 1/60. * u.h # 1 minute\n",
"# obs_time = 0.083333333 * u.h # 5 minutes\n",
"# obs_time = 1 * u.min\n",
"# obs_time = 5 * u.min\n",
"# obs_time = 0.5 * u.h\n",
"# obs_time = 0.7 * u.h\n",
"# obs_time = 5 * u.h\n",
Expand Down Expand Up @@ -133,9 +131,16 @@
"# We separate them so that we can optimize the cuts in one and apply them to \n",
"# the other (and vice versa)\n",
"\n",
"# For source-independent analysis we will use one off region up to 250 GeV. \n",
"# Background estimation:\n",
"# For source-independent analysis, we will use one off region up to 250 GeV. \n",
"# Three off regions for higher energies:\n",
"first_ebin_with_3offs = 7 # i.e. from ~250 GeV onwards\n",
"# NOTE! This is just what is used to *estimate* the average background in the on-region. \n",
"# For the actual computation of sensitivity, in order to follow the standard definition, \n",
"# we use (Li & Ma's) alpha = 0.2 (define in the cell above), i.e. we assume we can compute \n",
"# the background in a region 5 times larger than the on-region. In practice it is somehow \n",
"# optimistic for a standalone telescope like LST-1, with its limited angular resolution.\n",
"#\n",
"\n",
"# Intensity cuts:\n",
"min_intensity = 50\n",
Expand Down Expand Up @@ -182,24 +187,16 @@
"norm_range = np.array([[0.1, 0.16], [20., 59.8]]) # deg2 for theta2, deg for Alpha"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9574f30b",
"metadata": {},
"outputs": [],
"source": [
"sa = LSTEventSource.create_subarray(tel_id=1)\n",
"focal = sa.tel[1].optics.effective_focal_length"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "54cf3f44",
"metadata": {},
"outputs": [],
"source": [
"sa = LSTEventSource.create_subarray(tel_id=1)\n",
"focal = sa.tel[1].optics.effective_focal_length\n",
"\n",
"# The source position src_x, src_y (in m), stored in \"source_position\", is calculated by \n",
"# lstchain_dl2_add_sourcepos.py using the effective focal length (29.30565 m), which means \n",
"# that it is \"consistent\" with the reco values reco_src_x, reco_src_y (which are affected \n",
Expand Down Expand Up @@ -236,8 +233,6 @@
},
"outputs": [],
"source": [
"#%%filprofile\n",
"\n",
"tablename = \"/dl2/event/telescope/parameters/LST_LSTCam\"\n",
"livetimes = []\n",
"\n",
Expand Down Expand Up @@ -350,7 +345,6 @@
},
"outputs": [],
"source": [
"#%%filprofile\n",
"# Columns to be kept in the case of source-dependent analysis (again, so save memory):\n",
"\n",
"columns_srcdep = [\"('on', 'expected_src_x')\",\n",
Expand Down Expand Up @@ -502,8 +496,6 @@
},
"outputs": [],
"source": [
"#%%filprofile\n",
"\n",
"# Obtain the cumulative histograms: integrate in gammaness and in theta (or alpha).\n",
"\n",
"for evtid in range(cum_on_events[0].shape[0]):\n",
Expand Down Expand Up @@ -685,7 +677,7 @@
"source": [
"#################################################################################################\n",
"# #\n",
"# SECOND PART OF THE NOTEBOOK!!! RUN FROM HERE OF YOU JUST WANT TO RE-RUN THE CUT OPTIMIZATION #\n",
"# SECOND PART OF THE NOTEBOOK!!! RUN FROM HERE IF YOU JUST WANT TO RE-RUN THE CUT OPTIMIZATION #\n",
"# USING THE SAME DATA SAMPLES! #\n",
"# #\n",
"##################################################################################################"
Expand Down Expand Up @@ -715,8 +707,8 @@
"# Assumed (effective) observation time for the calculation (note: it has nothing to do with \n",
"# the actual observation time of the sample used for the calculation!):\n",
"# obs_time = 50 * u.h \n",
"# obs_time = 1/60. * u.h # 1 minute\n",
"# obs_time = 0.083333333 * u.h # 5 minutes\n",
"# obs_time = 1 * u.min\n",
"# obs_time = 5 * u.min\n",
"# obs_time = 0.5 * u.h\n",
"# obs_time = 0.7 * u.h\n",
"# obs_time = 5 * u.h\n",
Expand Down Expand Up @@ -849,8 +841,6 @@
"metadata": {},
"outputs": [],
"source": [
"#%%filprofile\n",
"\n",
"lima_signi = [[], []]\n",
"flux_for_5_sigma = [[], []]\n",
"\n",
Expand Down

0 comments on commit 9484b0f

Please sign in to comment.