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
- Authentication Details
- Features
- File Structure
- Installation
- Configuration
- Usage
- Input/Output Specifications
- Function Documentation
- Error Handling
- Performance Considerations
- Contributors and Support
- License
- Data Privacy Note
1. Authentication Details
To authenticate with OpenEO, you need OIDC credentials.
- Register at Copernicus Data Space to obtain login credentials.
- Create a
secrets.yamlfile with the following contents:openeo: url: "https://openeo.dataspace.copernicus.eu" authentication: "OIDC"
- Ensure
secrets.yamlis 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
- Clone the repository:
git clone https://github.com/username/Atash.git cd Atash
- Create a virtual environment:
python -m venv env source env/bin/activate # For Windows: env\\Scripts\\activate
- 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:
.tifffiles 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.tifffor pre-event NDVI.NBR_PRE.tifffor pre-event NBR.NDWI.tifffor water mask rasters.NDVI_Post.tifffor post-event NDVI.NBR_Post.tifffor 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
-
OpenEO Connection Error:
- Message: "Failed to connect to OpenEO: [specific error]"
- Solution: Check OpenEO URL, credentials, and internet connection.
-
FileNotFoundError:
- Message: "File not found:
NDVI_PRE.tiff" - Solution: Ensure the required
.tifffiles are present in thedata/folder.
- Message: "File not found:
-
MemoryError:
- Message: "Unable to allocate array"
- Solution: Reduce raster size or increase system memory.
-
Data Format Issue:
- Message: "Invalid raster dimensions"
- Solution: Ensure input
.tifffiles have matching resolutions and CRS.
-
Median Filter Missing Dependency:
- Message: "ModuleNotFoundError: No module named 'scipy'"
- Solution: Install
scipyusingpip 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:
- Bahman Amirsardary – bahman.amirsardary@mail.polimi.it.
- Hadi Kheiri Gharajeh – hadi.kheiri@mail.polimi.it.
- Milad Ramezani Ziarani – Milad.ramezani@mail.polimi.it.
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
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 atash-0.1.6.tar.gz.
File metadata
- Download URL: atash-0.1.6.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f368d907ef0f1a73f3a687a0cdaf3fc051b9372a8702c94bfe5ce726a5b162dc
|
|
| MD5 |
6f6e9dd8f6c60996fbd3d67a61345e47
|
|
| BLAKE2b-256 |
24ecee04a0e49617efecc0ad5dc33a1635248f1e706b7fec8b51964d40dfd643
|
File details
Details for the file atash-0.1.6-py3-none-any.whl.
File metadata
- Download URL: atash-0.1.6-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4596eb0a6b9132a4e6f526436c937a7ddf2baa17f1a182c69dfea2a82fde9d56
|
|
| MD5 |
c0e41a746f27074bd1e4b731d087c513
|
|
| BLAKE2b-256 |
c86faab4e5de8a3a865438989ebbea795bd1c6ae3b6233ba8d032c98297273c6
|