Create solar irradiance grids
You are viewing in-progress documentation for v2. Switch to the stable version for the current production release.
The LeafLux endpoint, grids/solar/irradiance/leaflux, computes relative solar
irradiance from the leaf area density of a 3D canopy grid. For how a grid is
derived from other grids, see About grids.
| Band | Where | Output |
|---|---|---|
irradiance.surface.relative | on the ground beneath the canopy | 2D (y, x) |
irradiance.canopy.relative | inside the canopy, per voxel | 3D (z, y, x) |
Both are relative values in [0, 1], a fraction of open-sky irradiance. A
request for the canopy band returns a 3D grid. A request for only the surface
band returns a 2D grid.
Prerequisites
Section titled “Prerequisites”-
An API key. my-api-key.
-
A domain. your-domain-id.
-
A completed 3D canopy grid with a
leaf_area_densityband. your-leaf-area-density-grid-id. Voxelize a tree inventory withleaf_area_densityinbandsto build one. -
(Optional) a 2D terrain grid with an
elevationband. your-topography-grid-id. Build one from 3DEP with"bands": ["elevation"], aligned to the source grid’s lattice (see the caution below). Without it, the surface is a flat plane.
The responses and figures on this page come from the Blue Mountain domain. Its source grid is tree detections from the NAIP canopy height model, completed with GDAM allometry and voxelized with leaf area density.
The whole flow — create, poll, and read the band back — in one script:
"""Create a 3D canopy irradiance grid, poll it, and read the band back.
The source is a completed 3D grid with a leaf_area_density band."""
from datetime import datetime, timezone
import numpy as np
import fastfuels_sdk.v2 as ff
ff.set_api_key("my-api-key")
# 1. Create the grid and wait for it to finish. Pass the source grid id plus# its domain (or a Grid object, which carries its own domain).grid = ff.grids.create_irradiance_grid_from_leaflux( "your-leaf-area-density-grid-id", domain="your-domain-id", date_time=datetime(2025, 7, 1, 19, 0, tzinfo=timezone.utc), bands=["irradiance.canopy.relative"], name="Canopy irradiance",)grid.wait() # polls until completed or failed
# 2. Read the 3D band into one (z, y, x) array. to_numpy reassembles the# sparse chunks.volume = grid.to_numpy("irradiance.canopy.relative")
# 3. Values are relative irradiance in [0, 1]; NaN outside the canopy.canopy = volume[np.isfinite(volume)]Create a 2D surface irradiance grid
Section titled “Create a 2D surface irradiance grid”To map irradiance on the ground, request only irradiance.surface.relative.
Without a terrain grid, the surface is a flat plane and the only shadows are the
ones the canopy casts.
curl -X 'POST' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/solar/irradiance/leaflux' \ -H 'accept: application/json' \ -H 'api-key: my-api-key' \ -H 'Content-Type: application/json' \ -d '{ "source_lad_grid_id": "your-leaf-area-density-grid-id", "bands": ["irradiance.surface.relative"], "date_time": "2025-07-01T19:00:00Z", "name": "Surface irradiance (flat)"}'from datetime import datetime, timezone
import fastfuels_sdk.v2 as ff
ff.set_api_key("my-api-key")
# No terrain grid: surface irradiance is evaluated on a flat plane, so the# only shadows are the ones the canopy casts.grid = ff.grids.create_irradiance_grid_from_leaflux( "your-leaf-area-density-grid-id", domain="your-domain-id", date_time=datetime(2025, 7, 1, 19, 0, tzinfo=timezone.utc), bands=["irradiance.surface.relative"], name="Surface irradiance (flat)",){ "id": "your-irradiance-grid-id", "domain_id": "your-domain-id", "name": "Surface irradiance (flat)", "description": "", "status": "pending", "progress": null, "created_on": "2026-11-03T21:35:42.096496", "modified_on": "2026-11-03T21:35:42.096496", "checksum": "7515b262234440c59e9685611195a10c", "source": { "operation": "irradiance", "input": "grid", "entity": "solar", "source_lad_grid_id": "your-leaf-area-density-grid-id", "source_lad_grid_checksum": "d0fd7985e87646b084102a7c2e99c2b2", "bands": ["irradiance.surface.relative"], "date_time": "2025-07-01T19:00:00Z", "extinction_coefficient": 0.5 }, "modifications": [], "bands": [ { "key": "irradiance.surface.relative", "name": "Relative Irradiance on Surface", "description": "Relative irradiance on the terrain surface [0-1] beneath the canopy.", "type": "continuous", "unit": null, "index": 0, "nodata": null, "summary": null } ], "georeference": null, "error": null, "chunks": null, "tags": []}Record the id as your-irradiance-grid-id and poll it to completed.
The completed grid is 2D. Its georeference.shape is (y, x),
[442, 654] here, and it exports and reads back as a raster.
curl -X 'GET' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/your-irradiance-grid-id' \ -H 'accept: application/json' \ -H 'api-key: my-api-key'grid.wait(){ "id": "your-irradiance-grid-id", "domain_id": "your-domain-id", "name": "Surface irradiance (flat)", "description": "", "status": "completed", "progress": { "percent": 100, "message": "Complete" }, "created_on": "2026-11-03T21:35:42.096496Z", "modified_on": "2026-11-03T21:35:48.971925Z", "checksum": "7515b262234440c59e9685611195a10c", "source": { "bands": ["irradiance.surface.relative"], "input": "grid", "extinction_coefficient": 0.5, "operation": "irradiance", "source_lad_grid_checksum": "d0fd7985e87646b084102a7c2e99c2b2", "source_lad_grid_id": "your-leaf-area-density-grid-id", "date_time": "2025-07-01T19:00:00Z", "entity": "solar" }, "modifications": [], "bands": [ { "key": "irradiance.surface.relative", "name": "Relative Irradiance on Surface", "description": "Relative irradiance on the terrain surface [0-1] beneath the canopy.", "type": "continuous", "unit": null, "index": 0, "nodata": null, "summary": null } ], "georeference": { "crs": "EPSG:32611", "transform": [2.0, 0.0, 720226.0, 0.0, -2.0, 5190646.0], "shape": [442, 654] }, "error": null, "chunks": { "shape": [442, 442], "count": 2, "count_by_axis": { "x": 2, "y": 1 } }, "tags": []}To drape the surface over terrain, add source_terrain_grid_id. Slope and
aspect then shade the ground as well as the canopy.
curl -X 'POST' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/solar/irradiance/leaflux' \ -H 'accept: application/json' \ -H 'api-key: my-api-key' \ -H 'Content-Type: application/json' \ -d '{ "source_lad_grid_id": "your-leaf-area-density-grid-id", "source_terrain_grid_id": "your-topography-grid-id", "bands": ["irradiance.surface.relative"], "date_time": "2025-07-01T19:00:00Z", "name": "Surface irradiance (terrain-draped)"}'# Same imports and set_api_key as above. source_terrain_grid drapes the surface# over terrain, so slope and aspect shade the result too. The terrain grid needs# an elevation band on the source grid's x/y lattice (alignment target "grid").grid = ff.grids.create_irradiance_grid_from_leaflux( "your-leaf-area-density-grid-id", domain="your-domain-id", date_time=datetime(2025, 7, 1, 19, 0, tzinfo=timezone.utc), source_terrain_grid="your-topography-grid-id", bands=["irradiance.surface.relative"], name="Surface irradiance (terrain-draped)",)Shading, as 1 − irradiance.surface.relative, on Blue Mountain at 13:00 local
(19:00Z), from the same source grid. On the flat plane, open ground, 65% of
the cells, has a relative irradiance of 0.905, and only the canopy shadows
vary. Draped on terrain, the open ground varies with slope and aspect, up to 1
on slopes facing the sun.
Create a 3D canopy irradiance grid
Section titled “Create a 3D canopy irradiance grid”To get a value for every canopy voxel, request irradiance.canopy.relative. The
grid is 3D.
curl -X 'POST' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/solar/irradiance/leaflux' \ -H 'accept: application/json' \ -H 'api-key: my-api-key' \ -H 'Content-Type: application/json' \ -d '{ "source_lad_grid_id": "your-leaf-area-density-grid-id", "bands": ["irradiance.canopy.relative"], "date_time": "2025-07-01T19:00:00Z", "name": "Canopy irradiance (midday)"}'# Same imports and set_api_key as above. Ask for the canopy band and the grid# is 3D: a relative irradiance for every canopy voxel.grid = ff.grids.create_irradiance_grid_from_leaflux( "your-leaf-area-density-grid-id", domain="your-domain-id", date_time=datetime(2025, 7, 1, 19, 0, tzinfo=timezone.utc), bands=["irradiance.canopy.relative"], name="Canopy irradiance (midday)",){ "id": "your-irradiance-grid-id", "domain_id": "your-domain-id", "name": "Canopy irradiance (midday)", "description": "", "status": "completed", "progress": { "percent": 100, "message": "Complete" }, "created_on": "2026-11-03T21:36:04.040902Z", "modified_on": "2026-11-03T21:36:07.825049Z", "checksum": "86496a836c654f9089839f607f07780f", "source": { "bands": ["irradiance.canopy.relative"], "input": "grid", "extinction_coefficient": 0.5, "operation": "irradiance", "source_lad_grid_checksum": "d0fd7985e87646b084102a7c2e99c2b2", "source_lad_grid_id": "your-leaf-area-density-grid-id", "date_time": "2025-07-01T19:00:00Z", "entity": "solar" }, "modifications": [], "bands": [ { "key": "irradiance.canopy.relative", "name": "Relative Irradiance in Canopy", "description": "Per-voxel relative irradiance within the canopy [0-1], from Beer-Lambert attenuation through leaf area density.", "type": "continuous", "unit": null, "index": 0, "nodata": null, "summary": null } ], "georeference": { "crs": "EPSG:32611", "transform": [2.0, 0.0, 720226.0, 0.0, -2.0, 5190646.0], "shape": [33, 442, 654], "z_resolution": 1.0, "z_origin": 0.0 }, "error": null, "chunks": { "shape": [33, 442, 442], "count": 2, "count_by_axis": { "x": 2, "y": 1, "z": 1 } }, "tags": []}The completed grid has its source’s crs, transform, and shape,
[33, 442, 654] here: 33 layers of 1 m over a 442 × 654 grid of 2 m cells.
Voxels that hold canopy, 386,336 of them here, get a value in [0, 1]. Voxels
outside the crowns are empty.
Request both bands at once
Section titled “Request both bands at once”To get both bands from one job, list both. The grid is 3D: the canopy band
fills the voxels and the surface band sits on the ground plane (z=0), each an
indexed band on the same lattice.
curl -X 'POST' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/solar/irradiance/leaflux' \ -H 'accept: application/json' \ -H 'api-key: my-api-key' \ -H 'Content-Type: application/json' \ -d '{ "name": "Midday irradiance", "description": "Relative canopy and surface irradiance.", "tags": ["solar", "irradiance"], "source_lad_grid_id": "your-leaf-area-density-grid-id", "source_terrain_grid_id": "your-topography-grid-id", "bands": ["irradiance.canopy.relative", "irradiance.surface.relative"], "date_time": "2025-07-01T19:00:00Z", "extinction_coefficient": 0.5}'# Same imports and set_api_key as above. List both bands to get them from one# job. Because the canopy band is present, the grid is 3D: the canopy band fills# the voxels, and the surface band sits on the ground plane (z=0).grid = ff.grids.create_irradiance_grid_from_leaflux( "your-leaf-area-density-grid-id", domain="your-domain-id", date_time=datetime(2025, 7, 1, 19, 0, tzinfo=timezone.utc), source_terrain_grid="your-topography-grid-id", bands=["irradiance.canopy.relative", "irradiance.surface.relative"], extinction_coefficient=0.5, name="Midday irradiance", description="Relative canopy and surface irradiance.", tags=["solar", "irradiance"],){ "id": "your-irradiance-grid-id", "domain_id": "your-domain-id", "name": "Midday irradiance", "description": "Relative canopy and surface irradiance.", "status": "completed", "progress": { "percent": 100, "message": "Complete" }, "created_on": "2026-11-03T21:36:14.727421Z", "modified_on": "2026-11-03T21:36:24.434018Z", "checksum": "d813178bd24d4c4cab52231311c2049e", "source": { "bands": ["irradiance.canopy.relative", "irradiance.surface.relative"], "input": "grid", "extinction_coefficient": 0.5, "operation": "irradiance", "source_lad_grid_checksum": "d0fd7985e87646b084102a7c2e99c2b2", "source_lad_grid_id": "your-leaf-area-density-grid-id", "date_time": "2025-07-01T19:00:00Z", "entity": "solar", "source_terrain_grid_id": "your-topography-grid-id" }, "modifications": [], "bands": [ { "key": "irradiance.canopy.relative", "name": "Relative Irradiance in Canopy", "description": "Per-voxel relative irradiance within the canopy [0-1], from Beer-Lambert attenuation through leaf area density.", "type": "continuous", "unit": null, "index": 0, "nodata": null, "summary": null }, { "key": "irradiance.surface.relative", "name": "Relative Irradiance on Surface", "description": "Relative irradiance on the terrain surface [0-1] beneath the canopy.", "type": "continuous", "unit": null, "index": 1, "nodata": null, "summary": null } ], "georeference": { "crs": "EPSG:32611", "transform": [2.0, 0.0, 720226.0, 0.0, -2.0, 5190646.0], "shape": [33, 442, 654], "z_resolution": 1.0, "z_origin": 0.0 }, "error": null, "chunks": { "shape": [33, 442, 442], "count": 2, "count_by_axis": { "x": 2, "y": 1, "z": 1 } }, "tags": ["solar", "irradiance"]}Tune the result
Section titled “Tune the result”Two inputs change the result of every request above.
date_time — where the sun is
Section titled “date_time — where the sun is”date_time is a UTC instant. It sets the sun’s azimuth and elevation, and so
the direction light travels through the canopy and where shadows fall. Blue
Mountain is UTC−6 in summer, so 2025-07-01T14:00:00Z is 08:00 local, with the
sun low in the east, and 2025-07-01T19:00:00Z is 13:00 local.
curl -X 'POST' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/solar/irradiance/leaflux' \ -H 'accept: application/json' \ -H 'api-key: my-api-key' \ -H 'Content-Type: application/json' \ -d '{ "source_lad_grid_id": "your-leaf-area-density-grid-id", "bands": ["irradiance.canopy.relative"], "date_time": "2025-07-01T14:00:00Z", "name": "Canopy irradiance (morning)"}'# Same imports and set_api_key as above, a different UTC instant. Blue Mountain# is UTC-6 in summer, so 14:00Z is 08:00 local — the sun low in the east.grid = ff.grids.create_irradiance_grid_from_leaflux( "your-leaf-area-density-grid-id", domain="your-domain-id", date_time=datetime(2025, 7, 1, 14, 0, tzinfo=timezone.utc), bands=["irradiance.canopy.relative"], name="Canopy irradiance (morning)",)Shading, as 1 − irradiance.canopy.relative, in a 6 m north–south band of the
Blue Mountain canopy from 100 to 500 m east of the domain’s west edge, at
08:00 and 13:00 local. The lower 08:00 sun leaves more of each crown in
shade.
extinction_coefficient — how fast light is absorbed
Section titled “extinction_coefficient — how fast light is absorbed”extinction_coefficient defaults to 0.5. A larger value lowers irradiance
faster with depth into the canopy.
curl -X 'POST' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/solar/irradiance/leaflux' \ -H 'accept: application/json' \ -H 'api-key: my-api-key' \ -H 'Content-Type: application/json' \ -d '{ "source_lad_grid_id": "your-leaf-area-density-grid-id", "bands": ["irradiance.canopy.relative"], "date_time": "2025-07-01T19:00:00Z", "extinction_coefficient": 1.5, "name": "Canopy irradiance (dense extinction)"}'# Same imports and set_api_key as above. A higher extinction_coefficient# attenuates light faster per unit of leaf area density, so less reaches the# lower canopy. The default is 0.5.grid = ff.grids.create_irradiance_grid_from_leaflux( "your-leaf-area-density-grid-id", domain="your-domain-id", date_time=datetime(2025, 7, 1, 19, 0, tzinfo=timezone.utc), bands=["irradiance.canopy.relative"], extinction_coefficient=1.5, name="Canopy irradiance (dense extinction)",)Mean relative irradiance against depth below each column’s canopy top, over
every canopy voxel on Blue Mountain. At the crown tops, the mean is 0.88 at
13:00 local and 0.68 at 08:00. 5 m below the tops, it is 0.51 with the default
extinction_coefficient of 0.5 and 0.24 with 1.5.
Read the values back
Section titled “Read the values back”Read an irradiance grid as any other grid, with grid.to_numpy(band) or
grid.to_xarray(), as in
Fetch and stream grid data.
The values are relative fractions in [0, 1].
- The surface band is a dense 2D
(y, x)raster with a value in every ground cell.grid.to_numpy("irradiance.surface.relative")returns it. - The canopy band is a 3D
(z, y, x)array with one value per canopy voxel andNaNelsewhere.grid.to_numpy("irradiance.canopy.relative")requests its chunks in the sparse encoding and reassembles them, as in the full script above.
Common pitfalls
Section titled “Common pitfalls”- Source grid isn’t 3D or lacks
leaf_area_density. Voxelize the inventory withleaf_area_densityinbands. A canopy grid built without that band, or a 2D grid, is rejected with422. - Terrain grid without
elevation, or on a different lattice.source_terrain_grid_idmust name a 2D grid with anelevationband on the source grid’s CRS, origin, cell size, and shape. A 3DEP grid built with onlyslopeandaspectis rejected. Requestelevationand align the grid to the source grid, or resample it, before draping. - Source grid still
pending. Poll the source canopy grid tocompletedbefore this request. A source grid in any other state is rejected with422. - Treating the values as an energy flux. They are relative fractions in
[0, 1], a share of open-sky irradiance, and carry no unit. Scale by an incoming-radiation value yourself if you needW/m**2. - Reusing a grid after changing the source.
source.source_lad_grid_checksumrecords the source grid’schecksumwhen the irradiance grid was created. If it no longer matches the source grid’s currentchecksum, rebuild the irradiance grid. - Hitting your quota. A LeafLux request past your grid quota returns
429. Delete grids you no longer need, or request a higher quota.