Skip to content
Snippets Groups Projects
Commit 68e06da3 authored by Greg Quinn's avatar Greg Quinn
Browse files

Extract _decode_rdr_blob function

parent 7c085575
No related branches found
No related tags found
No related merge requests found
......@@ -191,15 +191,23 @@ def _rdrs_for_packet_dataset(group):
rdrs = []
if group:
for name, buf in _generate_packet_datasets(group):
if buf.shape[0] < c.sizeof(StaticHeader):
LOG.warn('Not enough bytes for %s static header', name)
try:
rdr = _decode_rdr_blob(buf)
except ValueError as e:
LOG.warn('{} ({})'.format(e.message, name))
continue
header = StaticHeader.from_buffer(buf)
apids = _read_apid_list(header, buf)
rdrs.append(CommonRdr(buf, header, list(apids)))
rdrs.append(rdr)
return rdrs
def _decode_rdr_blob(buf):
if buf.shape[0] < c.sizeof(StaticHeader):
raise ValueError('Not enough bytes for static header')
header = StaticHeader.from_buffer(buf)
apids = _read_apid_list(header, buf)
return CommonRdr(buf, header, list(apids))
def rdr_datasets(filepath):
fobj = H5File(filepath)
rdr = dict(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment