def _zip_translate_segment_params(self, params):
info = {
- 'raw info':params,
- 'columns':list(params['channels']['list']),
- 'name':params['force-segment-header']['name']['name'],
+ 'raw info': params,
+ 'columns': list(params['channels']['list']),
+ 'name': self._zip_segment_name(params),
}
- if info['name'] in ['extend-spm', 'retract-spm', 'pause-at-end-spm']:
- info['name'] = info['name'][:-len('-spm')]
- if info['name'] == 'extend':
- info['name'] = 'approach'
- else:
- raise NotImplementedError(
- 'Unrecognized segment type %s' % info['name'])
return info
+ def _zip_segment_name(self, params):
+ name = params['force-segment-header']['name']['name']
+ if name.endswith('-spm'):
+ name = name[:-len('-spm')]
+ if name == 'extend':
+ name = 'approach'
+ elif name.startswith('pause-at-'):
+ name = 'pause'
+ return name
+
def _zip_scale_segment(self, segment, path, info):
data = curve.Data(
shape=segment.shape,