io.py 文件源码

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

项目:picasso 作者: jungmannlab 项目源码 文件源码
def load_raw(path, prompt_info=None):
    try:
        info = load_info(path)
    except FileNotFoundError as error:
        if prompt_info is None:
            raise error
        else:
            result = prompt_info()
            if result is None:
                return
            else:
                info, save = result
                info = [info]
                if save:
                    base, ext = _ospath.splitext(path)
                    info_path = base + '.yaml'
                    save_info(info_path, info)
    dtype = _np.dtype(info[0]['Data Type'])
    shape = (info[0]['Frames'], info[0]['Height'], info[0]['Width'])
    movie = _np.memmap(path, dtype, 'r', shape=shape)
    if info[0]['Byte Order'] != '<':
        movie = movie.byteswap()
        info[0]['Byte Order'] = '<'
    return movie, info
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号