From 9adaa537b6070bfbe9a55317fcaf8c25dbafe3d6 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 5 Aug 2020 15:45:43 +0200 Subject: Add scripts/display-hdf5 --- scripts/display-hdf5 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 scripts/display-hdf5 (limited to 'scripts') diff --git a/scripts/display-hdf5 b/scripts/display-hdf5 new file mode 100755 index 00000000..c203df20 --- /dev/null +++ b/scripts/display-hdf5 @@ -0,0 +1,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() -- cgit v1.2.3