chx_specklecp.py 文件源码

python
阅读 40 收藏 0 点赞 0 评论 0

项目:chxanalys 作者: yugangzhang 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号