Weather Data: Difference between revisions

From Federal Burro of Information
Jump to navigationJump to search
No edit summary
No edit summary
 
Line 6: Line 6:


<pre>
<pre>
export STATIONID="1706"
export DAY=14
for year in `seq 1998 2008`;
for year in `seq 1998 2008`;
  do
  do
  for month in `seq 1 12`;
  for month in `seq 1 12`;
  do
  do
  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=1&submit= Download+Data" ;
  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;
done
done

Latest revision as of 13:57, 20 July 2020


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.