Skip to main content

Examples

Quick start​

In any script (gateway, Perspective, Vision client, Designer):

p = system.psychro.pressureFromAltitude(1700) # site has no barometer
system.psychro.dewPoint(25, 50) # 13.864 °C
system.psychro.wetBulb(25, 50, p) # 17.402 °C
system.psychro.state(25, 50, p)["humidityRatio"] # 0.01218 kg/kg dry air

In an expression tag or binding, straight from two sensor tags:

psychroDewPoint({[.]AirTemp}, {[.]AirRH})

A site without a barometer​

Every function whose result depends on pressure needs the absolute pressure. When the site has no barometer, use the standard atmosphere pressure at the site's altitude:

p = system.psychro.pressureFromAltitude(1700)
system.psychro.wetBulb(25, 50, p) # 17.402 °C

Do not leave out the altitude and assume sea level: at 1,700 m the air holds nearly a quarter more water per kilogram than at sea level. See units and conventions.

Compressed air dew point​

dewPointAtPressure converts between atmospheric dew point and pressure dew point in compressed air. A 3 °C pressure dew point at 7 bar(g) is about -23 °C at atmospheric pressure.

Both pressures must be absolute, so add atmospheric pressure to the gauge reading. 7 bar is 700,000 Pa:

p_atm = system.psychro.pressureFromAltitude(0) # sea level
p_line = p_atm + 700000 # 7 bar(g), as absolute pressure
system.psychro.dewPointAtPressure(3, p_line, p_atm) # about -23 °C

p_atm must be the site's atmospheric pressure. This example uses sea level; at a site above sea level, use a barometer reading or pressureFromAltitude with the site's altitude.