Check for EEG ref.
(inst, ch_names=None)
| 885 | |
| 886 | |
| 887 | def _check_reference(inst, ch_names=None): |
| 888 | """Check for EEG ref.""" |
| 889 | info = inst.info |
| 890 | if ch_names is not None: |
| 891 | picks = [ |
| 892 | ci for ci, ch_name in enumerate(info["ch_names"]) if ch_name in ch_names |
| 893 | ] |
| 894 | info = pick_info(info, sel=picks) |
| 895 | if _needs_eeg_average_ref_proj(info): |
| 896 | raise ValueError( |
| 897 | "EEG average reference (using a projector) is mandatory for " |
| 898 | "modeling, use the method set_eeg_reference(projection=True)" |
| 899 | ) |
| 900 | if _electrode_types(info) and info.get("custom_ref_applied", False): |
| 901 | raise ValueError("Custom EEG reference is not allowed for inverse modeling.") |
| 902 | |
| 903 | |
| 904 | def _subject_from_inverse(inverse_operator): |
no test coverage detected