def _conv_comp(comp, first, last, chs):
 ccomp = dict(ctfkind=np.array([comp[first]['coeff_type']]), save_calibrated=False)
 _add_kind(ccomp)
 n_col = comp[first]['ncoeff']
 n_row = ((last - first) + 1)
 col_names = comp[first]['sensors'][:n_col]
 row_names = [comp[p]['sensor_name'] for p in range(first, (last + 1))]
 data = np.empty((n_row, n_col))
 for (ii, coeffs) in enumerate(comp[first:(last + 1)]):
  data[ii, :] = coeffs['coeffs'][:]
 ccomp['data'] = dict(row_names=row_names, col_names=col_names, data=data, nrow=len(row_names), ncol=len(col_names))
 mk = ('proper_gain', 'qgain')
 _calibrate_comp(ccomp, chs, row_names, col_names, mult_keys=mk, flip=True)
 return ccomp

def _conv_comp ( comp , first , last , chs ) : ccomp = dict ( ctfkind = np . array ( [ comp [ first ] [ 'coeff_type' ] ] ) , save_calibrated = False ) _add_kind ( ccomp ) n_col = comp [ first ] [ 'ncoeff' ] n_row = ( ( last - first ) + 1 ) col_names = comp [ first ] [ 'sensors' ] [ : n_col ] row_names = [ comp [ p ] [ 'sensor_name' ] for p in range ( first , ( last + 1 ) ) ] data = np . empty ( ( n_row , n_col ) ) for ( ii , coeffs ) in enumerate ( comp [ first : ( last + 1 ) ] ) : data [ ii , : ] = coeffs [ 'coeffs' ] [ : ] ccomp [ 'data' ] = dict ( row_names = row_names , col_names = col_names , data = data , nrow = len ( row_names ) , ncol = len ( col_names ) ) mk = ( 'proper_gain' , 'qgain' ) _calibrate_comp ( ccomp , chs , row_names , col_names , mult_keys = mk , flip = True ) return ccomp
add a new converted compensation data item .