def get_his_std_qi( data_pixel_qi, max_cts=None):
'''
YG. Dev 16, 2016
Calculate the photon histogram for one q by giving
Parameters:
data_pixel_qi: one-D array, for the photon counts
max_cts: for bin max, bin will be [0,1,2,..., max_cts]
Return:
bins
his
std
'''
if max_cts is None:
max_cts = np.max( data_pixel_qi ) +1
bins = np.arange(max_cts)
dqn, dqm = data_pixel_qi.shape
#get histogram here
H = np.apply_along_axis(np.bincount, 1, np.int_(data_pixel_qi), minlength= max_cts )/dqm
#do average for different frame
his = np.average( H, axis=0)
std = np.std( H, axis=0 )
#cal average photon counts
kmean= np.average(data_pixel_qi )
return bins, his, std, kmean
评论列表
文章目录