Skip to main content

Tools for Calculating Heat Stress

Project description

Heatindex

Tools for Calculating Heat Stress

This package currently provides a single function, heatindex, which is an implementation of the simpler and faster heat index introduced by Lu et al. (2025). This simpler and faster implementation matches the values of the heat index from Steadman (1979) and Lu and Romps (2022) for air temperatures above 300 K (27 C, 80 F) and with only minor differences at lower temperatures.

Installation

The recommended way to install heatindex is by using pip, the Python package installer.

Recommended

Open your terminal or command prompt and run the following command:

pip install heatindex

This will download and install the latest stable version of heatindex from the Python Package Index (PyPI).

Manual

Alternatively, clone the repository and install it locally:

git clone https://github.com/romps/heatindex
cd heatindex/python
./prepare_package.sh
pip install .

The source code for this package is located in heatindex/cpp. Running prepare_package.sh creates hard links in heatindex/python/src to the source files.

Usage and examples

The heatindex function takes two arguments: air temperature (Ta) in Kelvin and relative humidity (RH) on a scale from 0 to 1, and returns the heat index in Kelvin. Note that the relative humidity is defined with respect to saturation over liquid water for air temperatures over 273.16 K and with respect to saturation over ice for air temperatures lower than 273.16 K.

For example:

>>> import heatindex as hi
>>> hi.heatindex(310,0.5)
318.62255317071686

Note: The precision of the underlying root solver is set to 1e-8, so the output is reliable up to the seventh decimal place.

The heatindex function is vectorized using NumPy, enabling efficient element-wise computations. For example, when Ta and RH are lists of three elements, the result is a Numpy array of length 3:

>>> Ta = [310,311,312]
>>> RH = [0,0.5,1]
>>> hi.heatindex(Ta,RH)
array([305.55495303, 324.54442932, 368.60533913])

If one argument is an array and the other a scalar, NumPy broadcasting applies:

>>> Ta = [310,311,312]
>>> RH = 1
>>> hi.heatindex(Ta,RH)
array([359.90632483, 364.20412564, 368.60533913])

When both Ta and RH are arrays (or matrices), they must have identical shapes:

>>> Ta = [[310,311],[312,313]]
>>> RH = [[0,1],[0,1]]
>>> hi.heatindex(Ta,RH)
array([[305.55495303, 364.20412564],
       [307.05336139, 373.11024873]])

Authors

Citation

To cite package heatindex in publications use:

Lu, Y.-C. and Romps, D.M., 2025. heatindex: Tools for Calculating Heat Stress. https://heatindex.org.

A BibTeX entry for LaTeX users is

 @Manual{heatindex2025,
  title = {heatindex: Tools for Calculating Heat Stress},
  author = {Yi-Chuan Lu and David M. Romps},
  year = {2025},
  note = {Python package version 0.0.1},
  url = {https://heatindex.org},
 }

References

  1. Lu et al., "Simpler and faster: an improved heat index," in review (2025).
  2. Steadman, R.G., 1979. The assessment of sultriness. Part I: A temperature-humidity index based on human physiology and clothing science. Journal of Applied Meteorology and Climatology, 18(7), pp.861-873.
  3. Lu, Y.-C. and Romps, D.M., 2022. Extending the heat index. Journal of Applied Meteorology and Climatology, 61(10), pp.1367-1383.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

heatindex-0.0.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

heatindex-0.0.1-cp313-cp313-macosx_15_0_arm64.whl (55.3 kB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

File details

Details for the file heatindex-0.0.1.tar.gz.

File metadata

  • Download URL: heatindex-0.0.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for heatindex-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9db1d9666f19ddbdb82f69f7336960268dc48e115c2d36fe7553051c9d466afc
MD5 99090055ec00b731043c2734e7686e3c
BLAKE2b-256 fae600971bd8c8d07741b05e86bd43f53a1509771f21baba56a65a7701c77bb4

See more details on using hashes here.

File details

Details for the file heatindex-0.0.1-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for heatindex-0.0.1-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a544232b941fbf65ea6b46112d256031c97eaa6ae83dce0b9a4d1785a85e48ac
MD5 c76885a9002dc3269ac26fd274921e66
BLAKE2b-256 d4a6591574e532c985dfb7f29123222a77f00ccf9d0a6635f643f374226466ec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page