def savi(nir, red, L=0.5):
    """
    Compute Soil-adjusted Vegetation Index

        SAVI = (1+L)\\frac { NIR - RED } {NIR + RED + L}

    :param nir:     Near-Infrared band
    :param red:     Red band
    :param L:       soil brightness correction factor [0-1] (L=0 -> NDVI)
    :return:        SAVI
    """
    return (1 + L) * (nir - red) / (nir + red + L)