[Thread Prev][Thread Next][Index]

[ferret_users] Edges and @AVG



Hello Ferret community,
                                        I have noticed a difference when I (1) average seasonal data by creating a climatological axis with 3 month-long cells then @AVG regridding, verses (2) when I separate each month into its own variable and then average them together using expressions. It appears that the latter method is doing what I expect, but I don't understand what is wrong with the regridding method?

Some details are as follows:

I had to create my own seasonal climatological axis as I wanted to divide the months into DJF, MAM, JJA, SON, with an emphasis on DJF in this example. 
Thus I did so by: 

LET indices = L[L=1:144]
LET month = IF MOD(indices*3-3,12) EQ 0 THEN 12 ELSE MOD(indices*3-3,12)
LET year = 1978 + INT((indices+2)/4)
DEFINE AXIS/UNITS=days/T0=1-jan-1900/EDGES Saxis = DAYS1900(year,month,1)

When I showed a subsample of the axis, everything looks exactly as I want it to.

image.png

Then I regridded my dataset onto the axis. 

USE dataset.nc ! contains variables T, U, V
LET pPre= 'U'[I=1:1440:6, J=1:720:6, K=1:1:1, L=1:432:1]
LET seasons = pPre[GT=Saxis@AVE]
LET p = seasons[L=1:144:4]

image.png

However, when I examine the resulting averages compared to manual averages, something is wrong. 

For example, I performed an alternative analysis, in which instead of creating a climatological axis, I created three separate variables representing December, January and February respectively, and then averaged the three (which is exactly what I thought happened is the first method above).

LET DJF1= 'U'[I=1:1440:2, J=1:720:2, K=1:1:1, L=12:430:12]
LET DJF2= 'U'[I=1:1440:2, J=1:720:2, K=1:1:1, L=13:432:12]
LET DJF3= 'U'[I=1:1440:2, J=1:720:2, K=1:1:1, L=14:432:12]
Let DJF = (DJF1 + DJF2 + DJF3)/3

However this produced different results from above.

image.png

My best independent analysis to data suggests that the second set of values is correct. I did this by looking at the same set of values shown above for each month (shown below) and  manually averaging with a calculator (exactly what I believe I did in ferret using method 2). 

image.png

image.png

image.png


image.png

Thank you for any light you can shed on this!

Alexander Audet

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement