Skip to content

Build surface fuels from a tree grid with DUET

You are viewing in-progress documentation for v2. Switch to the stable version for the current production release.

POST grids/duet turns a completed 3D tree grid into 2D surface-fuel bands: grass, litter, and their total, each as a load, a depth, and a moisture. For how DUET builds the layer from the canopy, see DUET: surface fuel from the canopy.

  1. An API key: my-api-key.

  2. A domain: your-domain-id.

  3. A completed tree inventory with height, dbh, crown_base_height, and fia_species_code on every tree: your-inventory-id. A TreeMap inventory has them. For a CHM or uploaded inventory, fill them in with GDAM allometry first.

  4. To calibrate, target values for the fuels you calibrate: field measurements, published data, or a stated scenario.

DUET reads three bands from the tree grid:

  • bulk_density.foliage.live, the foliage mass in each voxel
  • spcd, the FIA species code of the tree in each voxel
  • fuel_moisture.live, the live canopy moisture

The default voxelization produces only bulk_density.foliage.live. Request all three:

POST grids/voxelize/inventory/tree
curl -X 'POST' \
'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/voxelize/inventory/tree' \
-H 'accept: application/json' \
-H 'api-key: my-api-key' \
-H 'Content-Type: application/json' \
-d '{
"name": "DUET-compatible canopy grid",
"source_inventory_id": "your-inventory-id",
"resolution": { "horizontal": 2, "vertical": 1 },
"bands": [
"bulk_density.foliage.live",
"spcd",
"fuel_moisture.live"
],
"seed": 42
}'

Record the id as your-tree-grid-id and poll it to completed:

GET tree grid
curl -X 'GET' \
'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/your-tree-grid-id' \
-H 'accept: application/json' \
-H 'api-key: my-api-key'

This tree grid has 2 m cells and 1 m layers, with a shape of [33, 442, 654]: layers, rows, columns. DUET’s output is a 2D [442, 654] grid on the same horizontal lattice.

To run DUET, send the tree grid’s id, the years since the last fire, and the wind. This request asks for every band: load, depth, and moisture of grass, litter, coniferous litter, deciduous litter, and the total.

POST grids/duet — uncalibrated
curl -X 'POST' \
'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/duet' \
-H 'accept: application/json' \
-H 'api-key: my-api-key' \
-H 'Content-Type: application/json' \
-d '{
"name": "DUET surface fuels (raw pattern)",
"source_grid_id": "your-tree-grid-id",
"years_since_burn": 25,
"wind_direction": 270,
"wind_variability": 30,
"bands": [
"fuel_load.grass",
"fuel_load.litter",
"fuel_load.litter.coniferous",
"fuel_load.litter.deciduous",
"fuel_load.total",
"fuel_depth.grass",
"fuel_depth.litter",
"fuel_depth.litter.coniferous",
"fuel_depth.litter.deciduous",
"fuel_depth.total",
"fuel_moisture.grass",
"fuel_moisture.litter",
"fuel_moisture.litter.coniferous",
"fuel_moisture.litter.deciduous",
"fuel_moisture.total"
]
}'

DUET separates fuel by type, not by dead-fuel timelag class. Choose bands for the task:

TaskBands
Compare grass and all litterfuel_load.grass, fuel_load.litter
Keep mixed-stand litter types separatefuel_load.litter.coniferous, fuel_load.litter.deciduous
Supply one combined surface layerfuel_load.total, fuel_depth.total, fuel_moisture.total
Inspect bed structure rather than massfuel_depth.grass, fuel_depth.litter
Inspect moisture by fuel typefuel_moisture.grass, fuel_moisture.litter

The same fuel-type suffixes are available for load, depth, and moisture. Without bands, the grid has fuel_load.grass and fuel_load.litter. The live API reference lists every band and validation rule.

FieldWhat to set
years_since_burnCompleted years since the most recent fire, from 1 to 100. Litter accumulates with each year, and runtime grows with it.
wind_directionPrevailing wind direction in whole degrees clockwise from north. Defaults to 270.
wind_variabilityAngular spread around that direction, in whole degrees. Defaults to 30.

