Skip to main content

Atash: Fire Detection and Severity Classification using Remote Sensing Data

Atash is an open-source Python library designed for fire detection and burn severity classification using remote sensing data. It integrates with OpenEO to process Sentinel-2 imagery and generates detailed NDVI, NBR, and NDWI maps for analysis.

Table of Contents

  1. Authentication Details
  2. Features
  3. File Structure
  4. Installation
  5. Configuration
  6. Usage
  7. Input/Output Specifications
  8. Function Documentation
  9. Error Handling
  10. Performance Considerations
  11. Contributors and Support
  12. License
  13. Data Privacy Note

1. Authentication Details

To authenticate with OpenEO, you need OIDC credentials.

  1. Register at Copernicus Data Space to obtain login credentials.
  2. Create a secrets.yaml file with the following contents:
    openeo:
      url: "https://openeo.dataspace.copernicus.eu"
      authentication: "OIDC"
    
  3. Ensure secrets.yaml is excluded from version control using .gitignore.

2. Features

  • OpenEO Integration: Easily connect and authenticate using OIDC.
  • NDVI, NBR, and NDWI Calculations: Compute vegetation health, burn severity, and water indices.
  • Fire Detection: Detect fire-affected areas using NDVI and NBR differences.
  • Severity Classification: Classify burn severity using thresholds and KMeans clustering.
    • KMeans Clustering: Groups pixels into clusters based on NDVI, NBR, and NDWI values to classify fire severity levels.
  • Interactive ROI Selection: Use an interactive map to define spatial extents.
  • Water Masking: Improve accuracy by excluding water bodies using NDWI.

3. File Structure

atash/
├── data/
│   └── README.md (instructions for adding `.tiff` files)
├── src/
│   └── atash.py (library source code)
├── requirements.txt (library dependencies)
├── secrets.yaml (authentication credentials, ignored in `.gitignore`)
└── README.md (project documentation)

4. Installation

Prerequisites

  • Python 3.8+
  • Pip and Git

Steps

  1. Clone the repository:
    git clone https://github.com/username/Atash.git
    cd Atash
    
  2. Create a virtual environment:
    python -m venv env
    source env/bin/activate  # For Windows: env\\Scripts\\activate
    
  3. Install dependencies:
    pip install -r requirements.txt
    

5. Configuration

secrets.yaml Setup

Ensure your secrets.yaml contains the required URL and authentication mode.


6. Usage

Complete Workflow Example

from atash import connect_to_openeo, load_map, get_start_and_end_dates, load_pre_ndvi, load_post_ndvi, fire_detector_ndvi, severity_ndvi

# Step 1: Connect to OpenEO
connection = connect_to_openeo()

# Step 2: Define area of interest
map_interface = load_map()

# Step 3: Set temporal extent
start_date, end_date = get_start_and_end_dates()

# Step 4: Process pre/post-event data
load_pre_ndvi(connection, extent, start_date, end_date)
load_post_ndvi(connection, extent, start_date, end_date)

# Step 5: Analyze fire impact
fire_detector_ndvi()
severity_ndvi()

7. Input/Output Specifications

Input Data:

  • Format: .tiff files for raster data.
  • Required Bands:
    • B03 (Green), B04 (Red), B08 (NIR), B12 (SWIR).
  • Coordinate Reference System (CRS): Input rasters must have the same CRS (e.g., EPSG:4326).
  • Raster Resolution: Assumed to be 10m x 10m.

File Naming Conventions:

  • Ensure consistent file naming:
    • NDVI_PRE.tiff for pre-event NDVI.
    • NBR_PRE.tiff for pre-event NBR.
    • NDWI.tiff for water mask rasters.
    • NDVI_Post.tiff for post-event NDVI.
    • NBR_Post.tiff for post-event NBR.

Output Files:

  • ``: Pre-event NDVI raster.
  • ``: Post-event NDVI raster.
  • ``: Pre-event NBR raster.
  • ``: Post-event NBR raster.
  • ``: Water mask raster.

8. Function Documentation

API Reference Table

Function Purpose Parameters
connect_to_openeo() Establishes OpenEO connection -
load_map() Displays an interactive map for ROI -
get_start_and_end_dates() Captures start and end dates -
load_pre_ndvi() Loads pre-event NDVI data connection, extent, start_date, end_date
load_post_ndvi() Loads post-event NDVI data connection, extent, start_date, end_date
fire_detector_ndvi() Detects fire-affected areas via NDVI -
severity_ndvi() Classifies fire severity (NDVI) -
severity_kmeans() Uses KMeans clustering for classification -

9. Error Handling

Common Issues and Solutions

  1. OpenEO Connection Error:

    • Message: "Failed to connect to OpenEO: [specific error]"
    • Solution: Check OpenEO URL, credentials, and internet connection.
  2. FileNotFoundError:

    • Message: "File not found: NDVI_PRE.tiff"
    • Solution: Ensure the required .tiff files are present in the data/ folder.
  3. MemoryError:

    • Message: "Unable to allocate array"
    • Solution: Reduce raster size or increase system memory.
  4. Data Format Issue:

    • Message: "Invalid raster dimensions"
    • Solution: Ensure input .tiff files have matching resolutions and CRS.
  5. Median Filter Missing Dependency:

    • Message: "ModuleNotFoundError: No module named 'scipy'"
    • Solution: Install scipy using pip install scipy.

10. Performance Considerations

  • Processing Time:
    • Small ROI (<50 km²): ~5 minutes.
    • Large ROI (>500 km²): ~30 minutes.
  • System Requirements:
    • 8GB RAM (minimum).
    • Multi-core CPU recommended.

11. Contributors and Support

We extend our gratitude to the contributors of the "Atash" project. You can explore their profiles for more projects and collaborations:

For support or contributions, feel free to contact us.

12. License

This project is released under the MIT License.


13. Data Privacy Note

Atash does not store or log user data. Any authentication or API usage is handled securely via OpenEO's OIDC protocol. Ensure you review OpenEO's privacy policy for their data handling practices.


Contributions are welcome! Feel free to open issues or submit pull requests.

Metadata

Release files for atash 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atash 0.1.8
File Size Uploaded
atash-0.1.8.tar.gz 13.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for atash 0.1.8
File Interpreter ABI Platform
atash-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 24.8 kB

Release files / atash-0.1.8.tar.gz

Download URL atash-0.1.8.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
91aaa08343688e81445f486a72941f5e4e3313136c45f8c4e41828abdc4e39b9
BLAKE2b-256 checksum
How to use checksums
5310ff5ff72bb103f79e42a2e589116824221dc48a2e9897a43898a25d92f487
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.10

Release files / atash-0.1.8-py3-none-any.whl

Download URL atash-0.1.8-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ff14717226f13f3c32c56858dfcb528d19d988e59ce9d7d4a0362c597296a21
BLAKE2b-256 checksum
How to use checksums
eeaf2c009fea9c427df55d72e60ae8ceee57f5e844b2117e86c5df380554b462
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.10

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page