Skip to content

NASA Space Apps Challenge 2025 Project Forecasting air quality using TEMPO satellite data, ground sensors, and machine learning

License

Notifications You must be signed in to change notification settings

bethwel3001/predictions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

59 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NASA TEMPO Air Quality Forecasting Platform 🌍

License: MIT Python 3.9+ React 18

NASA Space Apps Challenge 2025 Project
Forecasting air quality using TEMPO satellite data, ground sensors, and machine learning

πŸš€ Quick Start (Focus: Backend API)

Prerequisites

  • Python 3.9+ (tested with 3.12+)
  • UV package manager (optional but recommended)
  • Node.js 18+ (for frontend, optional)

Backend Setup (5 minutes)

# 1. Clone the repository
git clone https://github.com/bethwel3001/predictions.git
cd predictions/predictions

# 2. Create virtual environment with UV (fast!)
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# 3. Install dependencies
uv pip install fastapi uvicorn requests pyyaml pydantic pydantic-settings python-multipart python-dotenv

# 4. Add envrionment variables
EARTHDATA_USERNAME="your_username"
EARTHDATA_PASSWORD="your_password"

# 5. Start the backend server
cd backend
python3 src/api/main.py

That's it! πŸŽ‰

Access Points

Test the New Endpoints

# Test OpenAQ (global ground monitoring)
curl "http://localhost:8000/api/v1/openaq/latest?country=US&limit=5"

# Test Pandora (NASA validation network)
curl "http://localhost:8000/api/v1/pandora/sites"

# Test Data Attribution
curl "http://localhost:8000/api/v1/attribution"

πŸ“ Project Structure

Focus: Backend API & Data Processing

predictions/
β”œβ”€β”€ backend/                  # Python backend (CORE)
β”‚   └── src/
β”‚       β”œβ”€β”€ data_ingestion/  # ⭐ Data fetchers (OpenAQ, Pandora, TEMPO, AirNow, PurpleAir)
β”‚       β”œβ”€β”€ database/        # SQLAlchemy models
β”‚       β”œβ”€β”€ ml_models/       # Forecasting models
β”‚       β”œβ”€β”€ api/             # ⭐ FastAPI endpoints (14 endpoints)
β”‚       β”œβ”€β”€ notifications/   # Alert system
β”‚       β”œβ”€β”€ pipeline/        # Data orchestration
β”‚       └── utils/           # Helper functions
β”œβ”€β”€ frontend/                # React frontend (ready for integration)
β”‚   β”œβ”€β”€ src/                 # React components
β”‚   └── public/              # Static assets
β”œβ”€β”€ config/                  # Configuration files
β”œβ”€β”€ data/                    # Data storage (cache, raw, processed)
β”œβ”€β”€ models/                  # Saved ML models
β”œβ”€β”€ scripts/                 # Setup scripts
β”œβ”€β”€ tests/                   # Test suites
β”œβ”€β”€ docker-compose.yml       # Local development
└── requirements.txt         # Python dependencies

πŸ› οΈ Technology Stack

Backend (Core Focus)

  • API Framework: FastAPI 0.118+ with auto-generated OpenAPI docs
  • Data Fetchers:
    • OpenAQ (global ground monitoring)
    • Pandora (NASA satellite validation)
    • TEMPO (satellite data)
    • AirNow (EPA network)
    • PurpleAir (community sensors)
  • Data Processing: pandas, numpy, xarray
  • Database: PostgreSQL with PostGIS (optional)
  • Cache: Redis (optional)
  • ML Models: scikit-learn, TensorFlow (optional)

Frontend (Pre-built, Ready to Integrate)

  • Framework: React 18 + Vite
  • Styling: Tailwind CSS
  • Icons: React Icons

Development

  • Package Manager: UV (ultra-fast Python package manager)
  • Containers: Docker & Docker Compose
  • Testing: pytest

🌳 Development Workflow

Branch Strategy

See prompt.md for detailed branching strategy.

# Create feature branch
git checkout -b feature/data-tempo-fetcher

# Make changes and commit
git add .
git commit -m "feat(data): implement TEMPO satellite data fetcher"

# Push and create PR
git push origin feature/data-tempo-fetcher

Commit Convention

Follow Conventional Commits:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation
  • refactor: Code refactoring
  • test: Tests
  • chore: Maintenance

πŸ§ͺ Testing

# Run Python tests
pytest tests/ 

#OR
# Make sure you are in the 'predictions/' directory
python -m pytest -v tests/test_tempo_fetcher.py #for temp_fetcher

# Run with coverage
pytest --cov=src tests/

# Run frontend tests
cd frontend
npm test

πŸ“Š Data Sources

  1. NASA TEMPO: Satellite air quality data
  2. EPA AirNow: Ground-based sensor network
  3. PurpleAir: Community air quality sensors
  4. OpenWeather: Meteorological data

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘₯ Team

NASA Space Apps Challenge 2025 Team

πŸ™ Acknowledgments

  • NASA for TEMPO satellite data
  • EPA for AirNow API access
  • PurpleAir for sensor data
  • OpenWeather for meteorological data

πŸ“ž Support

For questions or issues, please open an issue on GitHub.


Built with ❀️ for NASA Space Apps Challenge 2025

About

NASA Space Apps Challenge 2025 Project Forecasting air quality using TEMPO satellite data, ground sensors, and machine learning

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6