Density altitude calculation

This calculation is based upon the NOAA method detailed in the following article:

NOAA density altitude calculation

Note that density altitude is most sensitive to errors in temperature, then pressure and finally dew point. That is to say that dew point has a far lesser impact on density altitude than temperature. The ratio of error magnitude - Temperature : Pressure : Dew point is of the order 8.4 : 3.5 : 1

A further observation is that low temperatures combined with high pressures result in low density altitude.

Before calculating density altitude, the virtual temperature `T _{v}` must be calculated. The air
temperature

First of all vapour pressure `e` is calculated:

Then station pressure in hectopascals `P _{hPa}` is used to calculate the virtual temperature

Now we need to convert virtual temperature units from Kelvin to Rankine `T _{r}` :

Finally density altitude is calculated using station pressure in inches of mercury `P _{inHg}` :