def _get_info(eeg, montage, eog=()):
    info = _empty_info(sfreq=eeg.srate)

    # add the ch_names and info['chs'][idx]['loc']
    path = None
    if len(eeg.chanlocs) > 0:
        ch_names, pos = list(), list()
        kind = 'user_defined'
        selection = np.arange(len(eeg.chanlocs))
        locs_available = True
        for chanloc in eeg.chanlocs:
            ch_names.append(chanloc.labels)
            loc_x = _to_loc(chanloc.X)
            loc_y = _to_loc(chanloc.Y)
            loc_z = _to_loc(chanloc.Z)
            locs = np.r_[-loc_y, loc_x, loc_z]
            if np.unique(locs).size == 1:
                locs_available = False
            pos.append(locs)
        if locs_available:
            montage = Montage(np.array(pos), ch_names, kind, selection)
    elif isinstance(montage, string_types):
        path = op.dirname(montage)
    else:  # if eeg.chanlocs is empty, we still need default chan names
        ch_names = ["EEG %03d" % ii for ii in range(eeg.nbchan)]

    if montage is None:
        info = create_info(ch_names, eeg.srate, ch_types='eeg')
    else:
        _check_update_montage(info, montage, path=path,
                              update_ch_names=True)

    info['buffer_size_sec'] = 1.  # reasonable default
    # update the info dict

    if eog == 'auto':
        eog = _find_channels(ch_names)

    for idx, ch in enumerate(info['chs']):
        ch['cal'] = CAL
        if ch['ch_name'] in eog or idx in eog:
            ch['coil_type'] = FIFF.FIFFV_COIL_NONE
            ch['kind'] = FIFF.FIFFV_EOG_CH
    return info
Get measurement info.
dataset/ETHPy150Open mne-tools/mne-python/mne/io/eeglab/eeglab.py/_get_info