def computeAirProperties(T, p, pInhPa=False):
    """ Calculates air density in kg/m3 and viscosity in m2/s given pressure
    in mmHg and temperature in deg C. Can also specify pressure in hPa with the flag."""
    mmHgTohPa = 1.3332239
    if pInhPa:
        p = p/mmHgTohPa
    
    # from engineering toolbox:
    # http://www.engineeringtoolbox.com/air-temperature-pressure-density-d_771.html
    rho = 1.325 * p/25.4 / ((T+273.15)*9/5) * 16.0185
    
    # from Sutherland equation:
    # http://www-mdp.eng.cam.ac.uk/web/library/enginfo/aerothermal_dvd_only/aero/fprops/propsoffluids/node5.html
    mu = 1.458e-6 * (T+273.15)**(3./2.) / ((T+273.15) + 110.4)
    
    # Alternative air density calculations as a function of temperature and pressure
    """
    # pressure is in mmHg, temperature in deg C
    # 1 mmHg = 133.322368 Pa
    # T_R = (T_C = 273.15) * 9/5
    
    # from Wikipedia: https://en.wikipedia.org/wiki/Density_of_air
    R = 287.058 # J / (kg K)
    rho0 = (p * 133.322368) / (R * (T+273.15))
    
    # from engineering toolbox: http://www.engineeringtoolbox.com/air-temperature-pressure-density-d_771.html
    rho1 = 1.325 * p/25.4 / ((T+273.15)*9/5) * 16.0185
    """
    return rho, mu/rho