首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >HDF5与根框架的集成

HDF5与根框架的集成
EN

Stack Overflow用户
提问于 2012-04-12 17:50:16
回答 3查看 2.7K关注 0票数 4

我曾广泛使用过ROOT,它有自己的数据文件格式,但由于各种原因,我们希望切换到HDF5文件。不幸的是,我们仍然需要一些在格式之间转换文件的方法。有没有人知道有没有现成的库这样做?

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2012-05-19 04:46:45

您可以查看rootpy,它有一个通过PyTables:http://www.rootpy.org/commands/root2hdf5.html将根文件转换为HDF5的工具

票数 4
EN

Stack Overflow用户

发布于 2013-01-20 04:04:35

如果您仍然对这个问题感兴趣,那么最近对rootpyroot2hdf5脚本和root_numpy包( root2hdf5用来将TTrees转换为NumPy结构化数组)有了很大的改进:

代码语言:javascript
复制
root2hdf5 -h
usage: root2hdf5 [-h] [-n ENTRIES] [-f] [--ext EXT] [-c {0,1,2,3,4,5,6,7,8,9}]
                 [-l {zlib,lzo,bzip2,blosc}] [--script SCRIPT] [-q]
                 files [files ...]

positional arguments:
  files

optional arguments:
  -h, --help            show this help message and exit
  -n ENTRIES, --entries ENTRIES
                        number of entries to read at once (default: 100000.0)
  -f, --force           overwrite existing output files (default: False)
  --ext EXT             output file extension (default: h5)
  -c {0,1,2,3,4,5,6,7,8,9}, --complevel {0,1,2,3,4,5,6,7,8,9}
                        compression level (default: 5)
  -l {zlib,lzo,bzip2,blosc}, --complib {zlib,lzo,bzip2,blosc}
                        compression algorithm (default: zlib)
  --script SCRIPT       Python script containing a function with the same name 
                        that will be called on each tree and must return a tree or 
                        list of trees that will be converted instead of the 
                        original tree (default: None)
  -q, --quiet           suppress all warnings (default: False)
票数 2
EN

Stack Overflow用户

发布于 2014-02-10 14:30:49

在我最后一次检查时(几个月前),root2hdf5有一个限制,它不能处理TBranches,它是数组。出于这个原因,我写了一个bash脚本:root2hdf (很抱歉没有创意的名字)。

它将根文件和文件中TTree的路径作为输入参数,并生成源代码&编译为可在根文件上运行的可执行文件,将它们转换为HDF5数据集。

它也有一个限制,即它不能处理复合TBranch类型,但我不知道root2hdf5也是如此。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10121233

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档