Project

General

Profile

Diurnal cycle using a 16-year hourly TS for air pollution

Added by Julio Chiquetto about 10 years ago

Hello,
I am a brand new CDO user.

I'm working on a long time series with 140256 records, 16-year hourly time series of Nitrogen Dioxide data.
I would like to calculate diurnal average cicles, so that I'd have an average of the pollutant's behaviour over a 24-hour period (getting the average of the first hour of the first day with the first hour of the second day, etc....until the first hour of the 140256th day).

Firstly I tried using 'yhourmean' and I got a file with 8784 records, which made sense because that is the number of hours in a leap year. I assumed that was a time series of hourly means, each value being the mean of 16 values -the number of years - for that hour of that day.But when I checked, the values were not as expected. I calculated some of the hourly averages myself in order to check and when I compared, they were different from the ones I got using yhourmean...so I am not sure how CDO is doing it.

I also tried 'yhouravg' instead, but it produced a time series with excessive invalid data. I reckon there are quite a few invalid data in my TS (I have defined them using 'cdo setmissval', and it worked), but again that was very different from the result I should have got. I am not sure how CDO handles invalid data when averaging and if I should use avg or mean for my TS.

Originally, I was thinking to get this hourly average TS (with 8784 records), then using something like 'timselmean,24 if of' to make it calculate the average value for each hour. I suppose it would give me 24 average values, one for each hour of the day. Then I would merge these 24 files and create a single one, with the diurnal cycle. But now that yhourmean and yhouravg do not seem to be working as expected, I am not sure what to do.

I appreciate any help or suggestions,

Julio


Replies (1)

RE: Diurnal cycle using a 16-year hourly TS for air pollution - Added by Julio Chiquetto about 10 years ago

I have found this explanation about mean and average on the CDO manual:

1.7.1. Mean and average
An artificial distinction is made between the notions mean and average. The mean is regarded as a
statistical function, whereas the average is found simply by adding the sample members and dividing the
result by the sample size. For example, the mean of 1, 2, miss and 3 is (1 + 2 + 3)/3 = 2, whereas the
average is (1 + 2 + miss + 3)/4 = miss/4 = miss. If there are no missing values in the sample, the average
and mean are identical

so that explains why my data only works with mean! But I still have to find out why the means gives me different values than it was supposed to (and ideas for figuring out a practical way of calculating the diurnal cycle).

Julio

    (1-1/1)