Calculates the average

var [ grid ... ] minfrac /keepgrids average

var variable variable to be averaged
grid grid set grid(s) over which the average is to be calculated
minfrac number Minimum fraction of data that must be present (i.e., fraction not indicated as missing) within the selected domain in order for the average to be calculated. If minfrac is not present, then a missing value is returned. If minfrac is not given, then the average is calculated regardless of the amount of data present in domain. (optional)
keepgrids name keeps independent variables averaged over in output as single values grids (optional)
avgvar/num variable or constant var averaged over grid.

avgvar is no longer dependent on grid, but is still dependent on any other grids that var depended on (if any)


average calculates a simple average, over the grid(s) included in the brackets, of the values in the latest variable on the stack. The optional minfrac argument is a number between 0. and 1.0 that indicates what fraction of data must be non-missing over the averaging grid in order for a non-missing result to be produced. If minfrac is not specified, its default value is 0., and an average is produced using all available data over the averaging grid.


X (170W) (120W) RANGE
Y (5S) (5N) RANGE
[X Y]average

This example averages over both longitude (X) and latitude (Y) to produce an average sea surface temperature value (for each time step) over the equatorial Pacific Ocean.

Live Example Link


SOURCES .NOAA .NCDC .GHCN .v2beta .prcp
IWMO 60354001 VALUE
T (Jan 1960) (Dec 1979) RANGE
[T]0.5 average

This example produces the average monthly precipitation value for Algiers, Algeria, over the period January 1960 to December 1979, if at least half the monthly precipitation values over that time period are not missing.

Live Example Link

See also

Average: boxAverage dekadalAverage monthlyAverage monthlyMAVE monthlyMAVE_SD monthlymean pentadAverage pentadMAVE pentadmean runningAverage seasonalAverage weighted-average yearlyAverage