def karel_air_from_saturation(Sr, qfit=0.5):
    """Relative air peremability (w.r.t. dry_ka)

    krel = (1-Sr)**0.5*(1-Sr**(1 / qfit))**(2*qfit)

    Parameters
    ----------
    Sr : 1d array of float
        Degree of saturation at which to calc relative permeability of air.
    qfit : float, optional
        Fitting parameter.  Generally between between 0 and 1.
        Default qfit=1

    References
    ----------
    .. [1] Ba-Te, B., Limin Zhang, and Delwyn G. Fredlund. "A General
           Air-Phase Permeability Function for Airflow through Unsaturated
           Soils." In Proceedings of Geofrontiers 2005 Cngress,
           2961-85. Austin, Tx: ASCE, 2005. doi:10.1061/40787(166)29.

    """
    return (1 - Sr) ** 0.5 * (1 - Sr ** (1 / qfit)) ** (2 * qfit)
