- z_col = channels.index('height')
- d_col = channels.index('vDeflection')
-
- segment = self._zip_scale_channel(
- segment, z_col, 'calibrated', path, info)
- segment = self._zip_scale_channel(
- segment, d_col, 'distance', path, info)
-
- assert segment.info['columns'][z_col] == 'height (m)', \
- segment.info['columns'][z_col]
- assert segment.info['columns'][d_col] == 'vDeflection (m)', \
- segment.info['columns'][d_col]
-
- # scaled column indices same as raw column indices,
- # because columns is a copy of channels.list
- segment.info['columns'][z_col] = 'z piezo (m)'
- segment.info['columns'][d_col] = 'deflection (m)'
+ for i,channel in enumerate(channels):
+ conversion = None
+ if channel == 'vDeflection':
+ conversion = 'distance'
+ segment = self._zip_scale_channel(
+ segment, channel, conversion=conversion, path=path, info=info)
+ name,unit = split_data_label(segment.info['columns'][i])
+ if name == 'vDeflection':
+ assert unit == 'm', segment.info['columns'][i]
+ segment.info['columns'][i] = join_data_label('deflection', 'm')
+ elif name == 'height':
+ assert unit == 'm', segment.info['columns'][i]
+ segment.info['columns'][i] = join_data_label('z piezo', 'm')