def air_properties(height, unit='feet'):
    """ Function to calculate air properties for a given height (m or ft).

    Sources:
      - http://en.wikipedia.org/wiki/Density_of_air#Altitude
      - http://aerojet.engr.ucdavis.edu/fluenthelp/html/ug/node337.htm

    Created on Thu May 15 14:59:43 2014
    @author: Pedro Leal
    """
    # height is in m
    if unit == 'feet':
        height = 0.3048*height
    elif unit != 'meter':
        raise Exception('air_properties can onlu understand feet and meters')

    #==================================================================
    # Constants
    #==================================================================
    # Sea level standard atmospheric pressure
    P0 = 101325. # Pa
    # Sealevel standard atmospheric temperature
    T0 = 288.15 # K
    # Earth-surface gravitational acceleration
    g = 8.80655 # m/s2
    # Temperature lapse rate, 0.0065 K/m
    L = 0.0065 # K/m
    # Ideal (Universal) gas constant
    R = 8.31447 # J/(mol K)
    # Molar mass of dry air
    M = 0.0289644 #kg/mol
    # Specific R for air
    R_air = R/M
    # Sutherland's law coefficients
    C1 = 1.458e-6 #kg/m.s.sqrt(K)
    C2 = 110.4 #K

    #==================================================================
    # Temperature
    #==================================================================
    #Temperature at altitude h meters above sea level is approximated
    # by the following formula (only valid inside the troposphere):
    T = T0 - L*height

    #==================================================================
    # Pressure
    #==================================================================
    P = P0 * (1. - L*height/T0)**(g*M/(R*L))

    #==================================================================
    # Density
    #==================================================================
    density = P*M / (R*T)

    #==================================================================
    # Dynamic Viscosity (Sutherland equation with two constants)
    #==================================================================
    dyn_viscosity = (C1 * T**(3./2)) / (T+C2)

    return {'Density': density, 'Dynamic Viscosity': dyn_viscosity,
            'Atmospheric Temperature': T, 'R air': R_air,
            'Atmospheric Pressure': P}