def _read_hc(directory):
 fname = _make_ctf_name(directory, 'hc', raise_error=False)
 if (fname is None):
  logger.info('    hc data not present')
  return None
 s = list()
 with open(fname, 'rb') as fid:
  while True:
   p = _read_one_coil_point(fid)
   if (p is None):
    if (len(s) == 0):
     logger.info('hc file empty, no data present')
     return None
    logger.info('    hc data read.')
    return s
   if p['valid']:
    s.append(p)

def _read_hc ( directory ) : fname = _make_ctf_name ( directory , 'hc' , raise_error = False ) if ( fname is None ) : logger . info ( '    hc data not present' ) return None s = list ( ) with open ( fname , 'rb' ) as fid : while True : p = _read_one_coil_point ( fid ) if ( p is None ) : if ( len ( s ) == 0 ) : logger . info ( 'hc file empty, no data present' ) return None logger . info ( '    hc data read.' ) return s if p [ 'valid' ] : s . append ( p )
read the hc file to get the hpi info and to prepare for coord trans .