def Landsat_L_lambda(Lmin, Lmax, ls_data, index, Landsat_nr):
    """
    Calculates the lambda from landsat
    """
    if Landsat_nr == 8:
        L_lambda = (Lmax[index] - Lmin[index]) / (65535 - 1) * ls_data + Lmin[
            index]
    elif Landsat_nr == 5 or Landsat_nr == 7:
        L_lambda = (Lmax[index] - Lmin[index]) / 255 * ls_data + Lmin[index]
    return L_lambda
