def potential_temp(t, pres, pres_ref=100000, k=0.286):
    """
    Calculate potential temperature

    Args:
        t (float) : temperature [K]
        pres (float) : pressure [Pa]
        pres_ref (float) : standard pressure [Pa]
        k : R / cp [ ]

    Returns:
        theta : potential temperature [K]

    """

    theta = t * (pres_ref / pres) ** k

    return theta