def _generate_mne_locs_file(output_fname):
 logger.info('Converting Tristan coil file to mne loc file...')
 resource_dir = op.join(op.dirname(op.abspath(__file__)), 'resources')
 chan_fname = op.join(resource_dir, 'Artemis123_ChannelMap.csv')
 chans = _load_tristan_coil_locs(chan_fname)
 locs = {n: _compute_mne_loc(cinfo) for (n, cinfo) in chans.items()}
 with open(output_fname, 'w') as fid:
  for n in sorted(locs.keys()):
   fid.write(('%s,' % n))
   fid.write(','.join(locs[n].astype(str)))
   fid.write('\n')

def _generate_mne_locs_file ( output_fname ) : logger . info ( 'Converting Tristan coil file to mne loc file...' ) resource_dir = op . join ( op . dirname ( op . abspath ( __file__ ) ) , 'resources' ) chan_fname = op . join ( resource_dir , 'Artemis123_ChannelMap.csv' ) chans = _load_tristan_coil_locs ( chan_fname ) locs = { n : _compute_mne_loc ( cinfo ) for ( n , cinfo ) in chans . items ( ) } with open ( output_fname , 'w' ) as fid : for n in sorted ( locs . keys ( ) ) : fid . write ( ( '%s,' % n ) ) fid . write ( ',' . join ( locs [ n ] . astype ( str ) ) ) fid . write ( '\n' )
generate mne coil locs and save to supplied file .