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.
- Authentication Details
- Features
- File Structure
- Installation
- Configuration
- Usage
- Input/Output Specifications
- Function Documentation
- Error Handling
- Performance Considerations
- Contributors and Support
- License
- Data Privacy Note
To authenticate with OpenEO, you need OIDC credentials.
- Register at Copernicus Data Space to obtain login credentials.
- Create a connection with Copernicus API:
openeo: connection = connect_to_openeo()
- 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 and NBR 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.
atash/
├── __init__.py # Package initialization file
├── atash.py # Library source code for fire detection and classification
License
README.md # Project documentation
Test.ipynb # Jupyter notebook for testing and demonstration
setup.py # Script for library installation
-
Python 3.6+
-
Pip and Git
-
Install with pip
!pip install atash
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_nbr(connection, extent, start_date, end_date)
load_pre_ndvi(connection, extent, start_date, end_date)
post_nbr(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()
fire_severity_multiclass()
severity_kmeans()- Format:
.tifffiles for raster data from openeo. - 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.
- 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.
- ``: Pre-event NDVI raster.
- ``: Post-event NDVI raster.
- ``: Pre-event NBR raster.
- ``: Post-event NBR raster.
- ``: Water mask raster.
- ``: Wildfire Severity by NDVI and surface area of them.
- ``: Wildfire Severity by NBR and surface area of them.
- ``: Wildfire Severity by NDVI and NBR and surface area of them.
- ``: K-Means Clustering of wildfire.
| 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 |
load_pre_nbr() |
Loads pre-event NBR data | connection, extent, start_date, end_date |
load_post_nbr() |
Loads post-event NBR data | connection, extent, start_date, end_date |
fire_detector_nbr() |
Detects fire-affected pixels via NBR | - |
fire_area_nbr() |
Detects fire-affected areas via NBR | - |
fire_area_ndvi() |
Detects fire-affected areas via NDVI | - |
severity_ndvi() |
Classifies fire severity (NDVI) | - |
severity_nbr() |
Uses KMeans clustering for classification | - |
severity_kmeans() |
Uses KMeans clustering for classification | - |
-
OpenEO Connection Error:
- Message: "Failed to connect to OpenEO: [specific error]"
- Solution: Check the OpenEO URL, credentials, and internet connection.
-
FileNotFoundError:
- Message: "File not found:
NDVI_PRE.tiff" - Solution: Ensure the required
.tifffiles are present in the 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.
- Processing Time:
- Small ROI (<500 km²): ~15 minutes.
- Large ROI (>1000 km²): ~30 minutes.
- System Requirements:
- 8GB RAM (minimum).
- Multi-core CPU recommended.
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.
Atash is licensed under the MIT License. This means:
-
Permission is Granted to:
-
Use the software for personal, academic, or commercial purposes.
-
Modify and distribute the code under the same license.
-
Limitations:
-
The software is provided "as is," without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement.
For the full license text, see the LICENSE file in the repository.
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.
