This project consists of a set of bash scripts that work together to monitor and analyze the accuracy of weather forecasts for Hanoi, Vietnam. The system fetches weather data, compares forecasts with actual temperatures, and generates statistical analysis of forecast accuracy.
- Fetches current weather data and forecasts for Hanoi using wttr.in API
- Records current temperature and next day's forecast
- Logs data in tab-separated format with timestamp (year, month, day)
- Output is stored in
rx_poc.log
- Compares yesterday's forecast with today's actual temperature
- Calculates forecast accuracy (difference between forecast and actual)
- Categorizes accuracy into ranges:
- Excellent: ±1°C
- Good: ±2°C
- Fair: ±3°C
- Poor: > ±3°C
- Logs results to
historical_fc_accuracy.tsv
in tab-separated format
- Analyzes the last 7 days of forecast accuracy data
- Calculates and reports:
- Minimum absolute error
- Maximum absolute error
- Uses
scratch.txt
as temporary storage for calculations
- Send recorded weather log to specific email.
- Use data from
rx_poc.log
.
- Initial data collection:
./rx_poc.sh
- Calculate forecast accuracy (run daily):
./fc_accuracy.sh
- Generate weekly statistics:
./weekly_stats.sh
- Send log to email:
./send_log.sh
rx_poc.log
: Raw weather data and forecastshistorical_fc_accuracy.tsv
: Detailed forecast accuracy recordsscratch.txt
: Temporary file for weekly statistics calculations
The system is configured for Asia/Ho_Chi_Minh timezone to ensure accurate timestamp recording.
curl
: Required for fetching weather databash
: Scripts are written for bash shell- Internet connection to access wttr.in API