def atmospheric_pressure(z, temp = 293.15, lb = 6.5e-3):
    """
    Calculates atmospheric pressure at a given height.

    Parameters
    ----------
    z : float
        Altitude above sea level [m].
    temp : float, optional
        Meam atmospheric temperature [K]. The default is 288.15.
    lb : float, optional
        Temperature lapse rate [K / m] (i.e. how many Kelvin the temperature of air decreases
        with a 1 m increase in altitude). The default is 5e-3 K / m.
    
    Returns
    -------
    float
        Atmospheric pressure at altitude z.

    """
    p0, g, rd = 101325, 9.80665, 287.058
    power = -g / (rd * lb)
    return p0 * ((temp + lb * z) / temp) ** power