def _read_ctc(fname):
 if ((not isinstance(fname, string_types)) or (not op.isfile(fname))):
  raise ValueError(('fname must be a file that exists, not %s' % fname))
 (f, tree, _) = fiff_open(fname)
 with f as fid:
  sss_ctc = _read_maxfilter_record(fid, tree)['sss_ctc']
  bad_str = ('Invalid cross-talk FIF: %s' % fname)
  if (len(sss_ctc) == 0):
   raise ValueError(bad_str)
  node = dir_tree_find(tree, FIFF.FIFFB_DATA_CORRECTION)[0]
  comment = find_tag(fid, node, FIFF.FIFF_COMMENT).data
  if (comment != 'cross-talk compensation matrix'):
   raise ValueError(bad_str)
  sss_ctc['creator'] = find_tag(fid, node, FIFF.FIFF_CREATOR).data
  sss_ctc['date'] = find_tag(fid, node, FIFF.FIFF_MEAS_DATE).data
 return sss_ctc

def _read_ctc ( fname ) : if ( ( not isinstance ( fname , string_types ) ) or ( not op . isfile ( fname ) ) ) : raise ValueError ( ( 'fname must be a file that exists, not %s' % fname ) ) ( f , tree , _ ) = fiff_open ( fname ) with f as fid : sss_ctc = _read_maxfilter_record ( fid , tree ) [ 'sss_ctc' ] bad_str = ( 'Invalid cross-talk FIF: %s' % fname ) if ( len ( sss_ctc ) == 0 ) : raise ValueError ( bad_str ) node = dir_tree_find ( tree , FIFF . FIFFB_DATA_CORRECTION ) [ 0 ] comment = find_tag ( fid , node , FIFF . FIFF_COMMENT ) . data if ( comment != 'cross-talk compensation matrix' ) : raise ValueError ( bad_str ) sss_ctc [ 'creator' ] = find_tag ( fid , node , FIFF . FIFF_CREATOR ) . data sss_ctc [ 'date' ] = find_tag ( fid , node , FIFF . FIFF_MEAS_DATE ) . data return sss_ctc
read cross-talk correction matrix .