Units and conventions
Units
Every function uses these units, in scripts and in expressions alike:
| Quantity | Unit |
|---|---|
| Temperature | °C, valid from -100 to 200 °C |
| Pressure | Pa, absolute. Add atmospheric pressure to gauge readings |
| Relative humidity | %, 0 to 100 |
| Humidity ratio | kg water per kg dry air |
| Absolute humidity, density | kg/m³ |
| Enthalpy | J per kg dry air |
| Specific volume | m³ per kg dry air |
| Altitude | m, -1000 to 11000 |
Pressure is always an argument
Every function whose result depends on pressure takes the pressure as an argument, in Pa, absolute. At 1,700 m the air holds nearly a quarter more water per kilogram than at sea level, so assuming sea level gives wrong results at altitude.
When the site has no barometer, use pressureFromAltitude. It returns the standard atmosphere pressure at an altitude above sea level, using the ASHRAE equation:
p = system.psychro.pressureFromAltitude(1700)
A gauge reading, such as the pressure in a compressed air line, is not absolute: add atmospheric pressure to it first. See the compressed air example.
Some functions take no pressure argument, for example dewPoint, vaporPressure and absoluteHumidity. Each function's arguments are listed under script functions.
Relative humidity is relative to liquid water
Relative humidity is relative to liquid water at every temperature, including below 0 °C. This is the convention that most industrial RH sensors follow.
Below 0 °C
- Dew point and frost point. Below 0 °C,
dewPointis the dew point over supercooled water, andfrostPointis the frost point over ice.frostPointreturns the frost point when it is below 0 °C, and the dew point otherwise, so it always gives the temperature at which condensate first forms. - Ice bulb. Below 0 °C, the wet bulb is an ice bulb, as in ASHRAE. When air below 0 °C is supersaturated with respect to ice, which is possible while it is still below 100 % relative humidity over water, the ice bulb is slightly above the dry bulb.
- Near 0 °C. Just around 0 °C the two ASHRAE equations overlap, and some air states have both a wet bulb just above 0 °C and an ice bulb just below.
wetBulbreturns the wet bulb (liquid) value.
Errors
Invalid inputs raise an error instead of returning a wrong number, for example a relative humidity above 100 % or a pressure entered in kPa. In scripts the error is a java.lang.IllegalArgumentException:
from java.lang import IllegalArgumentException
try:
td = system.psychro.dewPoint(t, rh)
except IllegalArgumentException as e:
logger.warn(str(e))
Values outside the valid range from state()
state() returns every property in one call. When the dew point, frost point or wet bulb falls outside the valid range, for example a dew point below -100 °C at very low humidity, that value is None in the dictionary. The call itself only fails when the inputs are invalid.
Expression functions, quality and null inputs
Expression functions follow tag quality:
- The result carries the first input quality that is not good, so a bad sensor makes the result bad too.
- A null input gives a null result.
- An invalid input gives an expression error with the reason.