5 import os.path as _os_path
8 import matplotlib as _matplotlib
9 import matplotlib.pyplot as _matplotlib_pyplot
12 FIGURE = _matplotlib_pyplot.figure()
15 class BadDataError (ValueError):
19 def convert_to_png(filename):
20 with _h5py.File(filename) as f:
21 png = filename + '.png'
22 if not _os_path.isfile(png):
24 axes = FIGURE.add_subplot(1, 1, 1)
27 z = f['approach']['z']
28 d = f['approach']['deflection']
31 plot = axes.plot(z, d, '.')
34 d = f['unfold']['deflection']
37 plot = axes.plot(z, d, '.')
38 axes.autoscale(tight=True)
42 if __name__ == '__main__':
45 for filename in _sys.argv[1:]:
47 convert_to_png(filename)
49 print('Error converting {}'.format(filename))