|
25 | 25 | "from ctapipe.calib import CameraCalibrator\n",
|
26 | 26 | "from ctapipe.visualization import CameraDisplay\n",
|
27 | 27 | "from ctapipe.io import HDF5TableWriter\n",
|
28 |
| - "from ctapipe.io.containers import Container, Field\n", |
| 28 | + "from ctapipe.containers import Container, Field\n", |
29 | 29 | "from ctabench import tel_to_impact_point_distance\n",
|
30 | 30 | "from ctapipe.image.extractor import GlobalPeakWindowSum, NeighborPeakWindowSum, FullWaveformSum\n",
|
31 | 31 | "from ctapipe.calib.camera.gainselection import ThresholdGainSelector"
|
|
109 | 109 | " print(integrator) \n",
|
110 | 110 | " with HDF5TableWriter(output_filename, group_name=integrator, mode='a', add_prefix=True) as h5_table:\n",
|
111 | 111 | "\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", |
114 | 115 | "\n",
|
115 | 116 | " for event in source:\n",
|
116 | 117 | " cal(event)\n",
|
117 | 118 | " \n",
|
118 | 119 | " 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", |
121 | 122 | " \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", |
123 | 124 | "\n",
|
124 | 125 | " 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", |
126 | 127 | " \n",
|
127 | 128 | " h5_table.write(cam_id, [image_container, event.mc, event.r0, dl1_parameters])\n"
|
128 | 129 | ]
|
|
152 | 153 | "name": "python",
|
153 | 154 | "nbconvert_exporter": "python",
|
154 | 155 | "pygments_lexer": "ipython3",
|
155 |
| - "version": "3.7.3" |
| 156 | + "version": "3.7.6" |
156 | 157 | },
|
157 | 158 | "nteract": {
|
158 | 159 | "version": "0.12.3"
|
|
0 commit comments