A Python tool that downloads, extracts, and interpolates wind data from NOAA's HRRR, RAP, and GFS weather models to provide wind speed and direction profiles at various altitudes for a specified location.
For operations requiring atmospheric wind data, it may be advantageous to source forecasts directly from official U.S. government models such as HRRR, RAP, or GFS provided by NOAA, rather than relying on third-party public websites. While both methods involve retrieving data over the internet, using government-hosted sources may offer greater reliability and reduce exposure to unvetted external platforms. Additionally, once the data is downloaded, it can be processed locally without further internet access, enabling offline use in communications-restricted environments. This approach may enhance operational resilience and data integrity in tactical or field applications.
Local Location Processing: Unlike web-based wind profilers that send your specific coordinates to external servers, this tool downloads complete global weather data and processes your location information entirely on your local device. This approach provides several security advantages:
- No Location Tracking: Your exact coordinates are never transmitted to external servers
- No Query Logs: External services cannot log your location requests or usage patterns
- Offline Capability: Once downloaded, wind profiles can be generated without internet access
- Operational Security: Ideal for tactical operations where location privacy is critical
How It Works:
- Global Download: Downloads complete weather data for the entire Earth (GFS) or continental region (HRRR/RAP)
- Local Processing: Your device extracts and interpolates wind data for your specific location
- No External Queries: No need to send coordinates to third-party services
- Cached Data: Downloaded files can be reused for multiple locations without additional downloads
Security Benefits:
- Location Privacy: Your coordinates never leave your device
- Usage Anonymity: No external service can track your wind profiling activities
- Reduced Digital Footprint: Minimizes exposure to potential surveillance or tracking
- Tactical Advantage: Enables wind analysis in communications-restricted environments
This approach is particularly valuable for aviation, military operations, research, and any application where location privacy and operational security are priorities.
- Multiple Weather Models: Support for HRRR (High-Resolution Rapid Refresh), RAP (Rapid Refresh), and GFS (Global Forecast System)
- Interactive Location Input: Enter coordinates or use predefined city locations
- Altitude Reference Options: Choose between MSL (Mean Sea Level) and AGL (Above Ground Level)
- Manual Ground Elevation Input: User must enter ground elevation in feet MSL when using AGL
- File Caching: Avoids re-downloading the same forecast files
- Multiple Output Formats: CSV and human-readable text files
- Progress Reporting: Real-time download progress and status updates
- Robust Error Handling: Graceful handling of network issues and missing data
Model | File Size | Coverage | Resolution | Max Altitude |
---|---|---|---|---|
HRRR | ~134 MB | CONUS | 3km | ~34,000 ft |
RAP | ~134 MB | CONUS | 13km | ~39,000 ft |
GFS | ~520 MB | Global | 25km | ~50,000+ ft |
- Local Processing: All data processing happens locally on your machine
- No Location Tracking: Your coordinates are never sent to external services
- Offline Capable: Once downloaded, forecast files can be used offline
- Privacy Preserved: No personal data or location information is transmitted
- Operational Security: Ideal for tactical, aviation, or field use where privacy is critical.
- Clone or download this repository
- Install Python dependencies:
pip install -r requirements.txt
Run the script:
python wind_profiler.py
Follow the interactive prompts:
- Enter latitude and longitude (or use predefined cities)
- Choose maximum elevation (1,000 to 50,000 feet)
- Select altitude reference (MSL or AGL)
- If AGL, enter ground elevation in feet MSL manually
- Choose weather model (HRRR, RAP, GFS, or Auto)
- Select forecast hour
- Choose to use cached file or download fresh data
- Heights are measured above sea level
- Consistent reference point worldwide
- Useful for aviation and standard atmospheric calculations
- Heights are measured above local terrain
- User must enter ground elevation in feet MSL manually
- More intuitive for ground-based applications
The tool generates two output files:
Altitude_ft_AGL,Wind_Speed_kts,Wind_Direction_deg
0,1.67,304.51
1000,4.34,300.67
2000,7.00,296.83
...
HRRR Wind Profile for 40.7128°N, -74.0060°E
Forecast: Current conditions (0-hour analysis)
Altitude Reference: AGL (Above Ground Level)
Ground Elevation: 3 feet MSL
============================================================
Altitude_ft_AGL Wind_Speed_kts Wind_Direction_deg
0 1.669212 304.514958
1000 4.336202 300.671300
2000 7.003191 296.827641
...
- Coverage: Continental United States
- Resolution: 3km
- Update Frequency: Hourly
- Forecast Range: 0-18 hours
- Best For: High-resolution local forecasts, severe weather
- Coverage: Continental United States
- Resolution: 13km
- Update Frequency: Hourly
- Forecast Range: 0-21 hours
- Best For: Regional forecasts, aviation
- Coverage: Global
- Resolution: 25km
- Update Frequency: Every 6 hours
- Forecast Range: 0-384 hours
- Best For: Global coverage, long-range forecasts
- Automatically selects the most current available model
- Prioritizes HRRR for CONUS locations
- Falls back to GFS for international locations
The tool includes comprehensive error handling for:
- Network Issues: Connection timeouts and download failures
- Missing Data: Unavailable forecast hours or models
- File Corruption: Invalid or incomplete downloads
- Invalid Input: Out-of-range coordinates or parameters
For automated or batch processing, you can modify the script to accept command line arguments:
# Example: Add to the top of wind_profiler.py
import sys
if len(sys.argv) >= 4:
lat = float(sys.argv[1])
lon = float(sys.argv[2])
max_elevation = int(sys.argv[3])
forecast_hour = int(sys.argv[4]) if len(sys.argv) > 4 else 0
# Use these values instead of prompting
Create a script to process multiple locations:
locations = [
(32.22, -110.94, 20000), # Tucson
(52.52, 13.41, 15000), # Berlin
(21.31, -157.86, 25000), # Honolulu
]
for lat, lon, max_elev in locations:
# Process each location
print(f"Processing {lat}, {lon}")
# ... wind calculation code
The interpolated data can be used for:
- Wind Shear Analysis: Calculate wind shear between altitude levels
- Trend Analysis: Compare multiple forecast hours
- Statistical Analysis: Process multiple locations or time periods
- Visualization: Create wind profile plots using matplotlib
-
"No GFS forecast files are currently available" error:
- GFS data may be temporarily unavailable
- Try using Auto mode to select an available model
- Try a different forecast hour
- Wait a few hours and try again
-
"Failed to download" error:
- Check internet connection
- NOAA servers may be temporarily unavailable
- Try running again in a few minutes
-
"Error loading data" error:
- Ensure eccodes is properly installed
- Try deleting cached .grib2 files and re-downloading
- Check Python environment has all required packages
-
Import errors:
- Verify all dependencies are installed:
pip list | grep -E "(cfgrib|xarray|pandas|numpy|scipy)"
- Consider using a virtual environment
- Verify all dependencies are installed:
-
Environment issues:
- Ensure you're in the correct virtual environment:
which python
- Reinstall dependencies if needed:
pip install --upgrade -r requirements.txt
- Ensure you're in the correct virtual environment:
- Caching: Downloaded files are cached locally for faster subsequent runs
- Location: Script works best for locations over land (ocean data may be limited)
- Timing: Model data is typically available 1-4 hours after each run time
- Auto Mode: Use Auto mode for best model selection and availability
The repository includes example output files from various locations and models:
wind_profile_40.71_-74.01_hrrr_0h.txt
— Wind profile for New York, NY (1-hour HRRR forecast)wind_profile_52.52_13.40_gfs_3h.txt
— Wind profile for Berlin, Germany (3-hour GFS forecast)wind_profile_35.69_139.69_gfs_3h.txt
— Wind profile for Tokyo, Japan (3-hour GFS forecast)
These files show the format and content you can expect when saving results as text files.
- NOAA NOMADS: https://nomads.ncep.noaa.gov/
- HRRR Model: High-Resolution Rapid Refresh documentation
- RAP Model: Rapid Refresh documentation
- GFS Model: Global Forecast System documentation
- GRIB2 Format: WMO standard for meteorological data
- Python 3.7+
- Internet connection for initial data download
- ~1GB free disk space for cached files
numpy
: Numerical computationsxarray
: NetCDF data handlingcfgrib
: GRIB2 file readingrequests
: HTTP downloadstqdm
: Progress bars
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
This tool is for educational and research purposes. Always verify weather data from official sources for critical applications. The authors are not responsible for any decisions made based on this data.