Skip to main content

PET Adjusted

Street-level heat-stress maps for cities.

pet-adjusted computes the Physiological Equivalent Temperature (PET) on a fine grid (typically 1 m) for any hour of a summer day.

PET is the air temperature of a standard indoor room in which a person would feel the same heat stress as outdoors. It combines four variables, each of which changes from street to street:

  • air temperature;
  • humidity;
  • wind;
  • radiation, through the mean radiant temperature (Tmrt).

The inputs are:

  • Maps: a DSM, a DEM, a land-cover map and NDVI;
  • Weather: hourly data from one reference weather station;
  • Subject: the attributes of a person (activity, clothing, age, sex, weight, height).

Why "adjusted"

Weather stations measure air temperature and wind in open, rural surroundings, at a standard height of 10 m for wind. Applying PET to those values directly describes conditions on an airfield, not in a street. This package adjusts every input to the conditions a pedestrian actually experiences at that location:

Input Station value Adjusted to
Wind speed 10 m, open terrain 1.2 m (the height of a person's centre of gravity), slowed down by the buildings and trees upwind. The MacDonald method uses the local morphology: the frontal area of buildings and trees and their mean height, over a source area oriented to the wind direction.
Air temperature rural rural plus the local urban heat island. It is scaled by the sky-view factor and green fraction of the area upwind and by the day's weather, and follows the typical daily cycle of the heat island.
Mean radiant temperature – computed per cell from sun position, shadows of buildings and trees, sky-view factor and ground surface (land cover), with SOLWEIG.
Person standard PET reference person your own subject: activity, clothing, age, sex, weight, height, posture.

The wind and air-temperature adjustments follow the Dutch standardized PET heat map (Koopmans et al. 2020, supplementary material B2 and B5). Here they are computed from the rasters for every cell and any wind direction. PET is then solved with the full physical model (MEMI), not the regression equations used for the original map.

Components

  • PET: a GPU port of pythermalcomfort.models.pet_steady (Höppe's MEMI with the Walther & Goestchel corrections). It uses the same equations and is tested to give the same results.
  • Air temperature: station temperature plus the urban heat island (Eqs. S.3–S.4, Tables S.3–S.4 of Koopmans et al. 2020; UHImax after Theeuwes et al. 2017).
  • Wind speed: the station's 10 m wind brought down to 1.2 m in the urban canopy (Eqs. S.6–S.14, Table S.5 of Koopmans et al. 2020; after Macdonald 2000).
  • Sky-view factor: horizon search on the DSM (port of the Relief Visualization Toolbox).
  • Mean radiant temperature: SOLWEIG-GPU with land cover.

Everything runs on a CUDA GPU when one is available: CuPy for PET, wind, air temperature and sky-view factor, and PyTorch for SOLWEIG-GPU. Without a GPU it falls back to NumPy, which is much slower.

Install

With pip:

pip install pet-adjusted                 # CPU only
pip install "pet-adjusted[cuda]"         # + CuPy for CUDA 13 GPUs (driver 580+); for CUDA 12 use: pip install cupy-cuda12x

For Tmrt with SOLWEIG-GPU, install CUDA PyTorch and GDAL first. pip cannot get them by itself: PyPI's PyTorch is CPU-only on Windows, and PyPI's GDAL is source code only.

pip install torch --index-url https://download.pytorch.org/whl/cu130
# GDAL, one of:
#   Windows: pip install <the gdal wheel for your Python from https://github.com/cgohlke/geospatial-wheels/releases>
#   Linux:   sudo apt install libgdal-dev && pip install "gdal==$(gdal-config --version)"
#   Any OS:  conda install -c conda-forge gdal   (then pip install the rest in that conda environment)
pip install "pet-adjusted[cuda,solweig]"

From a clone of the repository, uv does all of this itself ([tool.uv.sources] in pyproject.toml points to the CUDA PyTorch index and, on Windows with Python 3.12, to Gohlke's GDAL wheel):

uv sync --extra cuda --extra solweig

Usage

Step-by-step guide: docs/guide.md. It covers where to get the DSM/DEM, land cover, NDVI and weather data, how to put them on one grid, and how to describe the person. examples/run_pet.py runs everything from GeoTIFFs and a weather CSV.

from datetime import date
from pet_adjusted import pet_map, read_raster, write_raster

if __name__ == "__main__":  # needed on Windows: SOLWEIG-GPU uses process pools
    dsm, cell, origin, epsg = read_raster("data/dsm.tif")  # all four on the same grid
    dem, landcover, ndvi = (read_raster(f"data/{n}.tif")[0] for n in ("dem", "landcover", "ndvi"))
    weather = dict(hour_utc=..., t_ref=..., rh=..., ff10=..., wind_dir=..., kdown=...)  # 24 hourly values each
    subject = dict(met=2.0, clo=0.5, age=35, sex="female", weight=60, height=1.65, position="standing")
    pet, tmrt = pet_map(dsm, dem, landcover, ndvi, cell, origin, epsg, date(2026, 7, 15),
                        weather, subject, workdir="data/solweig_run")  # (24, rows, cols) each
    write_raster("data/pet.tif", pet, cell, origin, epsg)

Land cover uses the UMEP codes: 1 paved, 2 building, 5 grass, 6 bare soil, 7 water. SOLWEIG-GPU needs consecutive hours (ideally the whole day), because it carries ground temperature over from one hour to the next.

What is derived from the rasters:

Input From
object height DSM − DEM
buildings object height > 2 m and land cover 2 (without land cover: NDVI ≤ 0.16)
trees object height > 2 m, NDVI > 0.16, not a building
vegetation, water NDVI > 0.16; land cover 7 (without land cover: NDVI < 0)
ground albedo, emissivity, surface temperature for Tmrt land cover (SOLWEIG)
Svf, Fveg for UHImax Svf from the DSM without buildings, water and vegetation, on 25 m tiles, averaged over the 500 × 1100 m upwind source area (700 × 700 m when ff10 < 1.5 m/s)
λ buildings, λ trees, H for the wind frontal areas and mean obstacle height over the 280 × 140 m source area (175 × 175 m when ff10 < 1.5 m/s)

The individual steps are public too: solweig_tmrt, urban_pet_from_rasters, sky_view_factor, uhi_inputs, wind_inputs, urban_air_temperature, urban_wind_speed, pet_steady, and urban_pet (for when you already have Svf, Fveg, λ and H). Pass device="cpu" or device="gpu" to choose the backend; the default is "auto".

Quick test: any place in the Netherlands

The pet-nl command makes a PET map for any Dutch address or place. It downloads the open data it needs:

  • AHN heights;
  • BGT land cover;
  • the PDOK infrared aerial photo;
  • hourly weather from the nearest KNMI station that measures radiation.

It asks for the place, date, hours and person. Press Enter to keep a default.

uv sync --extra cuda --extra solweig
uv run pet-nl
Place or address (or x,y in EPSG:28992) [Oude Markt, Enschede]: Domplein, Utrecht
Size of the square area [m] [300.0]:
Date (YYYY-MM-DD, April-September) [2025-07-02]:
UTC hours (e.g. 14, 10-16, all) [all]: 14
Subject (Enter keeps the default):
  activity [met] (1.0 seated, 1.2 standing, 2.0 walking) [2.0]:
  ...

You can also pass everything as options, for example pet-nl --place "Domplein, Utrecht" --date 2025-07-02 --hours 14 --met 1.2 --clo 0.5 (see pet-nl --help). The same works from Python:

from datetime import date
from pet_adjusted import pet_netherlands

if __name__ == "__main__":  # required on Windows
    pet, tmrt = pet_netherlands("Domplein, Utrecht", date(2025, 7, 2), {"met": 2.0, "clo": 0.5}, hours=[14])

The results go to pet_nl/:

  • pet.tif and tmrt.tif, one band per hour, with roofs as nodata;
  • pet.png, a figure of the hottest hour;
  • the downloaded inputs.

A 300 × 300 m area takes about 6 minutes on a laptop GPU.

Example: Enschede city centre on 2 July 2025, 14:00 UTC (36.7 °C at KNMI Twente).

PET and Tmrt in Enschede city centre

Shade from street trees and buildings lowers PET by 5–10 °C compared with open, sunlit squares. See examples/enschede for every step and how to read the results. For places outside the Netherlands, prepare the rasters yourself with the guide and call pet_map.

Performance

1 million PET points take about 40 s on an RTX 4050 laptop GPU. pythermalcomfort solves one point at a time and would take hours. Most points are solved with a vectorised Newton method. The roughly 0.5% where the equations have kinks (sweating limits) are solved with SciPy's fsolve, the same way pythermalcomfort solves them.

Limitations

  • solweig_tmrt has only been tested with rasters that fit in one SOLWEIG tile (3600 × 3600 cells by default). Larger rasters are put back together from tiles by their georeferencing, but this is untested.
  • SOLWEIG-GPU 2.0 applies its fixed water surface temperature to land-cover code 3 instead of 7, so water (7) gets the water albedo and emissivity but not that temperature. Do not use codes 3/4 (see the guide).
  • Daily Tmax/Tmin, radiation and wind for Eq. S.3 come from the given day's hours; the paper uses 08 UTC to 07 UTC the next day (pass them in weather to override).
  • Cropland is not treated as vegetation unless its NDVI is above 0.16.
  • The frontal area of a cell is its rise in height from the upwind neighbour × the cell width. This is exact for N/E/S/W winds and approximate for other directions.
  • The diurnal UHI tables only cover 1 April – 30 September, with sunrise and sunset times for the Netherlands.

How to cite

If you use pet-adjusted, please cite the software:

Cárdenas-León, I. (2026). PET-Adjusted: Urban Physiological Equivalent Temperature adjusted to urban morphology conditions (Version 0.1.0) [Computer software]. https://github.com/ivan-cardenas/PET-Adjusted

GitHub's "Cite this repository" button gives the same reference in APA and BibTeX, from CITATION.cff.

@software{cardenas_pet_adjusted_2026,
  author  = {Cárdenas-León, Ivan},
  title   = {PET-Adjusted: Urban Physiological Equivalent Temperature adjusted to urban morphology conditions},
  year    = {2026},
  version = {0.1.0},
  url     = {https://github.com/ivan-cardenas/PET-Adjusted},
  license = {GPL-3.0-or-later}
}

Please also cite the methods it builds on:

  • Koopmans et al. (2020), for the wind and air-temperature adjustment;
  • Tartarini & Schiavon (2020), for pythermalcomfort;
  • Kamath et al. (2026) and Lindberg et al. (2008), for SOLWEIG-GPU and SOLWEIG.

See Credits for the full references.

Licence

GPL-3.0-or-later (see LICENSE), compatible with SOLWEIG-GPU (GPL-3.0).

Credits

  • PET implementation: Tartarini, F., Schiavon, S. (2020). pythermalcomfort: A Python package for thermal comfort research. SoftwareX, 12, 100578. https://doi.org/10.1016/j.softx.2020.100578
  • PET model: Höppe, P. (1999). Int. J. Biometeorol., 43, 71–75; corrected by Walther, E., Goestchel, Q. (2018). Building and Environment, 137, 1–26.
  • Tmrt: Kamath, H. G., Sudharsan, N., Singh, M., Wallenberg, N., Lindberg, F., Niyogi, D. (2026). SOLWEIG-GPU: GPU-Accelerated Thermal Comfort Modeling Framework for Urban Digital Twins. Journal of Open Source Software, 11(118), 9535. https://doi.org/10.21105/joss.09535
  • SOLWEIG: Lindberg, F., Holmer, B., Thorsson, S. (2008). SOLWEIG 1.0 – Modelling spatial variations of 3D radiant fluxes and mean radiant temperature in complex urban settings. Int. J. Biometeorol., 52, 697–713. https://doi.org/10.1007/s00484-008-0162-7
  • UMEP: Lindberg, F., Grimmond, C. S. B., Gabey, A., et al. (2018). Urban Multi-scale Environmental Predictor (UMEP): An integrated tool for city-based climate services. Environmental Modelling & Software, 99, 70–87. https://doi.org/10.1016/j.envsoft.2017.09.020
  • Windows GDAL wheels: Gohlke, C. geospatial-wheels. https://github.com/cgohlke/geospatial-wheels
  • Sky-view factor: Zakšek, K., Oštir, K., Kokalj, Ž. (2011). Remote Sensing, 3, 398–415; Kokalj, Ž., Zakšek, K., Oštir, K. (2011). Antiquity, 85, 263–273 (Relief Visualization Toolbox).
  • Wind and air-temperature adjustment (standardized Dutch PET heat map): Koopmans, S., Heusinkveld, B. G., Steeneveld, G. J. (2020). A standardized Physical Equivalent Temperature urban heat map at 1-m spatial resolution to facilitate climate stress tests in the Netherlands. Building and Environment, 181, 106984. https://doi.org/10.1016/j.buildenv.2020.106984 (supplementary material B2, B5).
  • UHImax equation: Theeuwes, N. E., et al. (2017). Int. J. Climatol., 37, 443–454.
  • Urban wind profile: Macdonald, R. W. (2000). Boundary-Layer Meteorology, 97, 25–45.

Metadata

Release files for pet-adjusted 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pet-adjusted 0.1.5
File Size Uploaded Provenance Actions
pet_adjusted-0.1.5.tar.gz 47.9 kB With provenance Details for pet_adjusted-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pet-adjusted 0.1.5
File Interpreter ABI Platform Actions
pet_adjusted-0.1.5-py3-none-any.whl Python 3 none any Details for pet_adjusted-0.1.5-py3-none-any.whl

Total release size: 94.2 kB

Release files / pet_adjusted-0.1.5.tar.gz

Download URL pet_adjusted-0.1.5.tar.gz
Size 47.9 kB
Tags Source
SHA-256 checksum
How to use checksums
25575c85b72e10bbfcac63a4751b7e467381b49bcf4850ffb6b056287479d646
BLAKE2b-256 checksum
How to use checksums
36a9a15e66d05436e0fbb3b3472ffc5cbf73c038a0bf5cf02acaefba1713ca5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / pet_adjusted-0.1.5-py3-none-any.whl

Download URL pet_adjusted-0.1.5-py3-none-any.whl
Size 46.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7bd6844871dc8b6c956894cc748a5e319cf180e69c182c752e3f1fec66d05d40
BLAKE2b-256 checksum
How to use checksums
654ddc08abf7748770e277723fb857eaf18856705781c701b12075ba2b3eb4e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for pet-adjusted 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pet_adjusted-0.1.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page