A more general routine for averaging
The method first reads the axes (x/y/z/t) needed for averaging, finds the indices corresponding these axes, then uses the geodat.stat.wgt_ave to sort the axis and do the weighted average
if the axis is a “Y” axis, weights are computed using the latitude axis in the variable.
if no axis is given, all axes will be averaged over.
var (Variable) axis (int/str/an iterable of int or str):
the dimension along which the average is computed
axis (str or a list of str or int) - axis to be averaged over weights (scalar or a numpy array)
if axis is a string, e.g. “xy”, the input argument weights will be overwritten