Add solar radiation modeling over DEMs
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
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from xarray-contrib/xarray-spatial
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
xarray-contrib/xarray-spatial#3726 ·
-
api area:surface bug severity:medium sweep-api-consistency
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
xarray-contrib/xarray-spatial#3712 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
xarray-contrib/xarray-spatial#3710 ·
-
bug
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
xarray-contrib/xarray-spatial#3707 ·
-
area:surface documentation user-guide-example
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
xarray-contrib/xarray-spatial#3464 ·
All issues in xarray-contrib/xarray-spatial
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
zostera/django-bootstrap4#894 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3276 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zilliztech/memsearch#759 ·