def read_xyt_frame( n=1 ):
''' Load the xyt txt files:
x,y is the detector (x,y) coordinates
t is the time-encoder (when hitting the detector at that (x,y))
DATA_DIR is the data filefold path
DataPref is the data prefix
n is file number
the data name will be like: DATA_DIR/DataPref_0001.txt
return the histogram of the hitting event
'''
import numpy as np
ni = '%04d'%n
fp = DATA_DIR + DataPref + '%s.txt'%ni
data = np.genfromtxt( fp, skiprows=0)[:,2] #take the time encoder
td = np.histogram( data, bins= np.arange(11810) )[0] #do histogram
return td
xpcs_timepixel_old_version.py 文件源码
python
阅读 30
收藏 0
点赞 0
评论 0
评论列表
文章目录