nctoolkit.DataSet.zonal_sum

DataSet.zonal_sum(self, by_area=False)

Calculate the zonal sum for each year/month combination in files. This applies to each file in an ensemble.

Parameters

by_area (bool) – Set to True if you want the cell value to be multiplied by the cell area prior to summing

Examples

If you want to calculate the zonal sum for a dataset, do the following:

>>> ds.zonal_sum()