Skip to main content

High-performance SOLWEIG urban microclimate model (Rust + Python)

Project description

SOLWEIG

Map how hot it feels across a city — pixel by pixel.

SOLWEIG computes Mean Radiant Temperature (Tmrt) and thermal comfort indices (UTCI, PET) for urban environments. Give it a building height model and weather data, and it produces high-resolution maps showing where people experience heat stress — and where trees, shade, and cool surfaces make a difference.

Built on Rust for speed, with optional GPU acceleration. Handles everything from a single city block to an entire district.

Status: Beta (v0.1.0). The API is stabilising. Feedback and bug reports welcome — open an issue.

What can you do with it?

  • Urban planning — Compare street canyon designs, tree planting scenarios, or cool-roof strategies by mapping thermal comfort before and after.
  • Heat risk assessment — Identify the hottest spots in a neighbourhood during a heatwave, hour by hour.
  • Research — Run controlled microclimate experiments at 1 m resolution with full radiation budgets.
  • Climate services — Generate thermal comfort maps for public health warnings or outdoor event planning.

How it works (in brief)

SOLWEIG models the complete radiation budget experienced by a person standing in an urban environment:

  1. Shadows — Which pixels are shaded by buildings and trees at a given sun angle?
  2. Sky View Factor — How much sky can a person see from each point? (More sky = more incoming radiation.)
  3. Surface temperatures — How hot are the ground and surrounding walls?
  4. Radiation balance — Sum shortwave (sun) and longwave (heat) radiation from all directions.
  5. Tmrt — Convert total absorbed radiation into a single "felt temperature" metric.
  6. Thermal comfort — Optionally derive UTCI or PET, which combine Tmrt with air temperature, humidity, and wind.

Quick start

Install

pip install solweig

Minimal example (numpy arrays)

import numpy as np
import solweig
from datetime import datetime

# A flat surface with one 15 m building
dsm = np.full((200, 200), 2.0, dtype=np.float32)
dsm[80:120, 80:120] = 15.0

surface = solweig.SurfaceData(dsm=dsm, pixel_size=1.0)
# SVF is required before calculate(); compute once and reuse
surface.compute_svf()

location = solweig.Location(latitude=48.8, longitude=2.3, utc_offset=1)  # Paris
weather = solweig.Weather(
    datetime=datetime(2025, 7, 15, 14, 0),
    ta=32.0,          # Air temperature (°C)
    rh=40.0,          # Relative humidity (%)
    global_rad=850.0, # Solar radiation (W/m²)
)

result = solweig.calculate(surface, location, weather)

print(f"Sunlit Tmrt: {result.tmrt[result.shadow > 0.5].mean():.0f}°C")
print(f"Shaded Tmrt: {result.tmrt[result.shadow < 0.5].mean():.0f}°C")

calculate*() requires SVF to already be prepared (SurfaceData.prepare(...) or surface.compute_svf()). If you explicitly set use_anisotropic_sky=True, shadow matrices must also already be available.

Real-world workflow (GeoTIFFs + EPW weather)

import solweig

# 1. Load surface — prepare() computes and caches walls/SVF when missing
surface = solweig.SurfaceData.prepare(
    dsm="data/dsm.tif",
    cdsm="data/trees.tif",       # Optional: vegetation canopy heights
    working_dir="cache/",        # Expensive preprocessing cached here
)

# 2. Load weather from an EPW file (standard format from climate databases)
weather_list = solweig.Weather.from_epw(
    "data/weather.epw",
    start="2025-07-01",
    end="2025-07-03",
)
location = solweig.Location.from_epw("data/weather.epw")

# 3. Run — outputs saved as GeoTIFFs, thermal state carried between timesteps
results = solweig.calculate_timeseries(
    surface=surface,
    weather_series=weather_list,
    location=location,
    output_dir="output/",
    outputs=["tmrt", "shadow"],
)

# Summary grids (mean Tmrt, UTCI, sun hours, etc.) are on the returned object
print(summary.report())

