Made for Team Digi Shakti - Smart India Hackathon (SIH)
A comprehensive real-time space weather monitoring and Coronal Mass Ejection (CME) detection system with predictive analytics. This system provides real-time monitoring, detection, and forecasting of space weather events including CMEs, geomagnetic storms, and solar activity.
- Live Space Weather Data: Real-time monitoring of 15+ space weather parameters
- CME Detection: Automated detection of Coronal Mass Ejections using machine learning
- Geomagnetic Storm Tracking: Live geomagnetic indices (Kp, DST, Ap, F10.7)
- Solar Activity Monitoring: Solar flares, sunspot numbers, and solar wind parameters
- 7-Day Forecast: Multi-parameter space weather forecasting using LSTM models
- CME Arrival Prediction: Time and direction prediction for CME events
- Geomagnetic Storm Prediction: Storm intensity and timeline forecasting
- Composite Index: Unified space weather index using Principal Component Analysis (PCA)
- Satellite Field Data Prediction: Match satellite coordinates with NOAA wind data for CME probability assessment
- 3D Visualizations: Interactive 3D animations for space weather parameters
- Data Import/Export: Support for CDF file uploads and CSV exports
- Historical Analysis: View and analyze past CME events and space weather data
- FastAPI: High-performance Python web framework
- Machine Learning: scikit-learn, scipy for CME detection algorithms
- Data Processing: pandas, numpy for data manipulation
- Database: PostgreSQL with SQLAlchemy ORM
- Real-time Data: Integration with NOAA Space Weather Prediction Center APIs
- React 18: Modern UI framework with TypeScript
- Vite: Fast build tool and dev server
- Framer Motion: Smooth animations and transitions
- Three.js: 3D visualizations and space weather animations
- Recharts: Real-time data visualization
- Shadcn UI: Beautiful, accessible component library
- Tailwind CSS: Utility-first CSS framework
- Python 3.11+
- Node.js 18+ and npm
- PostgreSQL (optional, for database features)
- Git
git clone https://github.com/deepaksinghh12/Cme-detection-.git
cd Cme_detection_Phased2cd backend
# Create virtual environment (recommended)
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# Linux/Mac:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtcd frontend
# Install dependencies
npm installcd backend
python main.pyBackend will run on http://localhost:8002
cd frontend
npm run devFrontend will run on http://localhost:8080
Access the main dashboard at http://localhost:8080 for an overview of:
- Real-time space weather metrics
- Recent CME events
- System status and health monitoring
- Quick access to all features
The application is organized into phases:
-
Phase 1 (/phase1): Live Space Weather Data
- Real-time monitoring of 15+ parameters
- 4-grid layout with graphs, animations, and safety analysis
- Auto-refresh every 60 seconds
-
Phase 2 (/phase2): CME Prediction
- Arrival time prediction
- Direction forecasting
- Forecast visualizations
-
Phase 3 (/phase3): Live Geomagnetic Storm
- Real-time geomagnetic monitoring
- Storm intensity tracking
- Current storm effects
-
Phase 4 (/phase4): Geomagnetic Storm Prediction
- Time regression models
- Storm intensity prediction
- Future timeline visualization
-
Phase 5 (/phase5): Video & Image Animation
- Combined CME + Storm animations
- Video generation
- Image export capabilities
-
Field Data Prediction (/phase): Satellite CME Probability
- Select satellite by NORAD ID
- Match coordinates with NOAA wind data
- Calculate CME occurrence probability
View all recent CME events at /recent-cme-events with detailed analysis and detection results.
GET /api/data/summary- Get data summary and system statusGET /api/data/realtime- Get real-time solar wind dataGET /api/data/particle- Get particle dataPOST /api/data/upload- Upload CDF file for analysis
GET /api/cme/recent- Get recent CME eventsPOST /api/ml/analyze-cdf- Analyze CDF file for CME detection
GET /api/geomagnetic/storm/live- Get live geomagnetic indicesGET /api/forecast/predictions- Get 7-day forecast predictions
GET /api/satellites- Get list of satellitesGET /api/satellites/{norad_id}- Get satellite detailsGET /api/satellites/{norad_id}/cme-prediction- Get CME probability for satellite
GET /api/noaa/alerts- Get space weather alertsGET /api/noaa/solar-flares- Get solar flare dataGET /api/noaa/images/{source}- Get image sequences
Cme_detection_Phased2/
βββ backend/
β βββ main.py # FastAPI application
β βββ noaa_realtime_data.py # NOAA data fetcher
β βββ database.py # Database models
β βββ scripts/ # ML models and scripts
β βββ requirements.txt # Python dependencies
β
βββ frontend/
β βββ src/
β β βββ pages/ # Page components
β β βββ components/ # Reusable components
β β βββ lib/ # Utilities and API client
β β βββ App.tsx # Main app component
β βββ package.json # Node dependencies
β βββ vite.config.ts # Vite configuration
β
βββ README.md # This file
The system uses a multi-parameter approach to detect CME events:
- Velocity Threshold: Detects high-speed solar wind streams (>600 km/s)
- Density Spikes: Identifies sudden density increases
- Temperature Anomalies: Monitors proton temperature variations
- Bz Component Analysis: Tracks southward magnetic field (Bz < -10 nT)
- Composite Scoring: Weighted combination of all parameters
- Training Data: 29 years of historical space weather data
- Model Type: LSTM (Long Short-Term Memory) neural network
- Parameters: DST, Kp, Ap, Sunspot Number
- Accuracy: 97.3% overall accuracy
- Forecast Period: 7 days ahead
A unified space weather index combining:
- DST Index (Disturbance Storm Time)
- Kp Index (Planetary K-index)
- Ap Index (Daily geomagnetic activity)
- Sunspot Number Uses Principal Component Analysis (PCA) for optimal parameter combination.
Edit backend/config.yaml for:
- Database connection settings
- NOAA API endpoints
- Model parameters
- Detection thresholds
Edit frontend/src/lib/api.ts to configure:
- API base URL
- Request timeouts
- Retry policies
-
Backend Issues:
- Port 8002 already in use: Change port in
main.pyor kill the process. - Database connection errors: Ensure PostgreSQL is running (if using database).
- Missing dependencies: Run
pip install -r requirements.txt.
- Port 8002 already in use: Change port in
-
Frontend Issues:
- Port 8080 already in use: Vite will automatically use next available port.
- Module not found: Run
npm installto install dependencies. - Build errors: Check Node.js version (requires 18+).
- NOAA Space Weather Prediction Center: Real-time solar wind and geomagnetic data
- NASA OMNIWeb: Historical space weather datasets
- Aditya L1: Solar observation data (when available)
- External Satellite API: Satellite position and telemetry data
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is developed for Smart India Hackathon (SIH) presentation.
Made for Team Digi Shakti - Smart India Hackathon (SIH)
- Lily Singhal
- Akshat Sharma
- Garima Avasthi
- Lakshya Sharma
- Dhruv Saini
- Mayank Saini
This project represents a complete full-stack solution for space weather monitoring and CME detection, developed from concept to deployment for the Smart India Hackathon 2025.
- NOAA Space Weather Prediction Center for real-time data
- NASA for historical space weather datasets
- Aditya L1 mission for solar observation data
Note: This system is designed for educational and research purposes. For operational space weather forecasting, please refer to official space weather agencies.