geodat.nc.wgt_sum

geodat.nc.wgt_sum(var, axis=None)[source]

A more general routine for sum The method first reads the axes (x/y/z/t) needed, finds the indices corresponding these axes, 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 summed over.

Parameters:
  • var (geodat.nc.Variable) –
  • axis (str/int/list of int, optional) – along which the array is summed

Examples

>>> # Area sum
>>> wgt_sum(var,'xy')
>>> # Sum along the first axis
>>> wgt_sum(var,0)
Fork me on GitHub