mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-09-04 06:00:42 +02:00
FastPedestal + optimizations in the cluster finder (#341)
Optimized pedestal tracking with FastPedestal and performance improvements to the cluster finder. - ~2x faster hitting 14k FPS on benchmark dataset on 16 core threadripper pro **Changes** - No bounds check on interior of frame. (only within half of a cluster) (~15% improvement) - Cache threshold (std*n_rms) Biggest improvement comes from not computing std for each access - Cache pedestal subtracted frame - Switched to FastPedestal which assumes we reached steady state **Things tried but rejected:** - Always store cluster values, commit on val==max (~15% drop in frame rate) **Options** - using 16 bit clusters and 16 bit pedestal. (slows down the single threaded case but allow us to reach 12k with multi threading) **Other notes on performance** - Passing in memory frames from python and doing nothing: 0.8us/frame - Passing + pedestal subtraction: 28us/frame - Passing + pedestal + cluster finding (no store): 652us/frame - Passing + pedestal + cluster finding: 886 us/frame
This commit is contained in:
@@ -103,15 +103,18 @@ def test_max_sum():
|
||||
|
||||
def test_cluster_finder():
|
||||
"""Test ClusterFinder"""
|
||||
shape = [100,100]
|
||||
cf = _aare.ClusterFinder_Cluster3x3i(shape)
|
||||
|
||||
clusterfinder = _aare.ClusterFinder_Cluster3x3i([100,100])
|
||||
#Push 1000 frames to the pedestal
|
||||
for i in range(1000):
|
||||
frame = np.random.normal(loc = 100, scale = 5, size = shape).astype(np.uint16)
|
||||
cf.push_pedestal_frame(frame)
|
||||
cf.update_threshold()
|
||||
frame = np.zeros(shape=shape, dtype=np.uint16)
|
||||
cf.find_clusters(frame)
|
||||
|
||||
#frame = np.random.rand(100,100)
|
||||
frame = np.zeros(shape=[100,100])
|
||||
|
||||
clusterfinder.find_clusters(frame)
|
||||
|
||||
clusters = clusterfinder.steal_clusters(False) #conversion does not work
|
||||
clusters = cf.steal_clusters(False) #conversion does not work
|
||||
|
||||
assert clusters.size == 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user