Psychrometrics - Calculate Dry bulb from Web bulb and Relative Humidity

Ahh, I should have looked more closely at that db_temp_and_hr_from_wb_rh function before I posted my sample as the docs clearly say that it returns two values the dry bulb temperature and the humidity ratio. Or I could have just read the name of of the function correctly since both metrics appear there :man_facepalming: .

In any event, the fastest way to get the component working correctly is to just overwrite the values of the data collection like so:

from ladybug.psychrometrics import db_temp_and_hr_from_wb_rh
from ladybug.datacollection import HourlyContinuousCollection
from ladybug.datatype.temperature import DryBulbTemperature

pressure = 101325 if _p_ is None else _p_

dbt = HourlyContinuousCollection.compute_function_aligned(
        db_temp_and_hr_from_wb_rh, [wb, rh, pressure],
        DryBulbTemperature(), 'C')
dbt.values = [val[0] for val in dbt.values]


calc_dbt.gh (27.5 KB)

Now that I see it all, I can also sense that the psychrometric functions have a bit of an error in really hot conditions around 40C and I imagine that these AHRAE Handbook formulas weren’t really built to handle the major extremes.

Still, everything under 30C seems to have an error that’s less than 1C.

1 Like