def compute_rank_inverse(inv):
 eig = inv['noise_cov']['eig']
 if (not inv['noise_cov']['diag']):
  rank = np.sum((eig > 0))
 else:
  ncomp = make_projector(inv['projs'], inv['noise_cov']['names'])[1]
  rank = (inv['noise_cov']['dim'] - ncomp)
 return rank

def compute_rank_inverse ( inv ) : eig = inv [ 'noise_cov' ] [ 'eig' ] if ( not inv [ 'noise_cov' ] [ 'diag' ] ) : rank = np . sum ( ( eig > 0 ) ) else : ncomp = make_projector ( inv [ 'projs' ] , inv [ 'noise_cov' ] [ 'names' ] ) [ 1 ] rank = ( inv [ 'noise_cov' ] [ 'dim' ] - ncomp ) return rank
compute the rank of a linear inverse operator .