def histogram_xyt( x, y, t, binstep=100, detx=256, dety=256 ):
'''x: coordinate-x
y: coordinate-y
t: photon hit time
bin t in binstep (in t unit) period
'''
L= np.max( (t-t[0])//binstep ) + 1
arr = np.ravel_multi_index( [x, y, (t-t[0])//binstep ], [detx, dety,L ] )
M,N = arr.max(),arr.min()
da = np.zeros( [detx, dety, L ] )
da.flat[np.arange(N, M ) ] = np.bincount( arr- N )
return da
######################################################
xpcs_timepixel_old_version.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录