def _generate_spaxel_list(spectrum):
    """
    Generates a list wuth tuples, each one addressing the (x,y)
    coordinates of a spaxel in a 3-D spectrum cube.

    Parameters
    ----------
    spectrum : :class:`specutils.spectrum.Spectrum1D`
        The spectrum that stores the cube in its 'flux' attribute.

    Returns
    -------
    :list: list with spaxels
    """
    spx = [[(x, y) for x in range(spectrum.flux.shape[0])]
           for y in range(spectrum.flux.shape[1])]

    spaxels = [item for sublist in spx for item in sublist]

    return spaxels