GMS Mission Control is a Python and Flask application for detecting microclimate instability, thermal anomalies, and sensor-network events in real time. It combines a Gradient-Momentum Score model with spatial-temporal analysis, NASA POWER climate data support, interactive dashboards, anomaly alerts, geospatial visualizations, and optimization tools for climate monitoring research.
microclimate anomaly-detection climate-tech climate-data sensor-network iot-sensors environmental-monitoring thermal-instability spatial-temporal-analysis machine-learning flask python data-visualization nasa-power-api dashboard optimization
The Gradient-Momentum Score (GMS) model detects microclimate instability by combining four signals from a distributed temperature and humidity sensor network:
- Spatial Gradient (Delta T) - temperature differences between neighboring nodes.
- Temporal Momentum (M) - rate of change in temperature gradients over time.
- Duration/Persistence (D) - how long instability persists at a location.
- Neighbor Influence Score (NIS) - anomaly propagation through the sensor network.
The composite GMS score classifies each sensor location into three stability states:
- Stable - normal microclimate conditions.
- Moderately Unstable - emerging temperature anomalies.
- Highly Unstable - critical instability events.
- 40-node sensor network for distributed temperature and humidity monitoring.
- Real-time anomaly detection with dynamic instability classification.
- Flask web dashboard with Mission Control views at
http://localhost:5000. - Interactive climate visualizations including maps, heatmaps, timelines, alerts, and analysis charts.
- NASA POWER API integration for real-world climate and weather data.
- Spatial-temporal GMS algorithm for thermal anomaly and instability detection.
- Hyperparameter optimizer for weights, thresholds, and duration-window tuning.
- Evaluation metrics including accuracy, precision, recall, F1-score, and false alarm rate.
- CLI and desktop GUI entry points for research workflows and local experimentation.
gms_project/
|-- app.py # Flask web interface
|-- main.py # CLI entry point
|-- gui_mission_control.py # Desktop GUI launcher
|-- requirements.txt # Python dependencies
|-- README.md
|-- PROJECT_STRUCTURE.md
|
|-- backend/ # Web backend: engine, routes, optimizer
|-- frontend/ # Templates, CSS, and JavaScript assets
|-- config/ # Application settings
|-- core/ # Core GMS algorithm
|-- data/ # Data loading and cached climate data
|-- evaluation/ # Metric calculations
|-- tests/ # Unit tests
|-- utils/ # Shared helpers
|-- visualization/ # Plotting utilities
- Python 3.8+
- pip
git clone https://github.com/Chanthus587/GMS.git
cd GMS
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txtpython app.pyOpen http://localhost:5000 in your browser.
The dashboard includes:
- Real-time sensor network visualization.
- Interactive event timeline.
- Temperature heatmaps and anomaly alerts.
- Configurable noise, baseline, and GMS weight parameters.
- Optimization controls for model tuning.
python main.pyUse the CLI to load simulated or NASA climate data, run GMS analysis, calculate metrics, and export results.
python gui_mission_control.pyEdit config/settings.py for the web app and 40-node Mission Control defaults. The config package also exposes legacy names used by the CLI and core pipeline.
# Network topology
n_nodes = 40
grid_size = 10.0
neighbor_radius = 2.8
# Algorithm weights; must sum to 1.0
w1 = 0.35 # Spatial Gradient
w2 = 0.25 # Temporal Momentum
w3 = 0.20 # Neighbor Influence
w4 = 0.20 # Duration/Persistence
# Thresholds
alpha = 0.30 # Stable to Moderately Unstable
beta = 0.60 # Moderately Unstable to Highly UnstableDeltaT_ij(t) = T_i(t) - T_j(t)
Computes mean temperature difference between a node and its neighbors to detect spatial anomalies.
M_ij(t) = DeltaT(t) - DeltaT(t-1)
Captures rapid changes in spatial gradients.
D_i(t) = fraction of time steps in a sliding window where |DeltaT| > theta
Distinguishes transient noise from sustained microclimate instability.
NIS_i(t) = weighted sum of anomalies in neighboring nodes
Models how anomaly signals propagate through the sensor network.
GMS_i(t) = w1*G2 + w2*M + w3*NIS + w4*D
The weighted score is normalized to the [0, 1] range and mapped to stability states.
| Package | Purpose |
|---|---|
numpy |
Numerical computation |
pandas |
Data manipulation |
scipy |
Scientific computing |
scikit-learn |
Machine learning utilities |
matplotlib |
Plotting and visualization |
networkx |
Sensor network analysis |
requests |
NASA POWER API calls |
flask |
Web dashboard and API |
python -m pytest- Synthetic temperature and humidity time series.
- Embedded thermal events for controlled testing.
- Configurable noise and instability patterns.
- Satellite-derived 2-meter air temperature (
T2M). - Relative humidity at 2 meters (
RH2M). - Daily climate measurements by latitude and longitude.
The optimizer tunes component weights, thresholds, and the duration window from the web UI or Flask API.
curl -X POST http://localhost:5000/api/optimize \
-H "Content-Type: application/json" \
-d "{\"iterations\": 50, \"seed\": 42, \"target_recall\": 0.70, \"target_fp_rate\": 0.05}"The optimizer evaluates accuracy, precision, recall, F1-score, and false alarm rate to reduce unnecessary alerts while preserving useful anomaly detection.
This project is useful for students, researchers, and developers working on:
- Climate monitoring and environmental sensing.
- IoT sensor networks.
- Thermal anomaly detection.
- Spatial-temporal machine learning.
- Real-time Flask dashboards.
- Data visualization for weather and climate systems.
Contributions are welcome. Good areas for improvement include additional anomaly detection models, real-time streaming integrations, map enhancements, performance tuning, and broader climate data support.
Add a license before using this project in production or publishing derivative work.
For questions or suggestions, open an issue on GitHub.
Version: 2.0 | Last Updated: April 2026