本文整理汇总了Python中ctapipe.visualization.CameraDisplay.highlight_pixels方法的典型用法代码示例。如果您正苦于以下问题:Python CameraDisplay.highlight_pixels方法的具体用法?Python CameraDisplay.highlight_pixels怎么用?Python CameraDisplay.highlight_pixels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ctapipe.visualization.CameraDisplay
的用法示例。
在下文中一共展示了CameraDisplay.highlight_pixels方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tailcuts_clean
# 需要导入模块: from ctapipe.visualization import CameraDisplay [as 别名]
# 或者: from ctapipe.visualization.CameraDisplay import highlight_pixels [as 别名]
psi='35d')
image, sig, bg = toymodel.make_toymodel_shower_image(geom, model.pdf,
intensity=50,
nsb_level_pe=1000)
# Apply image cleaning
cleanmask = tailcuts_clean(geom, image, picture_thresh=200,
boundary_thresh=100)
clean = image.copy()
clean[~cleanmask] = 0.0
# Calculate image parameters
hillas = hillas_parameters(geom.pix_x, geom.pix_y, clean)
print(hillas)
# Show the camera image and overlay Hillas ellipse and clean pixels
disp.image = image
disp.cmap = 'PuOr'
disp.highlight_pixels(cleanmask, color='black')
disp.overlay_moments(hillas, color='cyan', linewidth=3)
# Draw the neighbors of pixel 100 in red, and the neighbor-neighbors in
# green
for ii in geom.neighbors[130]:
draw_neighbors(geom, ii, color='green')
draw_neighbors(geom, 130, color='cyan', lw=2)
plt.show()
示例2: CameraDisplay
# 需要导入模块: from ctapipe.visualization import CameraDisplay [as 别名]
# 或者: from ctapipe.visualization.CameraDisplay import highlight_pixels [as 别名]
if __name__ == '__main__':
# Load the camera
geom = CameraGeometry.from_name("LSTCam")
disp = CameraDisplay(geom)
disp.add_colorbar()
# Create a fake camera image to display:
model = toymodel.generate_2d_shower_model(
centroid=(0.2, 0.0), width=0.05, length=0.15, psi='35d'
)
image, sig, bg = toymodel.make_toymodel_shower_image(
geom, model.pdf, intensity=1500, nsb_level_pe=3
)
# Apply image cleaning
cleanmask = tailcuts_clean(
geom, image, picture_thresh=10, boundary_thresh=5
)
# Calculate image parameters
hillas = hillas_parameters(geom[cleanmask], image[cleanmask])
# Show the camera image and overlay Hillas ellipse and clean pixels
disp.image = image
disp.highlight_pixels(cleanmask, color='crimson')
disp.overlay_moments(hillas, color='cyan', linewidth=3)
plt.show()
示例3: CameraDisplay
# 需要导入模块: from ctapipe.visualization import CameraDisplay [as 别名]
# 或者: from ctapipe.visualization.CameraDisplay import highlight_pixels [as 别名]
from ctapipe.image import toymodel
from ctapipe.instrument import CameraGeometry
from ctapipe.visualization import CameraDisplay
if __name__ == '__main__':
plt.style.use('ggplot')
fig = plt.figure(figsize=(12, 8))
ax = fig.add_subplot(1, 1, 1)
geom = CameraGeometry.from_name('NectarCam')
disp = CameraDisplay(geom, ax=ax)
disp.add_colorbar()
model = toymodel.generate_2d_shower_model(
centroid=(0.05, 0.0), width=0.05, length=0.15, psi='35d'
)
image, sig, bg = toymodel.make_toymodel_shower_image(
geom, model.pdf, intensity=1500, nsb_level_pe=5
)
disp.image = image
mask = disp.image > 10
disp.highlight_pixels(mask, linewidth=2, color='crimson')
plt.show()
示例4: CameraDisplay
# 需要导入模块: from ctapipe.visualization import CameraDisplay [as 别名]
# 或者: from ctapipe.visualization.CameraDisplay import highlight_pixels [as 别名]
from ctapipe.image import toymodel
from ctapipe.io import CameraGeometry
from ctapipe.visualization import CameraDisplay
from matplotlib import pyplot as plt
if __name__ == '__main__':
plt.style.use('ggplot')
fig = plt.figure(figsize=(12, 8))
ax = fig.add_subplot(1, 1, 1)
geom = CameraGeometry.from_name('hess', 1)
disp = CameraDisplay(geom, ax=ax)
disp.add_colorbar()
model = toymodel.generate_2d_shower_model(
centroid=(0.05, 0.0), width=0.005, length=0.025, psi='35d'
)
image, sig, bg = toymodel.make_toymodel_shower_image(
geom, model.pdf, intensity=50, nsb_level_pe=20
)
disp.image = image
mask = disp.image > 15
disp.highlight_pixels(mask, linewidth=3)
plt.show()