ECRearder 1.1 – New Climate Station Definition Window – No longer need to look up station IDs yourself

Please follow my blog to get the latest updates on ECReader as soon as they are available.

Quick Download Link: ECReader ver 1.1

The file name convention please refer to my other post: File Name Convention in ECReader1.1

In previous version of ECReader, to download climate data of a Environment Canada climate station, its station ID must be looked up first following the instruction. I must say: it’s NOT user-friendly.

To solve this, the basic information (including station ID) of all EC climate stations was downloaded and saved in a csv file. This makes it possible to lookup station ID in a user-friendly way.

ECReader interface is modified and a new “Define Stations” window is added to help choose stations from all 8551 stations, which is also used as tool to help browse and look for stations.

Specify Stations in Previous Version – Station ID is required

Specify Stations in New Version – Dedicated Station Definition Window to Utilize all EC Station Data and a link to download the all EC stations data

Quick Guide

  1. Click “Define Stations…” button to open “Define Stations” window.
  2. There are three tabs: By Name, Browse and From Map, where the last two will be implemented in the near future. The map function should be interesting.
  3. Three search criteria are supported: Station Name, Province and Data Availability.
  4. In case you know part of the station name, input in the station name part, e.g. george.
  5. In case you know the province of the stations, select one from the province list, e.g. ONT.
  6. In case you know the simulation period of SWAT model or the study period of data analysis, select hourly, daily or monthly from the data type list and select start and end year.
  7. Click “Search” button to retrieve stations.
  8. Stations will be given in the list below “Search” button. Two columns – name and province are displayed for each station.
  9. Select one station in the list, its data availability is shown at the bottom of the window. You could check the data availability of hourly, daily and monthly data.
  10. Double-click one station in the list to add this station to the selected list on the right. The selected list is the list of stations which will be used download data.
  11. You also could click “Use All 3 stations” below the list to add all the stations in the list into the selected list. The name of this button will change along with the search result.
  12. For right selected list, select one station to see the data availability one the bottom the same as the search result list. Double-click one station to remove one station from the selected list. Click “Remove All” button to remove all stations.
  13. Click “Use Selected Stations” button to return to main interface. The number of selected stations will be displayed under “Define Stations…” button.

Now the query stations are defined and it’s ready to download data the same as the previous version.


6 More Columns Added to Environment Canada Climate Stations (Shapefile) to Help Check Data Availability

Quick Download Links

CSV, Shapefile, KMZ, ZIP

Please note that this data was generated on Dec 31, 2013 and the last day of data is depend on the day when the data is retrieved from EC website. If one of the last day is 2013-12-30, it doesn’t mean there is no data after Dec 30, 2013. I will update the data once a while to make sure the dataset is up-to-date.


  1. Environment Canada climate data is available in hourly, daily and monthly. However, this is not true for every station. Some may just have daily and monthly data and don’t have hourly data.

  2. Some stations stopped working at some point and don’t have up-to-date data. For these stations, only a period of data is available.

For climate station selection, it’s useful to know which type of data is available from a station and the time period of available data. These information could be compared with simulation period of a model to help select right climate stations.


Fortunately,  these information could be retrieved from EC website. Following columns was added to the CSV and shapefile published in previous blog

  1. HOURLY_FIRST_DAY: First day of hourly data; will be null if there is no hourly data

  2. HOURLY_LAST_DAY: Last day of hourly data; will be null if there is no hourly data

  3. DAILY_FIRST_DAY: First day of daily data; will be null if there is no daily data

  4. DAILY_LAST_DAY: Last day of daily data; will be null if there is no daily data

  5. MONTHLY_FIRST_DAY: First day of monthly data; will be null if there is no monthly data

  6. MONTHLY_LAST_DAY: Last day of monthly data; will be null if there is no monthly data

Please note that the name of these columns in shapefile is shortened due to the limitation of shapefile on column name.

How to Get Environment Canada Climate Station ID From Name

  1. Go to
  2. In Step 1, select “Daily”.
  3. In Step 2, choose a year in which there could be some daily data.
  4. In Step 3, input the station name

  1. Hit the “Search” Button.
  2. If more than one station is given, select the station you want to use.
  3. Then you will be navigated to the daily data report page.

The address of this page would be in following format:|2013-12-11&Year=2013&Month=12&Day=11

