Package mvpa :: Package tests :: Module test_meg

[hide private]
[frames] | no frames]

# Source Code for Module mvpa.tests.test_meg

     1  # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
     2  # vi: set ft=python sts=4 ts=4 sw=4 et:
     3  ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
     4  #
     5  #   See COPYING file distributed along with the PyMVPA package for the
     6  #   copyright and license terms.
     7  #
     8  ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
     9  """Unit tests for PyMVPA MEG stuff"""
    10
    11  import unittest
    12  import os.path
    13
    14  from mvpa import pymvpa_dataroot
    15  from mvpa.base import externals
    16  from mvpa.misc.io.meg import TuebingenMEG
    17
    18 -class MEGTests(unittest.TestCase):
    19
    20 -    def testTuebingenMEG(self):
    21          if not externals.exists('gzip'):
    22              return
    23          meg = TuebingenMEG(os.path.join(pymvpa_dataroot, 'tueb_meg.dat.gz'))
    24
    25          # check basics
    26          self.failUnless(meg.channelids == ['BG1', 'MLC11', 'EEG02'])
    27          self.failUnless(meg.ntimepoints == 814)
    28          self.failUnless(meg.nsamples == 4)
    29          # check correct axis order (samples x channels x timepoints)
    30          self.failUnless(meg.data.shape == (4, 3, 814))
    31
    32          # check few values
    33          self.failUnless(meg.data[0, 1, 4] == -2.318207982e-14)
    34          self.failUnless(meg.data[3, 0, 808] == -4.30692876e-12)
    35
    36
    37 -def suite():
    38      return unittest.makeSuite(MEGTests)
    39
    40
    41  if __name__ == '__main__':
    42      import runner
    43