prop_file.close()
expected_shape = (int(prop['force-segment-header']['num-points']),)
channels = []
+ if 'list' not in prop['channels']:
+ prop['channels'] = {'list': prop['channels'].split()}
for chan in prop['channels']['list']:
chan_info = prop['channel'][chan]
- channels.append(self._zip_channel(zipfile, index, chan, chan_info))
+ channels.append(self._zip_channel(
+ zipfile, index, chan, chan_info))
if channels[-1].shape != expected_shape:
- raise NotImplementedError(
- 'Channel %d:%s in %s has strange shape %s != %s'
- % (index, chan, zipfile.path,
- channels[-1].shape, expected_shape))
+ raise NotImplementedError(
+ 'Channel %d:%s in %s has strange shape %s != %s'
+ % (index, chan, zipfile.path,
+ channels[-1].shape, expected_shape))
+ if len(channels) > 0:
+ shape = (len(channels[0]), len(channels))
+ dtype = channels[0].dtype
+ else: # no channels for this data block
+ shape = (0,0)
+ dtype = numpy.float32
d = curve.Data(
- shape=(len(channels[0]), len(channels)),
- dtype=channels[0].dtype,
+ shape=shape,
+ dtype=dtype,
info=self._zip_translate_segment_params(prop))
for i,chan in enumerate(channels):
d[:,i] = chan