Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wx update for multiple locations #447

Open
tevpg opened this issue Jun 25, 2024 · 0 comments
Open

Wx update for multiple locations #447

tevpg opened this issue Jun 25, 2024 · 0 comments

Comments

@tevpg
Copy link
Collaborator

tevpg commented Jun 25, 2024

Perform Wx updates using a statiod id for various Canadian locations

General approach:

  • ORG table would inlcude a WX_STATION column
  • (ORG table is managed by hand)
  • WX_STATION comes from https://collaboration.cmc.ec.gc.ca/cmc/climate/Get_More_Data_Plus_de_donnees/Station%20Inventory%20EN.csv:
    • "Station ID" column is the station id
    • CHeck the DLY Start Year and DLY End Year in selecting a station ... want one that extends to the current year
    • That value goes into the WX_STATION column
  • general URL to fetch data is wget --content-disposition "https://climate.weather.gc.ca/climate_data/bulk_data_e.html?format=csv&stationID=1706&Year={year}&Month={month}&Day=14&timeframe=2&submit= Download+Data"

Automation script

  • parameters
    • ORG_HANDLE (or org_id? or wildcard to do them all?)
    • YEAR (or maybe YEAR and MONTH?)
  • assumes WX_STATION is already populated
  • fetch WX_STATION
  • fetch CSV for station/year from nrcan
  • parse; update database rows for anything that matches
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

No branches or pull requests

1 participant