@testing.requires_testing_data
def test_make_field_map_meeg():
    'Test making a M/EEG field map onto helmet & head.'
    evoked = read_evokeds(evoked_fname, baseline=((- 0.2), 0.0))[0]
    picks = pick_types(evoked.info, meg=True, eeg=True)
    picks = picks[::10]
    evoked.pick_channels([evoked.ch_names[p] for p in picks])
    evoked.info.normalize_proj()
    maps = make_field_map(evoked, trans_fname, subject='sample', subjects_dir=subjects_dir, verbose='debug')
    assert_equal(maps[0]['data'].shape, (642, 6))
    assert_equal(maps[1]['data'].shape, (304, 31))
    maxs = (1.2, 2.0)
    mins = ((- 0.8), (- 1.3))
    assert_equal(len(maxs), len(maps))
    for (map_, max_, min_) in zip(maps, maxs, mins):
        assert_allclose(map_['data'].max(), max_, rtol=0.05)
        assert_allclose(map_['data'].min(), min_, rtol=0.05)
    assert_allclose(np.sqrt(np.sum((maps[0]['data'] ** 2))), 19.0903, atol=0.001, rtol=0.001)
    assert_allclose(np.sqrt(np.sum((maps[1]['data'] ** 2))), 19.4748, atol=0.001, rtol=0.001)
Test making a M/EEG field map onto helmet & head.
@testing.requires_testing_data
def test_make_field_map_meeg():
    
    evoked = read_evokeds(evoked_fname, baseline=((- 0.2), 0.0))[0]
    picks = pick_types(evoked.info, meg=True, eeg=True)
    picks = picks[::10]
    evoked.pick_channels([evoked.ch_names[p] for p in picks])
    evoked.info.normalize_proj()
    maps = make_field_map(evoked, trans_fname, subject='sample', subjects_dir=subjects_dir, verbose='debug')
    assert_equal(maps[0]['data'].shape, (642, 6))
    assert_equal(maps[1]['data'].shape, (304, 31))
    maxs = (1.2, 2.0)
    mins = ((- 0.8), (- 1.3))
    assert_equal(len(maxs), len(maps))
    for (map_, max_, min_) in zip(maps, maxs, mins):
        assert_allclose(map_['data'].max(), max_, rtol=0.05)
        assert_allclose(map_['data'].min(), min_, rtol=0.05)
    assert_allclose(np.sqrt(np.sum((maps[0]['data'] ** 2))), 19.0903, atol=0.001, rtol=0.001)
    assert_allclose(np.sqrt(np.sum((maps[1]['data'] ** 2))), 19.4748, atol=0.001, rtol=0.001)