This project displays meteorological data for India on an interactive map, with the ability to fetch and visualize real forecast data from NOAA's Global Forecast System (GFS).
- Interactive map of meteorological data for India
- Integration with NOAA's Global Forecast System (GFS) data
- Advanced data visualization with interactive charts
- Filter data by various meteorological parameters
- Search for locations and weather stations
- Toggle between simulated and real GFS forecast data
- Responsive design that works on all devices
The application now includes:
- Interactive Charts: Bar and line charts for visualizing meteorological data
- Comparison Mode: Compare data across different cities or parameters
- City Selection: Click on map markers to view detailed charts for that city
- Visual Customization: Switch between chart types and view options
- Real-time Data: When connected to GFS data, charts show the latest forecast information
- Install dependencies:
cd meteorology-map
npm install
2. Start the development server:
npm start
### Backend Setup (for GFS Data Processing)
The backend server is responsible for downloading and processing GFS GRIB2 files from NOAA.
1. Install dependencies:
cd meteorology-map/server npm install
2. Start the server:
npm start
**Note:** To fully process GFS GRIB2 files, you need to install wgrib2 on your server. If wgrib2 is not available, the server will fall back to simulated data.
### Installing wgrib2 (Optional)
#### Ubuntu/Debian:
sudo apt-get update sudo apt-get install wgrib2
#### Windows:
Download from https://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/ and add to your PATH.
#### macOS:
brew install wgrib2
## Understanding GFS Data
The Global Forecast System (GFS) is a weather forecast model produced by the National Centers for Environmental Prediction (NCEP). The data is provided in GRIB2 format, which is a standard for storing and transmitting meteorological grid data.
### GFS Data Structure
- **Resolution**: We're using the 0.5° grid (approximately 50km resolution)
- **Update Frequency**: GFS data is updated four times daily at 00, 06, 12, and 18 UTC
- **Forecast Range**: We're using the analysis (0-hour forecast) for current conditions
### Parameters Used
This application extracts the following parameters from GFS data:
- **Temperature**: 2m above ground (TMP:2 m above ground)
- **Pressure**: Surface pressure (PRES:surface)
- **Humidity**: Relative humidity at 2m (RH:2 m above ground)
- **Soil Moisture**: 0-10cm below ground (SOILW:0-0.1 m below ground)
- **Surface Temperature**: Ground/skin temperature (TMP:surface)
## Improved Data Fetching
The application now tries multiple sources to get the most recent GFS data:
1. AWS S3 NOAA GFS public dataset
2. NOMADS (NOAA Operational Model Archive and Distribution System)
3. NCEI (National Centers for Environmental Information)
If one source is unavailable, it automatically tries another. It also handles date rollbacks to find the most recent available forecast.
## Data Flow
1. The server attempts to download the latest GFS GRIB2 file from multiple sources
2. It processes the file using wgrib2 to extract data for major Indian cities
3. The processed data is exposed via a REST API endpoint
4. The frontend fetches this data and displays it on the map and charts
If the server is unavailable or wgrib2 is not installed, the application falls back to client-side simulated data with realistic seasonal variations.
## API Endpoints
The server provides the following API endpoints:
- **GET /api/gfs-india**: Retrieves GFS data for Indian cities
- **GET /api/status**: Provides information about the server status and wgrib2 availability
- **POST /api/clear-cache**: Clears the cached GRIB2 files
## Resources
- [NOAA GFS Data Access](https://www.ncei.noaa.gov/data/global-forecast-system/access/)
- [GFS Documentation](https://www.emc.ncep.noaa.gov/emc/pages/numerical_forecast_systems/gfs.php)
- [wgrib2 Documentation](https://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/)