def delta_lambda(wing_idxs, wavelengths):
    """
    Calculates the half-width in an intensity range i.e. there are N indices spanning a wing then the half-width is half of those indices multiplied by the change in wavelength between two entries. N.B. this is only the case when the space in the spectral axis is uniform.

    .. math::
       \delta \lambda = \\frac{N}{2} \\times (\Delta \lambda)

    where :math:`\Delta \lambda` is the difference in wavelength of two spectral points.

    Parameters
    ----------
    wing_idxs : range
        The indices of the spectral line corresponding to the wing of interest.
    wavelengths : numpy.ndarray
        The wavelengths to integrate over.
    """

    return len(wing_idxs) * (wavelengths[1] - wavelengths[0]) / 2