def _concatenate_coils(coils):
 rmags = np.concatenate([coil['rmag'] for coil in coils])
 cosmags = np.concatenate([coil['cosmag'] for coil in coils])
 ws = np.concatenate([coil['w'] for coil in coils])
 n_int = np.array([len(coil['rmag']) for coil in coils])
 if (n_int[(-1)] == 0):
  raise RuntimeError('not supported')
 bins = np.repeat(np.arange(len(n_int)), n_int)
 return (rmags, cosmags, ws, bins)

def _concatenate_coils ( coils ) : rmags = np . concatenate ( [ coil [ 'rmag' ] for coil in coils ] ) cosmags = np . concatenate ( [ coil [ 'cosmag' ] for coil in coils ] ) ws = np . concatenate ( [ coil [ 'w' ] for coil in coils ] ) n_int = np . array ( [ len ( coil [ 'rmag' ] ) for coil in coils ] ) if ( n_int [ ( - 1 ) ] == 0 ) : raise RuntimeError ( 'not supported' ) bins = np . repeat ( np . arange ( len ( n_int ) ) , n_int ) return ( rmags , cosmags , ws , bins )
helper to concatenate meg coil parameters .