Add solar radiation modeling over DEMs

Open
#1,140 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
data, performance

Research direction

Start by locating the existing viewshed infrastructure and its xarray DataArray interfaces, then assess whether horizon tracing can be reused. Review the dask map_overlap and GPU requirements before defining the design. Done means direct, diffuse, and terrain-reflected radiation are separately available, with hourly, daily, and annual integration over terrain and configurable atmospheric transmittance.

Written by the indexing model from the issue text.

Description

after-1.0.0-release enhancement

Sky view factor exists, but there's no actual solar irradiance model. Solar radiation modeling over terrain is a common need in renewable energy siting, ecology, and agriculture.

Scope

Radiation components. Calculate direct beam, diffuse sky, and terrain-reflected radiation separately. The total is the sum of all three.

Terrain effects. Account for slope, aspect, and horizon shadowing derived from the DEM. Cells behind ridgelines should receive reduced or zero direct beam depending on the sun's position.

Atmospheric transmittance. Configurable transmittance parameter (or a simple atmospheric model) to control how much radiation reaches the surface.

Integration periods. Support hourly snapshots, daily totals, or annual sums. Daily/annual modes integrate over sun positions throughout the period.

Sun position calculation. Compute solar declination and hour angle from date/time and latitude. No external ephemeris library should be required for basic operation.

Prior art

Similar in scope to GRASS r.sun or ArcGIS Area Solar Radiation. Both are widely used but not available as lightweight Python functions that work on xarray DataArrays.

Implementation notes

The horizon calculation is the expensive part. For each cell, you need to trace rays in multiple azimuth directions and find the maximum elevation angle. This could reuse or extend the existing viewshed infrastructure if the interface fits.

GPU acceleration would help a lot here since the horizon sweep is embarrassingly parallel across cells. A CUDA kernel that walks each azimuth ray per thread block is a natural fit.

For dask, the horizon calculation requires overlap (the search radius can be large), so map_overlap with sufficient depth is the right approach.

Dominant language
Python
Stars
972
Forks
92
Avg merge
2d 12h
Merged PRs (30d)
7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from xarray-contrib/xarray-spatial

All issues in xarray-contrib/xarray-spatial

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.