4. Downloading Daily Weather Data

This document shows how to search, download, and format daily climate data from the Canadian Daily Climate Database (CDCD) [1] using the download weather data tool of GWHAT available under the tab Download Weather shown in Fig. 4.1.

alternate text

Fig. 4.1 Presentation of the download weather data tool of GWHAT available under the Download Weather tab.

4.1. Downloading weather data

Daily weather data can be downloaded automatically for one or more stations at a time simply by selecting them in the table shown in Fig. 4.2 and by clicking on the downward arrow icon in the toolbar.

Climate stations can be added to the table either by selecting an existing list of stations from a file by clicking on the open file icon or by using the Weather Stations Browser (see Fig. 4.4) that is accessible by clicking on the magnifying glass icon. Climate stations can be removed from the table by selecting them and clicking on the eraser icon. The list of stations can be exported to a csv file by clicking on the save icon, so that it can be directly loaded in successive sessions of GWHAT.

When clicking on the downward arrow icon, daily weather data are downloaded between the From Year and To Year values specified for each selected station and the results are saved as csv files in the Raw folder of the current project. The downloading process can be stopped at any time by clicking on the stop icon that appears in the toolbar as soon as a downloading task is started. Weather data for a given station will not be downloaded for the years for which a data file already exist in the Raw folder. Finally, the From Year and To Year values can be set individually for each station or for all stations at once using the set From Year and set To Year icons as shown in Fig. 4.3.

alternate text

Fig. 4.2 Tool to download and format daily weather data from the online CDCD (Canadian Daily Climate Database).

alternate text

Fig. 4.3 Set the From Year and To Year values for all stations at once.

4.2. Searching for weather data

The Weather Stations Browser shown in Fig. 4.4 provides a graphical interface to the CDCD, which contains daily data for air temperature and precipitation dating back to 1840 to the present for more than 8000 stations distributed across Canada. The list of stations can be filtered in the browser by proximity, provinces, or/and the number and the range of years for which data are available at each station. For example, Fig. 4.4 shows all stations with at least 10 years of available data between 1960 and 2018 that are located less than 25 kilometres away from the specified lat/lon coordinates.

The list of stations displayed in the table can be exported to an Excel or csv file by clicking on the button save Save. Stations can be added from the Weather Stations Browser to the table displayed in the Download Weather tab (see Fig. 4.2) by checking them in the table and clicking on the button Add Add.

The first time that the Weather Stations Browser is opened after installing GWHAT, a database of the available climate stations in the CDCD is downloaded from the ECCC (Environment and Climate Change Canada) server. The database is then saved in the installation directory of GWHAT (see Section 1.1). The local copy of the climate station database can be updated whenever by fetching it again from the ECCC server by clicking on the button fetch Fetch.

alternate text

Fig. 4.4 Presentation of the Weather Stations Browser.

4.3. Formatting the weather datafiles

After all data have been successfully downloaded for a given weather station, GWHAT automatically displays information about the number and the proportion of days with missing data in the the right-side panel of the Download Weather tab (see Fig. 4.5). It is possible to navigate through the information of all the datasets that were downloaded over the course of a given session by using the left-right arrows located at the bottom of the panel.

By default, GWHAT saves the formatted data automatically in a single csv (comma-separated values) file in the Input folder of the current project folder. Details about the format of the csv files in which the data are saved are provided in Section 3.2.1. It is possible to prevent GWHAT from automatically saving the formatted data by unchecking the Automatically save formatted weather data option located at the bottom of the formating tool. The formatted data can be manually saved afterwards by clicking on the button save Save.

Moreover, previously downloaded raw weather data files, which are saved automatically in the Raw folder, can be opened and formated at any times by clicking on the button open file Select at the top of the panel. The formatted data can then be saved manually by clicking on the button save Save or automatically if the Automatically save formatted weather data option is checked.

alternate text

Fig. 4.5 Presentation of the tool to format raw weather datafiles located in the right panel of the Download Weather tab.

Footnotes

[1]http://climate.weather.gc.ca/