The example uses 25 years and a west wind (270° ± 30°).

Record the id as your-raw-duet-grid-id and poll it to completed:

GET DUET grid
curl -X 'GET' \
'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/your-raw-duet-grid-id' \
-H 'accept: application/json' \
-H 'api-key: my-api-key'

Without calibration, the bands carry DUET’s spatial pattern, and their magnitudes are not physical values (Pattern, not magnitude). Check the pattern before you calibrate. Litter lies under and around the crowns, and grass fills the openings between them:

Three square maps of the same window side by side. Left: canopy foliage as scattered small crowns. Middle: litter in patches under the densest crowns and near zero elsewhere. Right: grass high across most of the window and low where the litter patches lie. Three square maps of the same window side by side. Left: canopy foliage as scattered small crowns. Middle: litter in patches under the densest crowns and near zero elsewhere. Right: grass high across most of the window and low where the litter patches lie.

A 150 m window of the Blue Mountain run: the tree grid’s foliage summed through its layers, then the uncalibrated litter and grass loads after 25 years. The inventory is 8,040 trees detected on the NAIP canopy height model and filled in with GDAM allometry.

If litter is missing under the crowns, check the inventory’s species codes and the run’s years_since_burn.

To set the magnitudes, add a calibration object to the create request. It takes a target for each parameter (fuel_load, fuel_depth, fuel_moisture) and fuel type (grass, litter, coniferous, deciduous, or all). all calibrates every fuel type together and cannot be combined with another fuel type. Parameters without a target keep DUET’s values.

Each target uses one method:

  • meansd rescales to a target mean and standard deviation. Use it when the targets come from a dataset large enough to approximate a normal distribution.
  • maxmin rescales to a target maximum and minimum. Use it when fuel data are limited, or when their distribution does not resemble DUET’s.
  • constant assigns one value to every cell that carries the fuel. Use it when one value is all you have.
POST grids/duet — calibrated
curl -X 'POST' \
'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/duet' \
-H 'accept: application/json' \
-H 'api-key: my-api-key' \
-H 'Content-Type: application/json' \
-d '{
"name": "DUET surface fuels (example calibration targets)",
"source_grid_id": "your-tree-grid-id",
"years_since_burn": 25,
"wind_direction": 270,
"wind_variability": 30,
"bands": [
"fuel_load.grass",
"fuel_load.litter",
"fuel_load.total",
"fuel_depth.grass",
"fuel_depth.litter",
"fuel_depth.total",
"fuel_moisture.total"
],
"calibration": {
"fuel_load": {
"grass": { "method": "meansd", "mean": 0.5, "sd": 0.25 },
"litter": { "method": "maxmin", "max": 5.0, "min": 0.0 }
},
"fuel_depth": {
"grass": { "method": "constant", "value": 0.3 },
"litter": { "method": "constant", "value": 0.06 }
},
"fuel_moisture": {
"all": { "method": "constant", "value": 8.0 }
}
}
}'

Record the id as your-calibrated-duet-grid-id and poll it to completed:

GET calibrated DUET grid
curl -X 'GET' \
'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/your-calibrated-duet-grid-id' \
-H 'accept: application/json' \
-H 'api-key: my-api-key'

Calibration rescales only the cells that carry that fuel, and cells without it stay at zero. A meansd target is the mean of the fuel-bearing cells, not of the whole domain. In this run grass covers every cell. Its calibrated mean is 0.570 kg/m² and its standard deviation 0.120 kg/m², against the 0.5 ± 0.25 target. When the rescaled values would fall below zero, meansd compresses the values below the median into the range from zero to the median, which moves the mean and standard deviation off the target. Litter covers 49.1% of cells, and maxmin places it on the target range, 0 to 5 kg/m².

