(cls_new_order)
return cls_old_order
Reorder the cls from new order (by diagonal) to old order (by row).
    For example : TT, EE, BB, TE, EB, BB => TT, TE, TB, EE, EB, BB
Reorder the cls from new order (by diagonal) to old order (by row).
    For example : TT, EE, BB, TE, EB, BB => TT, TE, TB, EE, EB, BB
Reorder the cls from new order ( by diagonal ) to old order ( by row ) . For example : TT EE BB TE EB BB = > TT TE TB EE EB BB
def new_to_old_spectra_order(cls_new_order):
    """Reorder the cls from new order (by diagonal) to old order (by row).
    For example : TT, EE, BB, TE, EB, BB => TT, TE, TB, EE, EB, BB
    """
    Nspec = sphtlib._getn(len(cls_new_order))
    if Nspec < 0:
        raise ValueError("Input must be a list of n(n+1)/2 arrays")
    cls_old_order = []
    for i in range(Nspec):
        for j in range(i, Nspec):
            p = j - i
            q = i
            idx_new = p * (2 * Nspec + 1 - p) // 2 + q
            cls_old_order.append(cls_new_order[idx_new])
    return cls_old_order
def new_to_old_spectra_order ( cls_new_order ) : Nspec = sphtlib . _getn ( len ( cls_new_order ) ) if Nspec < 0 : raise ValueError ( "Input must be a list of n(n+1)/2 arrays" ) cls_old_order = [ ] for i in range ( Nspec ) : for j in range ( i , Nspec ) : p = j - i q = i idx_new = p * ( 2 * Nspec + 1 - p ) // 2 + q cls_old_order . append ( cls_new_order [ idx_new ] ) return cls_old_order