Functions to compute relative humidity, absolute humidity, wet bulb temperature, given pressure and absolute temperature.
Find a file
2026-08-11 18:13:20 +01:00
resources I have not yet got the overall architecture right, but the functions are 2026-08-09 13:32:32 +01:00
src/humidity I'm starting to hate the zed editor! Messups fixed, all tests again pass. 2026-08-11 18:13:20 +01:00
test/humidity I'm starting to hate the zed editor! Messups fixed, all tests again pass. 2026-08-11 18:13:20 +01:00
.gitignore Initial commit 2026-08-08 14:33:32 +00:00
LICENSE Initial commit 2026-08-08 14:33:32 +00:00
project.clj I have not yet got the overall architecture right, but the functions are 2026-08-09 13:32:32 +01:00
README.md More progress... but more things I need to calculate that I don't yet know how. 2026-08-11 13:59:22 +01:00

humidity

Functions to compute relative humidity, absolute humidity, wet bulb temperature, and other values related to humidity of air, given partial data.

General architecture

The packet

The 'packet', in the terminology of this library, is a map which has bindings for some of the following keywords:

  1. :actual-humidity
  2. `:actual-vapour-pressure
  3. :dew-point
  4. :pressure-pascals
  5. :pressure-millibars
  6. :saturation-pressure
  7. :relative-humidity
  8. :temperature
  9. :temperature-celsius
  10. :temperature-kelvin

These keywords represent variables in the pressure equations, and they are all to a degree inter-related; so if you have (or can assume) some of them, you can compute others.

Rather than having a mess of functions all of which call one another, which seemed likely to result in horrible messes and potential infinite recursion, there is one central function, humidity.core/resolution, which takes a partial package and repeatedly tries to compute the values for more variables until it can compute no more, and then returns the enhanced packet.

At present there are no checks to ensure that the packet makes sense.

Associated with each variable there is a namespace which takes a packet, and, if that packet contains enough information to compute that variable, returns a numeric value, else nil.