def _get_best_axes(first_pos, axes):
    "\n    Determine the best pair of inertial axes so that we don't get large-scale breakdowns from the choice of embedding\n\n    :param first_pos:\n    :type first_pos:\n    :param axes:\n    :type axes:\n    :return:\n    :rtype:\n    "
    if (axes.ndim > 2):
        axes = axes[..., (0, 1), :]
        ax_choice = (0, 1)
        ax_names = ['A', 'B']
    else:
        fp_norm = np.linalg.norm(first_pos)
        if (fp_norm > 1e-10):
            first_pos = (first_pos / fp_norm)
            a_proj = np.dot(first_pos, axes[0])
            b_proj = np.dot(first_pos, axes[1])
            c_proj = np.dot(first_pos, axes[2])
            if (np.abs(b_proj) < 0.05):
                if (np.abs(a_proj) > 0.95):
                    ax_choice = (1, 2)
                    ax_names = ['B', 'C']
                else:
                    ax_choice = (0, 1)
                    ax_names = ['A', 'B']
            elif (np.abs(c_proj) < 0.05):
                if (np.abs(a_proj) > 0.95):
                    ax_choice = (1, 2)
                    ax_names = ['B', 'C']
                else:
                    ax_choice = (0, 2)
                    ax_names = ['A', 'C']
            elif (np.abs(a_proj) < 0.05):
                if (np.abs(b_proj) > 0.95):
                    ax_choice = (0, 2)
                    ax_names = ['A', 'C']
                else:
                    ax_choice = (0, 1)
                    ax_names = ['A', 'B']
            else:
                ax_choice = (0, 1)
                ax_names = ['A', 'B']
        else:
            ax_choice = (0, 1)
            ax_names = ['A', 'B']
        axes = axes[(ax_choice,)]
    return (axes, ax_names, ax_choice)
Determine the best pair of inertial axes so that we don't get large-scale breakdowns from the choice of embedding

:param first_pos:
:type first_pos:
:param axes:
:type axes:
:return:
:rtype:
def _get_best_axes(first_pos, axes):
    "\n    Determine the best pair of inertial axes so that we don't get large-scale breakdowns from the choice of embedding\n\n    :param first_pos:\n    :type first_pos:\n    :param axes:\n    :type axes:\n    :return:\n    :rtype:\n    "
    if (axes.ndim > 2):
        axes = axes[..., (0, 1), :]
        ax_choice = (0, 1)
        ax_names = ['A', 'B']
    else:
        fp_norm = np.linalg.norm(first_pos)
        if (fp_norm > 1e-10):
            first_pos = (first_pos / fp_norm)
            a_proj = np.dot(first_pos, axes[0])
            b_proj = np.dot(first_pos, axes[1])
            c_proj = np.dot(first_pos, axes[2])
            if (np.abs(b_proj) < 0.05):
                if (np.abs(a_proj) > 0.95):
                    ax_choice = (1, 2)
                    ax_names = ['B', 'C']
                else:
                    ax_choice = (0, 1)
                    ax_names = ['A', 'B']
            elif (np.abs(c_proj) < 0.05):
                if (np.abs(a_proj) > 0.95):
                    ax_choice = (1, 2)
                    ax_names = ['B', 'C']
                else:
                    ax_choice = (0, 2)
                    ax_names = ['A', 'C']
            elif (np.abs(a_proj) < 0.05):
                if (np.abs(b_proj) > 0.95):
                    ax_choice = (0, 2)
                    ax_names = ['A', 'C']
                else:
                    ax_choice = (0, 1)
                    ax_names = ['A', 'B']
            else:
                ax_choice = (0, 1)
                ax_names = ['A', 'B']
        else:
            ax_choice = (0, 1)
            ax_names = ['A', 'B']
        axes = axes[(ax_choice,)]
    return (axes, ax_names, ax_choice)