File: mne_show_fiff.py

package info (click to toggle)
python-mne 0.13.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 92,032 kB
  • ctags: 8,249
  • sloc: python: 84,750; makefile: 205; sh: 15
file content (33 lines) | stat: -rw-r--r-- 757 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python
"""Show the contents of a FIFF file

You can do for example:

$ mne show_fiff test_raw.fif
"""

# Authors : Eric Larson, PhD

import codecs
import sys
import mne


def run():
    parser = mne.commands.utils.get_optparser(
        __file__, usage='mne show_fiff <file>')
    options, args = parser.parse_args()
    if len(args) != 1:
        parser.print_help()
        sys.exit(1)
    # This works around an annoying bug on Windows for show_fiff, see:
    # https://pythonhosted.org/kitchen/unicode-frustrations.html
    if int(sys.version[0]) < 3:
        UTF8Writer = codecs.getwriter('utf8')
        sys.stdout = UTF8Writer(sys.stdout)
    print(mne.io.show_fiff(args[0]))


is_main = (__name__ == '__main__')
if is_main:
    run()