Skip to main content

A library for satellite image processing and fire analysis.

Project description

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.

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

atash-0.1.7.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

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

atash-0.1.7-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file atash-0.1.7.tar.gz.

File metadata

  • Download URL: atash-0.1.7.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.10

File hashes

Hashes for atash-0.1.7.tar.gz
Algorithm Hash digest
SHA256 413586b1905b792fc0745cf85f7cffc924c33176b43e6bf5617d00d6864dba12
MD5 d7a466ce4136e0b26f177c357d630c6f
BLAKE2b-256 6530f7f55043959cbeb60c0c84ec32be734cc02da05c36b8af5fe0ae47a3b28c

See more details on using hashes here.

File details

Details for the file atash-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: atash-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.10

File hashes

Hashes for atash-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d367f2f264a4875787334a7a475f710d870a1ee55fce84e87f925e4a7191367c
MD5 f754e136bd1df755cf4ecf765c64eab6
BLAKE2b-256 68735c404706bacccd8d4eb4321f7b049f420d5e62821c489e9c674409d0507c

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