def test_io_stc():
 tempdir = _TempDir()
 stc = _fake_stc()
 stc.save(op.join(tempdir, 'tmp.stc'))
 stc2 = read_source_estimate(op.join(tempdir, 'tmp.stc'))
 assert_array_almost_equal(stc.data, stc2.data)
 assert_array_almost_equal(stc.tmin, stc2.tmin)
 assert_equal(len(stc.vertices), len(stc2.vertices))
 for (v1, v2) in zip(stc.vertices, stc2.vertices):
  assert_array_almost_equal(v1, v2)
 assert_array_almost_equal(stc.tstep, stc2.tstep)

def test_io_stc ( ) : tempdir = _TempDir ( ) stc = _fake_stc ( ) stc . save ( op . join ( tempdir , 'tmp.stc' ) ) stc2 = read_source_estimate ( op . join ( tempdir , 'tmp.stc' ) ) assert_array_almost_equal ( stc . data , stc2 . data ) assert_array_almost_equal ( stc . tmin , stc2 . tmin ) assert_equal ( len ( stc . vertices ) , len ( stc2 . vertices ) ) for ( v1 , v2 ) in zip ( stc . vertices , stc2 . vertices ) : assert_array_almost_equal ( v1 , v2 ) assert_array_almost_equal ( stc . tstep , stc2 . tstep )
test io for stc files .