Skip to content

Commit

Permalink
Merge pull request #1 from Photon-HDF5/master
Browse files Browse the repository at this point in the history
Merge upstream
  • Loading branch information
harripd authored May 19, 2024
2 parents 1290c6b + 7ed3981 commit 881c42f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 0 additions & 2 deletions phconvert/hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,6 @@ def save_photon_hdf5(data_dict,
kwargs = dict(skip_measurement_specs=skip_measurement_specs,
warnings=warnings, require_setup=require_setup)
assert_valid_photon_hdf5(h5file, **kwargs)
except Exception as e:
raise e
finally:
if close:
h5file.close()
Expand Down
4 changes: 3 additions & 1 deletion phconvert/smreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"""

import numpy as np
from os.path import getsize


class Decoder:
Expand Down Expand Up @@ -105,7 +106,8 @@ def load_sm(fname, return_labels=False):
timestamps, detectors and optionally a list of detectors labels
"""
with open(fname, 'rb') as f:
fulldata = f.read()
fulldata = bytearray(getsize(fname))
f.readinto(fulldata)

header_size, labels = decode_header(fulldata)
rawdata = fulldata[header_size:]
Expand Down

0 comments on commit 881c42f

Please sign in to comment.