Bloom is an open-source transparency tool for monitoring desert wildflower bloom conditions with NASA Earth observation data. It retrieves Landsat 8/9 and Sentinel-2 surface reflectance scenes from the Microsoft Planetary Computer, extracts vegetation indices, and reports whether results come from real pixels or simulated fallback data so field teams can interpret alerts with appropriate caution.
- Satellite ingestion using the STAC API to locate Landsat 8/9 Collection 2 Level-2 and Sentinel-2 Level-2A scenes within a configurable buffer around a point of interest.
- Vegetation analytics including NDVI and EVI calculations, bloom event detection, trend scoring, and ecological context summaries.
- Regional scanning that sweeps a larger bounding box for hotspots and tallies how many points relied on verified pixels versus demo data.
- Data provenance reporting surfaced across API responses and the web UI so users always know the origin and reliability of each result.
frontend (vanilla JS) <-- Flask static serving --> backend/app.py
|--> SatelliteDataFetcher
|--> BloomDetector, BloomPredictor
|--> VegetationIndexCalculator
|--> SpeciesIdentifier
|--> RegionalScanner
- The Flask backend (
backend/app.py) serves API endpoints and the static frontend (frontend/). backend/data_fetcher.pyinteracts with the Microsoft Planetary Computer and applies NDVI/EVI calculations with Rasterio, NumPy, and SciPy.backend/bloom_detector.py,backend/bloom_predictor.py, andbackend/species_identifier.pyderive bloom events, forecast signals, and species context.frontend/index.htmlandfrontend/app.jsprovide a map-driven interface that calls the API and displays provenance status banners.
- Python 3.11 or later
pipfor dependency management- Optional (recommended) access to the Microsoft Planetary Computer (MPC) account for higher request limits
- Optional NASA Earthdata credentials (only required if you extend the fetcher to use services beyond MPC)
# Clone the repository
git clone https://github.com/krikera/bloom.git
cd bloom
# Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate
# Install Python dependencies
pip install -r requirements.txtCreate a .env file in the project root if you need to override defaults:
EARTHDATA_USERNAME=your_username # optional; not required for MPC data
EARTHDATA_PASSWORD=your_password # optional
CACHE_DIR=./data/cache # location for cached STAC responses
The fetcher defaults to demo mode when real imagery cannot be retrieved. Provenance summaries in API responses explain whether results relied on real pixels.
# From the project root with the virtual environment active
cd backend
python app.pyThis starts the Flask server on http://127.0.0.1:5000/ and serves both the API and the frontend UI. Satellite requests may take several seconds while scenes download and process.
| Dataset | Description | Link |
|---|---|---|
| Landsat Collection 2 Level-2 Surface Reflectance | Landsat 8/9 optical measurements used for NDVI/EVI | https://planetarycomputer.microsoft.com/dataset/landsat-c2-l2 |
| Sentinel-2 Level-2A | Harmonized Sentinel-2 imagery providing higher temporal resolution | https://planetarycomputer.microsoft.com/dataset/sentinel-2-l2a |
| Microsoft Planetary Computer | Hosting platform that signs data URLs and provides STAC search | https://planetarycomputer.microsoft.com/ |
Pull requests are welcome. Please include tests for new backend logic and keep documentation consistent with the current behaviour, especially around data provenance and fallback modes.