def psychrometrics (Tdb_in, w_in, P):
<EOL>c_air = <NUM_LIT>   <EOL>hlg = <NUM_LIT>  <EOL>cw  = <NUM_LIT>     <EOL>P = P/<NUM_LIT>     <EOL>Tdb = Tdb_in - <NUM_LIT><EOL>w = w_in<EOL>Pw = (w*P)/(<NUM_LIT> + w)                             <EOL>Pws = saturation_pressure(Tdb)                        <EOL>phi = Pw/Pws*<NUM_LIT><EOL>h = c_air*Tdb + w*(hlg+cw*Tdb)                      <EOL>v = <NUM_LIT> * (Tdb+<NUM_LIT>)*(<NUM_LIT:1>+<NUM_LIT>*w)/P        <EOL>_pw = (w*P)/(<NUM_LIT> + w) <EOL>alpha = log(_pw)<EOL>Tdp = <NUM_LIT> + <NUM_LIT>*alpha + pow(alpha,<NUM_LIT:2>)*<NUM_LIT> + pow(alpha,<NUM_LIT:3>)*<NUM_LIT> + pow(_pw,<NUM_LIT>)*<NUM_LIT>  <EOL>return  Tdb, w, phi, h, Tdp, v<EOL>
Modified version of Psychometrics by Tea Zakula
MIT Building Technology Lab
Input: Tdb_in, w_in, P
Output: Tdb, w, phi, h, Tdp, v

where:
Tdb_in = [K] dry bulb temperature
w_in = [kgv/kgda] Humidity Ratio
P = [P] Atmospheric Station Pressure

Tdb: [C] dry bulb temperature
w: [kgv/kgda] Humidity Ratio
phi: [Pw/Pws*100] relative humidity
Tdp: [C] dew point temperature
h: [J/kga] enthalpy
v: [m3/kga] specific volume