What you need

Input Required? What it is
DSM Yes Digital Surface Model — a height grid (metres) including buildings. GeoTIFF or numpy array.
Location Yes Latitude, longitude, and UTC offset. Can be extracted from the DSM's CRS or an EPW file.
Weather Yes Air temperature, relative humidity, and global solar radiation. Load from an EPW file or create manually.
CDSM No Canopy heights (trees). Adds vegetation shading.
DEM No Ground elevation. Separates terrain from buildings.
Land cover No Surface type grid (paved, grass, water, etc.). Affects surface temperatures.

What you get

Output Unit Description
Tmrt °C Mean Radiant Temperature — the main output. How much radiation a person absorbs.
Shadow 0–1 Shadow fraction (1 = sunlit, 0 = fully shaded).
UTCI °C Universal Thermal Climate Index — "feels like" temperature combining all factors.
PET °C Physiological Equivalent Temperature — similar to UTCI but with customisable body parameters.
Kdown / Kup W/m² Shortwave radiation (down and reflected up).
Ldown / Lup W/m² Longwave radiation (thermal, down and emitted up).

Don't have an EPW file? Download one

# Download weather data for any location (no API key needed)
epw_path = solweig.download_epw(latitude=37.98, longitude=23.73, output_path="athens.epw")
weather_list = solweig.Weather.from_epw(epw_path)

Demos

Complete working scripts you can run directly:

  • demos/athens-demo.py — Full workflow: rasterise tree vectors, load GeoTIFFs, run a multi-day timeseries, post-process UTCI.
  • demos/solweig_gbg_test.py — Gothenburg: surface preparation with SVF caching, timeseries calculation.

Documentation

QGIS Plugin

SOLWEIG is also available as a QGIS plugin for point-and-click spatial analysis:

  1. PluginsManage and Install Plugins
  2. Settings tab → Check "Show also experimental plugins"
  3. Search for "SOLWEIG"Install Plugin

Citation

Adapted from UMEP by Fredrik Lindberg, Sue Grimmond, and contributors.

If you use SOLWEIG in your research, please cite the original model paper and the UMEP platform:

  1. 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. International Journal of Biometeorology 52, 697–713 doi:10.1007/s00484-008-0162-7

  2. Lindberg F, Grimmond CSB, Gabey A, Huang B, Kent CW, Sun T, Theeuwes N, Järvi L, Ward H, Capel-Timms I, Chang YY, Jonsson P, Krave N, Liu D, Meyer D, Olofson F, Tan JG, Wästberg D, Xue L, Zhang Z (2018) Urban Multi-scale Environmental Predictor (UMEP) – An integrated tool for city-based climate services. Environmental Modelling and Software 99, 70-87 doi:10.1016/j.envsoft.2017.09.020

Demo data

The Athens demo dataset (demos/data/athens/) uses the following sources:

  • DSM/DEM — Derived from LiDAR data available via the Hellenic Cadastre geoportal
  • Tree vectors (trees.gpkg) — Derived from the Athens Urban Atlas and municipal open data at geodata.gov.gr
  • EPW weather (athens_2023.epw) — Generated using Copernicus Climate Change Service information [2025] via PVGIS. Contains modified Copernicus Climate Change Service information; neither the European Commission nor ECMWF is responsible for any use that may be made of the Copernicus information or data it contains.

License

GNU Affero General Public License v3.0 — see LICENSE.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

solweig-0.1.0b47.tar.gz (283.3 kB view details)

Uploaded Source

Built Distributions

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

solweig-0.1.0b47-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl (3.8 MB view details)

Uploaded PyPymusllinux: musl 1.2+ x86-64

solweig-0.1.0b47-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl (3.7 MB view details)

Uploaded PyPymusllinux: musl 1.2+ ARM64

solweig-0.1.0b47-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

solweig-0.1.0b47-cp313-cp313t-musllinux_1_2_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.13tmusllinux: musl 1.2+ x86-64

