Menu ▾ ▴

#149 Bug in seasonal calculations (times.py)

Normal_bug
open
nobody
None
5
2012-12-10
2004-06-18
Anonymous
No

The functions in times.py module (e.g., cdutil.DJF etc.)
used for seasonal averaging and departures do not work
correctly. For a monthly dataset (beginning with
January), the functions pick wrong months (that are
forward shifted by one month) for computing avearges
and departures. For example, for the DJF season, the
months picked by cdutil.DJF are January, February, and
March for each year, instead of December, January, and
February. The problem appears to originate from
function 'monthBasedSlicer' in times.py, which supplies
forward shifted indices (by one month) for picking
months for seasonal calculations. As an example:
slices,bounds,norm = cdutil.times.monthBasedSlicer
(data.getTime(), "DJF")
where, 'data' is a monthly dataset with January as its
first month. The list 'slices' in this example has indices:
[[0, 1, 2], [12, 13, 14], ......], which obviously selects
January, February, and March for each year.

Fixing this bug would enable us to use the great utility
functions in times.py. Thanks.

--
Harun

Discussion


Log in to post a comment.