[Thread Prev][Thread Next][Index]

Re: [ferret_users] Differences in mean computation CDO/Ferret?



OK the problem has been solved.

I indeed did another test saving all the days (even if masked), thus there is no gap in the calendar. In that case the results are similar between Ferret and CDO. So it must come from the weighting during Ferret averaging process.

Nicolas





2016-05-23 18:17 GMT+01:00 Ansley C. Manke <ansley.b.manke@xxxxxxxx>:

Hi Nicolas,

Does the masked data that you've saved have missing-data, or are those days skipped and not written out? It sounds like the latter. Ferret does the average as a weighted average, using the size of the grid cells as the weights. It does not have a concept of a non-continuous axis, so any missing days are treated as having larger grid cells, not as having discrete 1-day grid cells.  That would certainly make a difference in results.

Here's a quick example:


! Note the larger grid boxes where data is missing. The corresponding
! data will get larger weights in an average.

yes? define axis/t t_irreg = {1,2,5,6,7}

yes? sh axis/t t_irreg
 name       axis              # pts   start                end
 T_IRREG   T                    5 i   1                    7
   Axis span (to cell edges) = 7
 
       L     T                   TBOX      TBOXLO
       1>  1                     1          0.5
       2>  2                     2          1.5
       3>  5                     2          3.5
       4>  6                     1          5.5
       5>  7                     1          6.5
yes? let var = t[gt=t_irreg]
yes? list var[t=@ave]
             VARIABLE : T[GT=T_IRREG]
             T        : 0.5 to 7.5 (averaged)
          4.000

! Compare with an average from a regular axis having missing-data values.
! here each valid data point gets the same weight.

yes? define axis/t=1:7:1 t_reg
yes? sh axis/t t_reg
 name       axis              # pts   start                end
 T_REG     T                    7 r   1                    7
   Axis span (to cell edges) = 7
 
       L     T                   TBOX      TBOXLO
       1>  1                     1          0.5
       2>  2                     1          1.5
       3>  3                     1          2.5
       4>  4                     1          3.5
       5>  5                     1          4.5
       6>  6                     1          5.5
       7>  7                     1          6.5
yes? let vargaps = reshape({1,2,,,5,6,7}, t[gt=t_reg])
yes? list vargaps[t=@ave]
             VARIABLE : RESHAPE({1,2,,,5,6,7}, T[GT=T_REG])
             T        : 0.5 to 7.5 (averaged)
          4.200

On 5/23/2016 3:13 AM, Nicolas Freychet wrote:
Dear Ferret users,

I computed composites of the geopotential by selecting specific days only (using Ferret condition IF (....) then .... ), and created a file with only these days (thus it's continuous serie but the calendar is not continous are there are gaps in the days)

I then computed the time-mean from the composites with CDO (cdo -timmean .....) and Ferret ( L=@ave ) and I can notice strong differences between the 2 results (attached, left is CDO and right is Ferret). It's not just the magnitude, also the patterns differ (though the main signal is quite close), which is really strange.

I dont know if it's a Ferret or CDO problem, or if it comes from the gaps in the calendar of the composites... But even so, the patterns should at least look similar.

Best,
Nicolas








--
----------------------------------------------------
Nicolas Freychet
PDRA, School of Geosciences
University of Edinburgh
----------------------------------------------------




--
----------------------------------------------------
Nicolas Freychet
PDRA, School of Geosciences
University of Edinburgh
----------------------------------------------------
Hi Ansley,

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

Privacy Policy | Disclaimer | Accessibility Statement