aboutsummaryrefslogtreecommitdiff
path: root/draw.py
diff options
context:
space:
mode:
authorAnthony LaTorre <telatorre@gmail.com>2011-08-17 14:40:25 -0400
committerAnthony LaTorre <telatorre@gmail.com>2011-08-17 14:40:25 -0400
commitf8a87ff1069d7fab7031804da2d66773be8695a6 (patch)
treebc9807263b3f57f48c1fb2ce28c4bb0920e8a423 /draw.py
parent9cb86aba279caf86769448df877a727f54ebb786 (diff)
downloadlecrunch-f8a87ff1069d7fab7031804da2d66773be8695a6.tar.gz
lecrunch-f8a87ff1069d7fab7031804da2d66773be8695a6.tar.bz2
lecrunch-f8a87ff1069d7fab7031804da2d66773be8695a6.zip
documentation update and open hdf5 files in read only mode in draw.py
Diffstat (limited to 'draw.py')
-rwxr-xr-xdraw.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/draw.py b/draw.py
index 70efda7..30a2ffd 100755
--- a/draw.py
+++ b/draw.py
@@ -17,7 +17,7 @@ def roundrobin(*iterables):
nexts = cycle(islice(nexts, pending))
def draw(filename, nevents):
- f = h5py.File(filename)
+ f = h5py.File(filename, 'r')
fig = plt.figure()
for i, dataset in enumerate((f[name] for name in f)):
@@ -37,6 +37,8 @@ def draw(filename, nevents):
plt.ylabel('Voltage (V)')
plt.title(dataset.name)
+ f.close()
+
return fig
if __name__ == '__main__':