Repository gathering code and documentation for work on extrapolating fuels to unmapped regions using EO data
Most recent tabluar data version can be downloaded from at the following link: FuelsData3
Data points are separated per pyrome per year (2021,2022,2023) in California with ~2000 points sampled for each, 30m resolution
Current Data Attributes are as follows:
- A00-A63 AlphaEarth
- Spectral Indices: Min, Max, and Median of Select Spectral & Vegetation index values as well as HLS Bands
- NDVI
- NBR
- SAVI
- mSAVI
- NDMI
- TCB
- TCG
- TSW
- VARI
- Climate Norms and Yearly Divergence
- ppt
- solclear
- soltotal
- tdmean
- tmax
- tmean
- tmin
- vpdmax
- vpdmin
- Topography
- elevation
- slope
- aspect
- mtpi
- Vegetation
- Existing Vegetation Type (EVT)
- Existing Vegetation Height (EVH)
- Existing Vegetation Cover (EVC)
- Bio-physical Setting (BPS)
Target - FBFM40: LANDFIRE Fuel Classification 45 Classes
- fuels_characteristics_prediction.ipynb
This workflow is an end-to-end pipeline for evaluating how machine-learned fuel models affect wildfire behavior modeling. It exports per-tile geospatial inputs from Google Earth Engine (satellite embeddings, LANDFIRE fuels, canopy structure, and terrain) to cloud storage, runs a trained random-forest model to predict fuel model classes from satellite data, and then uses both the original and predicted fuels to simulate fire behavior with pyretechnics. The results are compared to quantify how fuel prediction errors propagate into fire behavior metrics, producing a CSV of tile-level divergence statistics and, optionally, interactive plots for visual analysis.
- Download and run the Google Cloud CLI installer for your Operating System from here, following all installation recommendations.
- Open your terminal, run
gcloud versionto ensure gcloud is installed properly. - After you install the gcloud CLI, perform initial setup tasks by running
gcloud initin your terminal.
- You can also run
gcloud initto change your settings or create a new configuration. - You can also run
gcloud auth loginas an alternative togcloud initto authorize with a user account without setting up a configuration.
Follow these steps to set up your environment and install the required Python packages using conda and the requirements.txt file.
- Download and run the Anaconda installer for your Operating System from here, following all installation recommendations.
- Open your terminal, run
conda --versionto ensure Anaconda is installed properly. - Create a fresh conda environment with python installed:
conda create -n your-env-name python=3.10.19. - Activate your new environment:
conda activate your-env-name. - Make sure the
requirements.txtfile is in the current directory, then run:
pip install -r requirements.txt
- The
requirements.txtfile installsnumpy==1.24.4. We actually neednumpy==1.26.4, however,pyretechnics==2025.5.15can't be installed withnumpy==1.26.4so we'll upgradenumpy==1.24.4tonumpy==1.26.4after installing the packages with therequirements.txtfile.
conda install numpy==1.26.4
The Pyretechnics analysis is organized in divergence_pipeline/.
Run the scripts in order to export EO tile inputs, create local pyrome samples, train RF
models, compute tile-level accuracy, run pyretechnics outputs, and then compute divergence
metrics.
Exports satellite embeddings, LANDFIRE fuels, canopy structure, terrain, HLS stats, climate normals, and vegetation layers to GCS, skipping outputs that already exist.
python divergence_pipeline/1_export_embeddings_tiles.py \
--year 2022 \
--tilenums 01180 00371
Optional: select tiles by pyrome IDs.
python divergence_pipeline/1_export_embeddings_tiles.py \
--year 2022 \
--pyromes 12 27
Downloads pyrome tile GeoTIFFs from GCS, builds per-layer VRT mosaics, performs stratified sampling, and uploads per-pyrome sample CSVs back to GCS.
python divergence_pipeline/2_local_mosaic_sample.py \
--pyromes 27 \
--year 2022 \
--mode equal \
--points-per-class 3000
Trains RF model(s) from pyrome sample CSVs (or a single local CSV), saves model/scaler artifacts, and writes training accuracy + baseline metrics.
python divergence_pipeline/3_train_models.py \
--pyromes 27 \
--year 2022 \
--mode equal \
--output-dir data
Loads trained model(s), runs tile inference from local temp/pyrome_*/tile_* rasters, and
writes tile-level classification metrics to outputs/.
python divergence_pipeline/4_tile_accuracy_metrics.py \
--pyromes 27 \
--year 2022
Runs RF inference per tile and simulates fire behavior for LANDFIRE fuels vs predicted fuels,
writing output rasters to outputs/<tilenum>/.
python divergence_pipeline/5_pyro_pipeline.py \
--pyromes 27 \
--year 2022
Optional: limit to specific tiles.
python divergence_pipeline/5_pyro_pipeline.py \
--pyromes 27 \
--tilenums 01180 00371 \
--year 2022
Computes summary metrics using fuel-model F1 score, fire-type Jaccard, and RMSE for fireline intensity, flame length, spread rate, and spread direction; optionally exports Plotly HTML plots of those metrics vs tile accuracy.
python divergence_pipeline/6_divergence_metrics.py \
--pyromes 27 \
--year 2022
Optional: disable plot export.
python divergence_pipeline/6_divergence_metrics.py \
--pyromes 27 \
--year 2022 \
--no-plot