Skip to content

Commit a402ef7

Browse files
committed
update to ctapipe v0.8.0
1 parent 780d1f5 commit a402ef7

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

Benchmarks/DL1/integrated_distribution.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@
285285
"name": "python",
286286
"nbconvert_exporter": "python",
287287
"pygments_lexer": "ipython3",
288-
"version": "3.7.3"
288+
"version": "3.7.6"
289289
},
290290
"nteract": {
291291
"version": "0.12.3"

Preparation/integration_prep.ipynb

+9-8
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"from ctapipe.calib import CameraCalibrator\n",
2626
"from ctapipe.visualization import CameraDisplay\n",
2727
"from ctapipe.io import HDF5TableWriter\n",
28-
"from ctapipe.io.containers import Container, Field\n",
28+
"from ctapipe.containers import Container, Field\n",
2929
"from ctabench import tel_to_impact_point_distance\n",
3030
"from ctapipe.image.extractor import GlobalPeakWindowSum, NeighborPeakWindowSum, FullWaveformSum\n",
3131
"from ctapipe.calib.camera.gainselection import ThresholdGainSelector"
@@ -109,20 +109,21 @@
109109
" print(integrator) \n",
110110
" with HDF5TableWriter(output_filename, group_name=integrator, mode='a', add_prefix=True) as h5_table:\n",
111111
"\n",
112-
" cal = CameraCalibrator(image_extractor=globals()[integrator](), \n",
113-
" gain_selector=ThresholdGainSelector(threshold=4094))\n",
112+
" cal = CameraCalibrator(source.subarray,\n",
113+
" image_extractor=globals()[integrator](source.subarray), \n",
114+
" )\n",
114115
"\n",
115116
" for event in source:\n",
116117
" cal(event)\n",
117118
" \n",
118119
" for tel_id in event.r0.tels_with_data:\n",
119-
" tel = event.inst.subarray.tel[tel_id]\n",
120-
" cam_id = tel.camera.cam_id\n",
120+
" tel = source.subarray.tel[tel_id]\n",
121+
" cam_id = tel.camera.camera_name\n",
121122
" \n",
122-
" dl1_parameters.mc_distance_tel_impact = tel_to_impact_point_distance(event, tel_id)\n",
123+
" dl1_parameters.mc_distance_tel_impact = tel_to_impact_point_distance(event, source.subarray, tel_id)\n",
123124
"\n",
124125
" image_container.calibrated = event.dl1.tel[tel_id].image\n",
125-
" image_container.true_pe = event.mc.tel[tel_id].photo_electron_image\n",
126+
" image_container.true_pe = event.mc.tel[tel_id].true_image\n",
126127
" \n",
127128
" h5_table.write(cam_id, [image_container, event.mc, event.r0, dl1_parameters])\n"
128129
]
@@ -152,7 +153,7 @@
152153
"name": "python",
153154
"nbconvert_exporter": "python",
154155
"pygments_lexer": "ipython3",
155-
"version": "3.7.3"
156+
"version": "3.7.6"
156157
},
157158
"nteract": {
158159
"version": "0.12.3"

ctabench/core.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
'tel_to_impact_point_distance'
55
]
66

7-
def tel_to_impact_point_distance(event, tel_id):
7+
def tel_to_impact_point_distance(event, subarray, tel_id):
88
"""
99
Return the distance from the shower impact point to the telescope.
1010
@@ -17,6 +17,5 @@ def tel_to_impact_point_distance(event, tel_id):
1717
-------
1818
`astropy.units.Quantity`
1919
"""
20-
tel_index = event.inst.subarray.tel_indices[tel_id]
21-
return np.sqrt((event.mc.core_x - event.inst.subarray.tel_coords.x[tel_index]) ** 2
22-
+ (event.mc.core_y - event.inst.subarray.tel_coords.y[tel_index]) ** 2)
20+
return np.sqrt((event.mc.core_x - subarray.positions[tel_id][0]) ** 2
21+
+ (event.mc.core_y - subarray.positions[tel_id][1]) ** 2)

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
description="library for CTA benchmarks",
1111
# these should be minimum list of what is needed to run
1212
packages=setuptools.find_packages(),
13-
install_requires=['ctapipe=0.7.0',
13+
install_requires=['ctapipe==0.8.0',
1414
'seaborn',
1515
'pandas',
1616
],

0 commit comments

Comments
 (0)