hep: go-hep.org/x/hep/cmd/npy2root Files

Command npy2root

Command npy2root converts the content of a NumPy data file to a ROOT file and tree.

Usage: npy2root [OPTIONS] input.npy

The NumPy data file format is described here:



$> npyio-ls input.npy
file: input.npy
npy-header: Header{Major:1, Minor:0, Descr:{Type:<f8, Fortran:false, Shape:[2 3]}}
data = [0 1 2 3 4 5]

$> npy2root -o output.root -t mytree ./input.npy
$> root-ls -t ./output.root
=== [./output.root] ===
version: 61804
  TTree   mytree       mytree  (entries=2)
    numpy "numpy[3]/D" TBranch

$> root-dump ./output.root
>>> file[./output.root]
key[000]: mytree;1 "mytree" (TTree)
[000][numpy]: [0 1 2]
[001][numpy]: [3 4 5]


-o string
  	path to output ROOT file (default "output.root")
-t string
  	name of the output ROOT tree (default "tree")

Package Files

arrow.go main.go

Package main imports 15 packages (graph). Updated 2020-05-20. Refresh now. Tools for package owners.