Two histograms. Left: calibrated grass load per cell, with lines at the target mean, at one standard deviation either side of it, and at the result mean. Values stop near 0.71, and most cells lie between 0.5 and 0.71, with a long tail toward zero. Right: calibrated litter load on a log count scale, falling steeply from near zero, with a few cells reaching the target maximum of 5. Two histograms. Left: calibrated grass load per cell, with lines at the target mean, at one standard deviation either side of it, and at the result mean. Values stop near 0.71, and most cells lie between 0.5 and 0.71, with a long tail toward zero. Right: calibrated litter load on a log count scale, falling steeply from near zero, with a few cells reaching the target maximum of 5.

Calibrated grass and litter loads of the cells that carry each fuel, in the calibrated grid from the Blue Mountain run. Grass has a target mean of 0.5 kg/m² and a target standard deviation of 0.25 kg/m², and the result has a mean of 0.570 kg/m². Litter has a target range of 0 to 5 kg/m², and its counts are on a log scale.

The example below reads the calibrated grid. To read the uncalibrated grid, use your-raw-duet-grid-id instead. Check the metadata first:

  • status is completed.
  • georeference.shape is the tree grid’s horizontal shape.
  • Every requested band is present with its unit: kg/m**2, m, or %.
  • On a calibrated grid, source.calibration records the targets you sent.

Then read representative bands and check their coverage and range:

Inspect calibrated DUET bands
import fastfuels_sdk.v2 as ff
ff.set_api_key("my-api-key")
# Use the uncalibrated grid id instead if you omitted calibration.
grid = ff.get_grid("your-domain-id", "your-calibrated-duet-grid-id")
grid.wait()
# Check the metadata before reading values.
print(grid.status, grid.to_dict()["georeference"]["shape"])
# to_numpy fetches every chunk of a band and reassembles it into one 2D array.
for band in ("fuel_load.grass", "fuel_load.litter", "fuel_load.total"):
values = grid.to_numpy(band)
positive = values[values > 0]
print(
band,
f"coverage={positive.size / values.size:.1%}",
f"range={positive.min():.3f}–{positive.max():.3f}",
)

grid.to_numpy(band) fetches every chunk of a band and reassembles it into one 2D array. The grid-data guide covers JSON, sparse, and binary reads.

  • Align before combining. The DUET grid has the source tree grid’s horizontal lattice. Resample or reproject other 2D grids to match it. A 3D tree grid cannot be resampled.
  • Export calibrated bands by role. A QUIC-Fire export takes calibrated fuel_load.total, fuel_depth.total, and fuel_moisture.total as its surface load, depth, and moisture roles. DUET does not produce surface SAVR. For treesss.dat, supply both canopy and surface SAVR from other aligned grids, or omit both SAVR roles. The QUIC-Fire inputs tutorial assembles a full export.
  • Export for GIS or analysis. Use a GeoTIFF export for selected 2D bands, or NetCDF or Zarr.
  • Missing source bands. A tree grid from a default voxelization has only bulk_density.foliage.live, and POST grids/duet rejects it with 422. Voxelize the inventory again with spcd and fuel_moisture.live.
  • Invalid species codes. A fia_species_code that is not an FIA species fails the job with UNRESOLVABLE_SPECIES. Correct the inventory and voxelize again. FIA species that DUET has no parameters for run as a species of the same genus, or of the same softwood or hardwood class.
  • Calibrating a fuel type that is absent. A target for a fuel type DUET did not produce, such as deciduous litter in a pure conifer stand, fails the job with CALIBRATION_FAILED. Check the uncalibrated split-litter bands and remove targets for fuel types that are all zero.
  • Too few years since burn. DUET starts in the year of the last fire with no grass or litter, so a low years_since_burn leaves little litter.
  • Long runs. Runtime grows with years_since_burn and grid size. Poll the grid, and treat failed as terminal.
  • Using the wrong bands at export. DUET’s grass and litter bands do not map to the FBFM lookup’s 1hr, 10hr, and 100hr bands. Assign each DUET band to the downstream role that matches its quantity and unit.