Skip to content

Use Open-Meteo for wind data in Vandy and Cape weather endpoints#1

Draft
hwpaige with Copilot wants to merge 2 commits into
mainfrom
copilot/update-wind-data-source
Draft

Use Open-Meteo for wind data in Vandy and Cape weather endpoints#1
hwpaige with Copilot wants to merge 2 commits into
mainfrom
copilot/update-wind-data-source

Conversation

Copilot AI commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Weather endpoints for Vandy and Cape were returning inaccurate wind data from NWS/METAR sources. Updated implementation to use Open-Meteo API for wind data specifically, matching the data source already used for long-term wind forecasting.

Changes

  • Added fetch_open_meteo_wind(): Fetches current wind conditions from Open-Meteo's /v1/forecast endpoint with current parameter

    • Returns wind speed, gusts, and direction with km/h → knots conversion
    • Tagged with source: 'Open-Meteo Real-time' for UI differentiation
  • Modified fetch_weather(): Routes wind data source based on location

    • Vandy and Cape: Open-Meteo wind data overrides METAR wind fields
    • Starbase and Hawthorne: Continue using NWS API (unchanged)
    • All locations: Temperature, humidity, visibility, and other compounds still sourced from METAR

Implementation

# For Vandy/Cape locations
use_open_meteo_wind = location in ['Vandy', 'Cape']

if use_open_meteo_wind:
    live_wind = fetch_open_meteo_wind(location)
    # Override METAR wind fields with Open-Meteo data
    parsed['wind_speed_kts'] = int(live_wind['speed_kts'])
    parsed['wind_direction'] = live_wind['direction']
    parsed['live_wind'] = live_wind

Response format remains backward compatible. The live_wind.source field indicates data provenance.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.open-meteo.com
    • Triggering command: `/usr/bin/python3 python3 -c
      import sys
      sys.path.insert(0, '.')

Import necessary functions

import requests
import json

Define increment_metric function since it's needed

_local_metrics = {'api_calls': 0}
def increment_metric(metric):
_local_metrics[metric] = _local_metrics` (dns block)

  • aviationweather.gov
    • Triggering command: `/usr/bin/python3 python3 -c
      import sys
      sys.path.insert(0, '.')

Import necessary functions

import requests
import json

Define increment_metric function since it's needed

_local_metrics = {'api_calls': 0}
def increment_metric(metric):
_local_metrics[metric] = _local_metrics` (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

The current weather endpoints for "Vandy" and "Cape Wind" are not accurate. Update the implementation to use a different data source for wind data specifically, while keeping the current source for other weather compounds unchanged. Use the same data source we currently use for long-term wind forecasting. Ensure proper integration and testing for both "Vandy" and "Cape Wind" endpoints.

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: hwpaige <3143963+hwpaige@users.noreply.github.com>
Copilot AI changed the title [WIP] Update wind data source for Vandy and Cape Wind endpoints Use Open-Meteo for wind data in Vandy and Cape weather endpoints Feb 9, 2026
Copilot AI requested a review from hwpaige February 9, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants