def _write_stc(filename, tmin, tstep, vertices, data):
 fid = open(filename, 'wb')
 fid.write(np.array((1000 * tmin), dtype='>f4').tostring())
 fid.write(np.array((1000 * tstep), dtype='>f4').tostring())
 fid.write(np.array(vertices.shape[0], dtype='>u4').tostring())
 fid.write(np.array(vertices, dtype='>u4').tostring())
 fid.write(np.array(data.shape[1], dtype='>u4').tostring())
 fid.write(np.array(data.T, dtype='>f4').tostring())
 fid.close()

def _write_stc ( filename , tmin , tstep , vertices , data ) : fid = open ( filename , 'wb' ) fid . write ( np . array ( ( 1000 * tmin ) , dtype = '>f4' ) . tostring ( ) ) fid . write ( np . array ( ( 1000 * tstep ) , dtype = '>f4' ) . tostring ( ) ) fid . write ( np . array ( vertices . shape [ 0 ] , dtype = '>u4' ) . tostring ( ) ) fid . write ( np . array ( vertices , dtype = '>u4' ) . tostring ( ) ) fid . write ( np . array ( data . shape [ 1 ] , dtype = '>u4' ) . tostring ( ) ) fid . write ( np . array ( data . T , dtype = '>f4' ) . tostring ( ) ) fid . close ( )
write an stc file .