A key named StationID will be found in this address. The value for this key is the station ID we need. In this case, the station ID is 29886.

Environment Canada Climate Data Reader

Please follow my blog to get the latest updates on ECReader as soon as they are available.

Please download the program package here and the quick guide is here. The .NET source codes is host in Google Codes.

Questions, bugs, more formats and functions, please send me email. I couldn’t be more happy to hear from you:)


Jan 10, 2014 Save and Load Defined Stations in ECReader1.1

Jan 6, 2014 File Name Convention in ECReader1.1

Jan 2, 2014  Version 1.1, Modify how to define query stations

Dec 28, 2013  New function to retrieve all EC climate stations and save as CSV file, based on which shapefile and kmz file could be also generated to help select climate stations in modelling.

Dec 20, 2013  Fix the uncompleted data bug.

What We Have

In Canada, Environment Canada is the major source of the climate data (precipitation and temperature). The climate data could be downloaded from Environment Canada website ( for each year in CSV format which contains 27 columns data. To be used in ArcSWAT or SWAT, these files must be processed in following way:

  1. Extract min and max temperature and total precipitation from each file;
  2. Combine the data of different years from the same station into one dbf or txt file in a format required by ArcSWAT.

Let’s take a look. If 5 climate stations are located in/around the study watershed and the simulation period is 20 years, total 5*20 = 100 CSV files need to be downloaded first and then be processed into 5 dbf/txt files. It may take one or two days to finish this work. No modeler wants this.

Besides time consuming, this process is also error-prone. Large amount of files will be process in a same way. The brain and eye is easy to become tired. Wrong file may be processed or the same file may be processed twice. And the most important is that it’s difficult to find these errors. Modeler usually never check the climate data again after they are there, which leave it impossible to figure out climate data related problems in the model.

What We Could Have

Since the climate data preparation process involves many repeated work, a program is the natural solution. Select stations, click a button and then go to get a coffee. All the files are ready when you get back. Ideally? Yes, that’s the “Environment Canada Climate Data Reader” is trying to do.

Environment Canada Climate Data Reader, or just call it reader, is a .NET windows program designed to download climate data from Environment Canada and generate result files in a specific format (of course, it supports ArcSWAT dbf and txt format). With it, you could enjoy your coffee when doing workJ

Quick Guide

   1. Give Stations – Which stations will be used?

Station ID is the unique ID used by Environment Canada to identify each climate station. Before using reader, these IDs must be retrieved based on station name. If you don’t how to get the station id, just hit and a short tutorial will show you how to do that.

Already got station IDs? Let’s give the ID(s) to the reader first.

  • Only got one station? Good, just select option and input the station id in the box. Want to know the information of this station? Hit to check basic information of this station (to make sure correction station is used).

  • Got more than on stations? That’s normal. First prepare a csv file in Excel or any test editor, in which the first column is the station name and the second column is station id. It may look like this:



CSV file is ready? Select option and hit to load the file.

   2. Give Time Range – What’s your simulation period?

The simulation period may or may not be decided yet. No problem, just make it longer. ArcSWAT and SWAT would read the right data based on date.

   3. Select an Output Folder – Where do you want to save the result files?

The default output folder is the my document folder. Hit if you don’t like this. will open the given folder, which will allow you check the result files.

   4. Select an Output Format and Data Fields – What format do you prefer and Which data do you like?

Want to just use climate data in ArcSWAT? No problem, just select or and you are good to go (only min and max temperature and total precipitation will be exported).

Want some free air and do some analysis on the data? No problem, select or and select any climate data you want in the list.

Want the final SWAT format? Yes, for people who don’t use ArcSWAT, just select (only min and max temperature and total precipitation will be exported).

   5. Start Download and Drink Coffee

Ready? Hit to start the work. Progress message will be given on the bottom.

When you see , it’s done.

   6. Check Result Files

Curious about the results? Hit to open the output folder and open the result files. You may want to know the name convention for different format.

  1. P[Station ID].dbf for precipitation and T[Station ID].dbf for temperature, e.g. P29886.dbf and T29886.dbf.
  2. P[Station ID].txt for precipitation and T[Station ID].txt for temperature, e.g. P29886.txt and T29886.txt.
  3. [Station ID].txt, e.g. 29886.txt.
  4. [Station ID].csv, e.g. 29886.csv.
  5. pcp1.pcp for precipitation and tmp1.tmp for temperature.