aboutsummaryrefslogtreecommitdiff
path: root/scripts/display-hdf5
blob: c203df20ea79fbc447df8a88839d507fadd444e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python

import h5py
import sys
import matplotlib.pyplot as plt

if len(sys.argv) != 3:
    print("Syntax: {} file.h5 /data/location\n".format(sys.argv[0]))
    sys.exit(1)

fh = h5py.File(sys.argv[1])
dataset = fh[sys.argv[2]]

show = plt.figure()
plt.imshow(dataset)
plt.title("{} {}".format(sys.argv[1], sys.argv[2]))
plt.show()

fh.close()