def corr_index(idx, n):
    """
    Gets the index of the auto spectrum when getting all
    pairwise combinations of n maps.

    Arguments
    ---------
    idx : int
        The index of the map in the list of maps being looped through.
    n : int
        The number of maps being looped through.

    Returns
    -------
    index : int
        Index of auto spectrum
    """
    return idx * n - idx * (idx - 1) // 2