solweig-0.1.0b47-cp313-cp313t-musllinux_1_2_aarch64.whl (3.7 MB view details)

Uploaded CPython 3.13tmusllinux: musl 1.2+ ARM64

solweig-0.1.0b47-cp39-abi3-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.9+Windows x86-64

solweig-0.1.0b47-cp39-abi3-musllinux_1_2_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

solweig-0.1.0b47-cp39-abi3-musllinux_1_2_aarch64.whl (3.7 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

solweig-0.1.0b47-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

solweig-0.1.0b47-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.6 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

solweig-0.1.0b47-cp39-abi3-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

solweig-0.1.0b47-cp39-abi3-macosx_10_12_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file solweig-0.1.0b47.tar.gz.

File metadata

  • Download URL: solweig-0.1.0b47.tar.gz
  • Upload date:
  • Size: 283.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for solweig-0.1.0b47.tar.gz
Algorithm Hash digest
SHA256 db994f1b65859ab2f890efb90114c36de3dd1aa915283cc79624378708409b47
MD5 baf4317a860f475c5b945bc8411a0296
BLAKE2b-256 e34541bdd0474ac4ade7ec9797fb13ed504ae2af803ead71ad3ea4c3edb1da6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for solweig-0.1.0b47.tar.gz:

Publisher: python-publish.yml on UMEP-dev/solweig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file solweig-0.1.0b47-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for solweig-0.1.0b47-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 35567548c11d874a86682820a470d69214f78fa7314e48dbd60ee328932d81c9
MD5 4df89a43ccb6767029ffea6eff81beb9
BLAKE2b-256 6174f7ad6198ac2f882ec00a4a6ad9cf0bd9e45c74fbf3c180068a5aa990e03e

See more details on using hashes here.

Provenance

The following attestation bundles were made for solweig-0.1.0b47-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on UMEP-dev/solweig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file solweig-0.1.0b47-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for solweig-0.1.0b47-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 ee1cafbfee6e8c724bbff0459265e150b91d294a3aea831165b05a375ecd85d9
MD5 94040dd2a4cdf110d4085339a0f51f50
BLAKE2b-256 b5be89644a26596dbfea0040f9e3f9910e54fb5411b5ca95b06862d893b389f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for solweig-0.1.0b47-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl:

Publisher: python-publish.yml on UMEP-dev/solweig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file solweig-0.1.0b47-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for solweig-0.1.0b47-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 136d454292b19aa36aa834eb4adf8d0f7c15db3cfc3a370e717cee53f47c9c8c
MD5 3c13d6f8c150315b6c2ce163819e9453
BLAKE2b-256 cdd38dc303daca27c517231c7fe14c12d0f6af75063eebf3c3fd70a3c253cdec

See more details on using hashes here.

Provenance

The following attestation bundles were made for solweig-0.1.0b47-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on UMEP-dev/solweig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file solweig-0.1.0b47-cp313-cp313t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for solweig-0.1.0b47-cp313-cp313t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6f30e8725f1d937a5b8da8b92aa75cf09ce43625d12b8dc4da817c9af7c84853
MD5 8a06ce75bcfe0422fe5e08cbbd2b6305
BLAKE2b-256 d127d0501891a3e33b6d19f71072a6a7a73380f05a2216869c88940e17ef21c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for solweig-0.1.0b47-cp313-cp313t-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on UMEP-dev/solweig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file solweig-0.1.0b47-cp313-cp313t-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for solweig-0.1.0b47-cp313-cp313t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 dbb119628fceab084ca176d97a539c9ee7a17f6237a8f75c5e45d88b50055f33
MD5 9b2960923f4c66aefe99bba731a4bc6e
BLAKE2b-256 da267093245d5582e6d0f4018bfa3b0b323b240117f9ea9d6197edc9d177b593

See more details on using hashes here.

Provenance

The following attestation bundles were made for solweig-0.1.0b47-cp313-cp313t-musllinux_1_2_aarch64.whl:

Publisher: python-publish.yml on UMEP-dev/solweig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file solweig-0.1.0b47-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: solweig-0.1.0b47-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for solweig-0.1.0b47-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 733122f5f63a079dd566b9b0a2f22c3bb0c07c0c9c8fc9b695089dd1fc312eb3
MD5 e78319c75ed143740b89d4b99ba86c1b
BLAKE2b-256 24063d97178a767dfacc77a1e03d0ab6c8e75062b50dcfa1707e8c17c519da27

See more details on using hashes here.

Provenance

The following attestation bundles were made for solweig-0.1.0b47-cp39-abi3-win_amd64.whl:

Publisher: python-publish.yml on UMEP-dev/solweig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file solweig-0.1.0b47-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for solweig-0.1.0b47-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1de8489f12cc7d772bc5a8e6b548dc1fe48bdf67e68ba1fec0dbc42789fc5e51
MD5 a7ab0b40d223f49be582f226f862e27c
BLAKE2b-256 37f62c28f71449d3dc0775ba5fd82176898d6b8d77169ebefba93529263b5385

See more details on using hashes here.

Provenance

The following attestation bundles were made for solweig-0.1.0b47-cp39-abi3-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on UMEP-dev/solweig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file solweig-0.1.0b47-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for solweig-0.1.0b47-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 3af770718262c52db9b34f0326b9d4adafa7f5cb7c150db16135fe363a602555
MD5 b1a9c9a28caa34bb12e81d1c1e7a4c93
BLAKE2b-256 b0cee899936a45299bec9b5aefa85d72e08ecccba83ddcfa4a7f5933a2a90728

See more details on using hashes here.

Provenance

The following attestation bundles were made for solweig-0.1.0b47-cp39-abi3-musllinux_1_2_aarch64.whl:

Publisher: python-publish.yml on UMEP-dev/solweig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file solweig-0.1.0b47-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for solweig-0.1.0b47-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c6d7ae04a92ea9f068f8a319395abc5d0a41f06f82a84d8a016b70eb0b103c35
MD5 c9bbcaaacc5ae17c93b19af17122b7f8
BLAKE2b-256 ec305fcc6c09421099ebee39c301af512c6510d98117b80226d652b05718e239

See more details on using hashes here.

Provenance

The following attestation bundles were made for solweig-0.1.0b47-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on UMEP-dev/solweig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file solweig-0.1.0b47-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for solweig-0.1.0b47-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 efa695d714e9e5f9fb9cdb0355a75335364acf1f2aad4780bfa25f2c181225bb
MD5 af0d25efca9db3f528726ab8873e4497
BLAKE2b-256 7ab11bf7a1d1be84aac5752aef39f1b76f91ebc77605bd9f441bcb842f4d943a

See more details on using hashes here.

Provenance

The following attestation bundles were made for solweig-0.1.0b47-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: python-publish.yml on UMEP-dev/solweig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file solweig-0.1.0b47-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for solweig-0.1.0b47-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5921f5cb3f08fdc383c3fa1d21ca0eca3be816abac5c7b37a39d2fb274847296
MD5 ea9f85e8ced8b63dc98330e27abb94a7
BLAKE2b-256 467174ade52375119b093dc1faf87a2bc194bbf3587858981c7bc585ac73bd5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for solweig-0.1.0b47-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on UMEP-dev/solweig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file solweig-0.1.0b47-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for solweig-0.1.0b47-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 535312309cbc21868431cf96f989f47024ec19fd212eae0cddf33d7b05ceee1c
MD5 2b0c588962c88f35cc9b96d62184b79d
BLAKE2b-256 5bb6f506d16819614644e532294947f6c12c0ea2049518c04b31c23fb679074f

See more details on using hashes here.

Provenance

The following attestation bundles were made for solweig-0.1.0b47-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: python-publish.yml on UMEP-dev/solweig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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