def read_offsets(offsets_file):
offsets = np.zeros(
shape=(8, 2, 4096, 40),
dtype='f4')
def name_to_channel_gain_id(name):
_, channel, gain = name.split('_')
channel = int(channel)
gain_id = {'high': 0, 'low': 1}[gain]
return channel, gain_id
with pd.HDFStore(offsets_file) as st:
for name in st.keys():
channel, gain_id = name_to_channel_gain_id(name)
df = st[name]
df.sort_values(["cell", "sample"], inplace=True)
offsets[channel, gain_id] = df["median"].values.reshape(-1, 40)
return offsets
calibration.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录