'Define the sensor type of channels.
Note: The following sensor types are accepted:
ecg, eeg, emg, eog, exci, ias, misc, resp, seeg, stim, syst, ecog,
hbo, hbr
Parameters
mapping : dict
a dictionary mapping a channel to a sensor type (str)
{\'EEG061\': \'eog\'}.
Notes
.. versionadded:: 0.9.0'

def set_channel_types(self, mapping):

    ch_names = self.info['ch_names']
    unit_changes = dict()
    for (ch_name, ch_type) in mapping.items():
        if (ch_name not in ch_names):
            raise ValueError(("This    channel    name    (%s)    doesn't    exist    in    info." % ch_name))
        c_ind = ch_names.index(ch_name)
        if (ch_type not in _human2fiff):
            raise ValueError(('This    function    cannot    change    to    this    channel    type:    %s.    Accepted    channel    types    are    %s.' % (ch_type, ',    '.join(sorted(_human2unit.keys())))))
        _check_set(self.info['chs'][c_ind], self.info['projs'], ch_type)
        unit_old = self.info['chs'][c_ind]['unit']
        unit_new = _human2unit[ch_type]
        if (unit_old not in _unit2human):
            raise ValueError(("Channel    '%s'    has    unknown    unit    (%s).    Please    fix    the    measurement    info    of    your    data." % (ch_name, unit_old)))
        if (unit_old != _human2unit[ch_type]):
            this_change = (_unit2human[unit_old], _unit2human[unit_new])
            if (this_change not in unit_changes):
                unit_changes[this_change] = list()
            unit_changes[this_change].append(ch_name)
        self.info['chs'][c_ind]['unit'] = _human2unit[ch_type]
        if (ch_type in ['eeg', 'seeg', 'ecog']):
            coil_type = FIFF.FIFFV_COIL_EEG
        elif (ch_type == 'hbo'):
            coil_type = FIFF.FIFFV_COIL_FNIRS_HBO
        elif (ch_type == 'hbr'):
            coil_type = FIFF.FIFFV_COIL_FNIRS_HBR
        else:
            coil_type = FIFF.FIFFV_COIL_NONE
        self.info['chs'][c_ind]['coil_type'] = coil_type
    msg = 'The    unit    for    channel(s)    {0}    has    changed    from    {1}    to    {2}.'
    for (this_change, names) in unit_changes.items():
        warn(msg.format(',    '.join(sorted(names)), *this_change))
