#NEWLINE# def _read_comp_coeff( fid , d ) : #NEWLINE# #INDENT# 'Read compensation coefficients' #NEWLINE# d [ 'ncomp' ] = _read_int2 ( fid ) #NEWLINE# d [ 'comp' ] = list ( ) #NEWLINE# for k in range ( d [ 'ncomp' ] ) : #NEWLINE# #INDENT# comp = dict ( ) #NEWLINE# d [ 'comp' ] . append ( k ) #NEWLINE# comp [ 'sensor_name' ] = _read_string ( fid , 32 ) #NEWLINE# comp [ 'coeff_type' ] = _read_int ( fid ) #NEWLINE# _read_int ( fid ) #NEWLINE# comp [ 'ncoeff' ] = _read_int2 ( fid ) #NEWLINE# comp [ 'coeffs' ] = np . zeros ( comp [ 'ncoeff' ] ) #NEWLINE# comp [ 'sensors' ] = [ _read_string ( fid , CTF . CTFV_SENSOR_LABEL ) for p in range ( comp [ 'ncoeff' ] ) ] #NEWLINE# unused = ( CTF . CTFV_MAX_BALANCING - comp [ 'ncoeff' ] ) #NEWLINE# comp [ 'sensors' ] += ( [ '' ] * unused ) #NEWLINE# fid . seek ( ( unused * CTF . CTFV_SENSOR_LABEL ) , 1 ) #NEWLINE# comp [ 'coeffs' ] [ : comp [ 'ncoeff' ] ] = _read_double ( fid , comp [ 'ncoeff' ] ) #NEWLINE# fid . seek ( ( unused * 8 ) , 1 ) #NEWLINE# comp [ 'scanno' ] = d [ 'ch_names' ] . index ( comp [ 'sensor_name' ] )