本文整理汇总了Python中ctapipe.visualization.CameraDisplay.autoupdate方法的典型用法代码示例。如果您正苦于以下问题:Python CameraDisplay.autoupdate方法的具体用法?Python CameraDisplay.autoupdate怎么用?Python CameraDisplay.autoupdate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ctapipe.visualization.CameraDisplay
的用法示例。
在下文中一共展示了CameraDisplay.autoupdate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: display_event
# 需要导入模块: from ctapipe.visualization import CameraDisplay [as 别名]
# 或者: from ctapipe.visualization.CameraDisplay import autoupdate [as 别名]
def display_event(event, geoms):
"""an extremely inefficient display. It creates new instances of
CameraDisplay for every event and every camera, and also new axes
for each event. It's hacked, but it works
"""
print("Displaying... please wait (this is an inefficient implementation)")
global fig
ntels = len(event.r0.tels_with_data)
fig.clear()
plt.suptitle("EVENT {}".format(event.r0.event_id))
disps = []
for ii, tel_id in enumerate(event.r0.tels_with_data):
print("\t draw cam {}...".format(tel_id))
nn = int(ceil(sqrt(ntels)))
ax = plt.subplot(nn, nn, ii + 1)
x, y = event.inst.pixel_pos[tel_id]
geom = geoms[tel_id]
disp = CameraDisplay(geom, ax=ax, title="CT{0}".format(tel_id))
disp.pixels.set_antialiaseds(False)
disp.autoupdate = False
disp.cmap = 'afmhot'
chan = 0
signals = event.r0.tel[tel_id].adc_sums[chan].astype(float)
signals -= signals.mean()
disp.image = signals
disp.set_limits_percent(95)
disp.add_colorbar()
disps.append(disp)
return disps