def write_head_pos(fname, pos):
 _check_fname(fname, overwrite=True)
 pos = np.array(pos, np.float64)
 if ((pos.ndim != 2) or (pos.shape[1] != 10)):
  raise ValueError('pos must be a 2D array of shape (N, 10)')
 with open(fname, 'wb') as fid:
  fid.write(' Time       q1       q2       q3       q4       q5       q6       g-value  error    velocity\n'.encode('ASCII'))
  for p in pos:
   fmts = (['% 9.3f'] + (['% 8.5f'] * 9))
   fid.write((((' ' + ' '.join(fmts)) + '\n') % tuple(p)).encode('ASCII'))

def write_head_pos ( fname , pos ) : _check_fname ( fname , overwrite = True ) pos = np . array ( pos , np . float64 ) if ( ( pos . ndim != 2 ) or ( pos . shape [ 1 ] != 10 ) ) : raise ValueError ( 'pos must be a 2D array of shape (N, 10)' ) with open ( fname , 'wb' ) as fid : fid . write ( ' Time       q1       q2       q3       q4       q5       q6       g-value  error    velocity\n' . encode ( 'ASCII' ) ) for p in pos : fmts = ( [ '% 9.3f' ] + ( [ '% 8.5f' ] * 9 ) ) fid . write ( ( ( ( ' ' + ' ' . join ( fmts ) ) + '\n' ) % tuple ( p ) ) . encode ( 'ASCII' ) )
write maxfilter-formatted head position parameters .