Python library for post-fire assessment and wildfire analysis using Google Earth Engine.
Project description
wildfire-analyser
Python project for post-fire assessment and burned area analysis using Sentinel-2 imagery and Google Earth Engine (GEE).
This project supports multiple spectral indices (dNBR, dNDVI, RBR), visual products, and paper-ready burned area statistics.
Scientific Background
This project is based on the peer-reviewed study:
Spatial and statistical analysis of burned areas with Landsat-8/9 and Sentinel-2 satellites: 2023 Çanakkale forest fires Authors: Deniz Bitek, Fusun Balik Sanli, Ramazan Cuneyt Erenoglu Study area: Çanakkale Province, Turkey
The methodology implemented in wildfire-analyser follows the same analytical framework and burn severity thresholds described in the paper, particularly for the Sentinel-2–based analysis, including:
- dNBR, dNDVI and RBR indices
- Burn severity classification tables
- Area statistics in hectares and percentage
Minor numerical differences may occur due to cloud masking, spatial sampling, and Google Earth Engine implementation details.
Installation and Usage
Follow the steps below to install and test wildfire-analyser inside an isolated environment:
mkdir /tmp/test
cd /tmp/test
python3 -m venv venv
source venv/bin/activate
pip install wildfire-analyser
Required Files Before Running the Client
Before running the client, you must prepare the following items:
1. Add a GeoJSON polygon (ROI)
Create a folder named polygons in the project root and place your ROI polygon file inside it:
/tmp/test/
├── polygons/
│ └── your_polygon.geojson
└── venv/
Example GeoJSON files are available in the repository (e.g. canakkale_aoi_1.geojson).
2. Create the .env file with GEE credentials
In the project root, add a .env file containing your Google Earth Engine authentication variables.
A .env.template file is available in the repository.
/tmp/test/
├── .env
├── polygons/
└── venv/
Running the Client (Standard Mode)
After adding the .env file and your GeoJSON polygon:
python3 -m wildfire_analyser.client \
--roi polygons/canakkale_aoi_1.geojson \
--start-date 2023-07-01 \
--end-date 2023-07-21 \
--days-before-after 1
This will:
- Run the post-fire assessment pipeline
- Generate visual thumbnail URLs
- Generate scientific GeoTIFF outputs (when applicable)
- Compute burned area statistics
- Print all results to the terminal
Deliverables
You may explicitly select deliverables using --deliverables.
Scientific products
RGB_PRE_FIRERGB_POST_FIRENDVI_PRE_FIRENDVI_POST_FIRENBR_PRE_FIRENBR_POST_FIREDNDVIDNBRRBR
Visual products
RGB_PRE_FIRE_VISUALRGB_POST_FIRE_VISUALDNDVI_VISUALDNBR_VISUALRBR_VISUALDNBR_SEVERITY_VISUAL
Severity maps and statistics
DNBR_SEVERITY_MAPDNBR_AREA_STATISTICSDNDVI_AREA_STATISTICSRBR_AREA_STATISTICS
Example:
python3 -m wildfire_analyser.client \
--roi polygons/canakkale_aoi_1.geojson \
--start-date 2023-07-01 \
--end-date 2023-07-21 \
--deliverables DNBR_VISUAL DNBR_AREA_STATISTICS \
--days-before-after 1
If --deliverables is not provided, all available deliverables are generated.
Paper Preset Mode (Reproducibility)
The client also supports paper presets, which are predefined experimental configurations designed to reproduce published results.
Example preset: PAPER_DENIZ_FUSUN_RAMAZAN
Run:
python3 -m wildfire_analyser.client \
--deliverables PAPER_DENIZ_FUSUN_RAMAZAN
This preset:
- Executes the analysis for two distinct burned areas
- Uses paper-aligned temporal windows
- Generates only visual outputs and statistics
- Does not export scientific GeoTIFFs
- Prints results grouped by area
Internally, it runs:
| Area | ROI | Pre-fire | Post-fire |
|---|---|---|---|
| Area 1 | canakkale_aoi_1.geojson |
2023-07-01 | 2023-07-21 |
| Area 2 | canakkale_aoi_2.geojson |
2023-07-31 | 2023-08-30 |
Help
For help and full usage information:
python3 -m wildfire_analyser.client --help
Setup Instructions for Developers
- Clone the repository
git clone git@github.com:camargo-advanced/wildfire-analyser.git
cd wildfire-analyser
- Create a virtual environment
python3 -m venv venv
- Activate the virtual environment
source venv/bin/activate
- Install dependencies
pip install -r requirements.txt
- Configure environment variables
Copy your .env file to the project root.
A .env.template file is provided.
- Run the sample client
python3 -m wildfire_analyser.client \
--roi polygons/canakkale_aoi_1.geojson \
--start-date 2023-07-01 \
--end-date 2023-07-21 \
--days-before-after 1
Useful Commands
Deactivate the virtual environment
deactivate
Build and publish a new PyPI release
rm -rf dist/*
python -m build
twine upload dist/*
Citation
If you use this software for scientific work, please cite:
Spatial and statistical analysis of burned areas with Landsat-8/9 and Sentinel-2 satellites: 2023 Çanakkale forest fires Deniz, Füsun, Ramazan.
And cite this repository as the reference implementation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wildfire_analyser-0.2.7.tar.gz.
File metadata
- Download URL: wildfire_analyser-0.2.7.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5557826cc0c8bc872f92b73733cbb08622b97bcd3a1feb36d846e039212306f1
|
|
| MD5 |
f664407d30351eb1aaa3125eecdc9e55
|
|
| BLAKE2b-256 |
888ce5cf491d9ac8dda2a2a0c549240988a8d78cdad04676d0b605579c9c7dfa
|
File details
Details for the file wildfire_analyser-0.2.7-py3-none-any.whl.
File metadata
- Download URL: wildfire_analyser-0.2.7-py3-none-any.whl
- Upload date:
- Size: 21.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79365ef9259d5bdb24794ab6bafef5c82fccd38df0d720e093175e4ca960c6e5
|
|
| MD5 |
9ebeec71b955b525c308dcf58bf7d41c
|
|
| BLAKE2b-256 |
d333c9d3fda415dbd6269aaa7dacf9faa903fb7bb157f6bf23b17a6cde0b7914
|