forked from cta-observatory/ctapipe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_camera_frames.py
More file actions
32 lines (24 loc) · 916 Bytes
/
Copy pathplot_camera_frames.py
File metadata and controls
32 lines (24 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Plot the same event in two camera displays showing the
different coordinate frames for camera coordinates.
"""
from ctapipe.instrument import CameraGeometry
from ctapipe.visualization import CameraDisplay
import matplotlib.pyplot as plt
from ctapipe.coordinates import EngineeringCameraFrame
from ctapipe.image.toymodel import Gaussian
import astropy.units as u
def main():
fig, axs = plt.subplots(1, 2, constrained_layout=True, figsize=(6, 3))
model = Gaussian(0 * u.m, 0.1 * u.m, 0.3 * u.m, 0.05 * u.m, 25 * u.deg)
cam = CameraGeometry.from_name("FlashCam")
image, *_ = model.generate_image(cam, 2500)
CameraDisplay(cam, ax=axs[0], image=image)
CameraDisplay(
cam.transform_to(EngineeringCameraFrame()), ax=axs[1], image=image,
)
axs[0].set_title("CameraFrame")
axs[1].set_title("EngineeringCameraFrame")
plt.show()
if __name__ == "__main__":
main()