
dim_avg_wgt_Wrap
Computes the weighted average of a variable's rightmost dimension at all other dimensions and retains metadata.
Prototype
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" ; This library is automatically loaded ; from NCL V6.2.0 onward. ; No need for user to explicitly load. function dim_avg_wgt_Wrap ( x : numeric, w [*] : numeric, opt [1] : integer ) return_val : float or double
Arguments
xA variable of numeric type and any dimensionality. Missing values are indicated by the _FillValue attribute.
wA one dimensional of weights. The length must the same as the right dimension of x.
optA scalar: (a) opt=0 means compute the weighted average only if all values are not missing; (b) opt=1 means compute the weighted mean of all non-missing values; (c) opt>1 means to return the mean only if the number of non-missing values is greater-than or equal to opt.
Description
This function is identical to dim_avg_wgt, except the return value will have metadata added based on metadata attached to x. See the dim_avg_wgt page for full documentation and examples.