Part of Bernhard Reiter's archive.

Canadian Daily Climate CD Python module

Free Python module hack to extract a lot data from the proprietory "Canadian Daily Climate CDs", which is published by the Canadian Meterological Center.

Format Description

Thanks to Gary Beaney at Climate.Services@ec.gc.ca for supplying the format description and the permission to publish it here.

Tested with

The program successfully extracted data from the following CDs, running Python on MS Windows. It should also work under Unix.
Label Edition
Canadian Daily Climate Data 
Temperature and Precipitation

CDCD  CDQC
Environment Canada
  • Eastern Canada 1996, copyright 1998
  • Western Canada 1996 (version1.1), copyright 1998
  • Eastern Canada 1997, copyright 1999
  • Western Canada 1997, copyright 1999

Python module and example program

Free software under the GPL. Warning: It is a hack, it works for me. You will have to adapt it for your purposes, but it is much better as to start from nothing. If you cannot program at all or never heard of python this is probably not for you.

Additional Implementation notes

The binary decoding is done by the standard struct python module. It would be more elegant to use the new Python xstruct module as Robin Boerdijk pointed out to me.

Python?

In case you wonder, Python is a programming languare very usable for scientific applications like this.

Application?

In my climatic change research with phenology together with Mark Schwartz, I developed this little program to extract data from selected number of weather stations. We formatted the output so it could be used as input in Mark's phenological response model implementation.

It also might serve as example on how to decode a binary format using python and its struct and array module.

We would be happy to hear from you.


archived: December 2003 - original page revision: Thu Nov 18 15:30:35 CST 1999
28th December 2003: Added note and v0.8 of canadian_data.py.
Part of Bernhard Reiter's archive.

[ Archived: Bernhard's UWM Homepage ]