Weather Data

From Federal Burro of Information
Revision as of 13:57, 20 July 2020 by David (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Canadian Data

https://drive.google.com/drive/folders/1WJCDEU34c60IfOnG4rv5EPZ4IhhW9vZH

export STATIONID="1706"
export DAY=14

for year in `seq 1998 2008`;
 do
 for month in `seq 1 12`;
 do
 wget --content-disposition "https://climate.weather.gc.ca/climate_data/bulk_data_e.html?format=csv&stationID=${STATIONID}&Year=${year}&Month=${month}&Day=${DAY}&timeframe=1&submit=Download+Data" ;
 done;
done

WHERE;

  • year = change values in command line (`seq 1998 2008)
  • month = change values in command line (`seq 1 12)
  • format= [csv|xml]: the format output
  • timeframe = 1: for hourly data
  • timeframe = 2: for daily data
  • timeframe = 3 for monthly data
  • Day: the value of the "day" variable is not used and can be an arbitrary value
  • For another station, change the value of the variable stationID
  • For the data in XML format, change the value of the variable format to xml in the URL.