Skip to main content

A modern Python implementation of the Canadian Forest Fire Weather Index (FWI) System

Project description

Wildfire-fwi

A modern Python implementation of the Canadian Forest Fire Weather Index (FWI) System.

This repository provides the core components for calculating the Canadian Forest Fire Danger Rating System (CFFDRS) indices, based on daily meteorological observations.

Overview

The FWI system consists of six components that rate the relative fire potential. The components account for the effects of fuel moisture and wind on fire behavior.

Calculated indices:

  • FFMC: Fine Fuel Moisture Code
  • DMC: Duff Moisture Code
  • DC: Drought Code
  • ISI: Initial Spread Index
  • BUI: Buildup Index
  • FWI: Fire Weather Index

Requirements

  • Python >= 3.8
  • pytest (for running tests)

Installation

To install the package in editable mode with test dependencies:

pip install -e ".[test]"

Usage

You can import the calculation functions from the wildfire_fwi package:

from wildfire_fwi import (
    calculate_ffmc,
    calculate_dmc,
    calculate_dc,
    calculate_isi,
    calculate_bui,
    calculate_fwi
)

# Example: FFMC Calculation
# Parameters: temperature, relative humidity, wind speed, precipitation, previous FFMC
ffmc = calculate_ffmc(17.0, 42.0, 25.0, 0.0, 85.0)
print(f"FFMC: {ffmc}")

Scripts & Commands

  • Run tests:
    pytest
    

Project Structure

wildfire-fwi/
├── src/
│   └── wildfire_fwi/
│       ├── __init__.py    # Package entry point
│       └── core.py        # Core FWI calculation logic
├── tests/
│   └── test_table7.py     # Validation against Standard Reference Data (Table 7)
├── pyproject.toml         # Project metadata and dependencies
├── LICENSE                # MIT License
└── README.md              # Project documentation

Tests

The project uses pytest for validation. The test suite includes a validation against the standard FWI "Table 7" reference data to ensure accuracy.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wildfire_fwi-0.1.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wildfire_fwi-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file wildfire_fwi-0.1.0.tar.gz.

File metadata

  • Download URL: wildfire_fwi-0.1.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for wildfire_fwi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 44716b9e5db7cb35365029fbc4ce4ea39fa87d46ad57f17107a2b457bd8e04c0
MD5 2bb366f2bfc76c6b54533e26070a4a4e
BLAKE2b-256 0a46b19868e187cebaada8a538210bffc1d1da36853e8ecb5162a2bba5fb2155

See more details on using hashes here.

File details

Details for the file wildfire_fwi-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wildfire_fwi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for wildfire_fwi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11a0624440ade7f7402b24d64028bc51ae1219f93836d1d0d59f813b329bacbd
MD5 bdb886af579ed82ab7fac047709d461b
BLAKE2b-256 eedd7c8af0e2eba5c335e2fe5907639f893f09e1425d6f94fd21923b280b80e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page