Project

General

Profile

Calculate ydaymean, shift days in leap years

Added by Stijn Decubber about 7 years ago

I have a netcdf data file with observations every 9 days, such that there are 46 unique observations in every year.

When using ydaymean to obtain the multi-year averages, 84 and not 46 values are returned. Although the actual observed days are the same in every year, the multi-year mean is returned on a different index in leap years. For instance, March 25 is the 84th day in normal years, but the 85th day in leap years. Is there any way to 'shift back' the observations in leap years so that I can calculate a 'unique' multi-year average for every observed day?

Also, the shifting only occurs after February. January 16 is the 16th day of the year, whether it is a leap year or not.

Thanks!


Replies (1)

RE: Calculate ydaymean, shift days in leap years - Added by Gereon Gollan about 7 years ago

Stijn Decubber wrote:

I have a netcdf data file with observations every 9 days, such that there are 46 unique observations in every year.

When using ydaymean to obtain the multi-year averages, 84 and not 46 values are returned. Although the actual observed days are the same in every year, the multi-year mean is returned on a different index in leap years. For instance, March 25 is the 84th day in normal years, but the 85th day in leap years. Is there any way to 'shift back' the observations in leap years so that I can calculate a 'unique' multi-year average for every observed day?

Also, the shifting only occurs after February. January 16 is the 16th day of the year, whether it is a leap year or not.

Thanks!

Hi Stijn!

do you know about the "del29feb" Operator? Maybe you can apply this one to your observations and afterwards do the ydaymean!

Regards, Gereon

    (1-1/1)