Files
saresb/script/test/demo_histogram.py
gac-bernina 3edd5ecda9
2024-02-19 16:44:57 +01:00

26 lines
724 B
Python

import ch.psi.pshell.device.HistogramGenerator as HistogramGenerator
CAMERA_NAME = "SARES20-PROF141-M1"
CHANNEL = "intensity"
cam_server.start(CAMERA_NAME + "_sp", True) #Start or connect to ScreenPanel pipeline
cam_server.stream.waitCacheChange(2000)
dev = cam_server.stream.getChild(CHANNEL)
add_device(dev, True) #To see it in Device panel
samples = 100
range_min, range_max = float('nan'),float('nan')
bins = 100
hist = HistogramGenerator(CAMERA_NAME + "_" + CHANNEL + "_histogram", dev, samples, range_min, range_max, bins)
hist.monitored=True
add_device(hist, True)
show_panel(hist)
hist.config.bins = 100
hist.config.min = float('nan')
hist.config.max = float('nan')
hist.config.numberOfSamples = 100