in the core EAS notebooks the example for how to calculate the number of wet days (worksheet 5, section 5.1) is wrong.
the aggregator used is:
count_nonzero = Aggregator('count', None,
units_func=lambda units: 1,
lazy_func=da.count_nonzero)
this counts the number of days when the rainfall is not zero. The correct definition is precipitation >=1 mm/day
the correct approach is shown on the AFR-22 version:
https://github.com/MetOffice/PyPRECIS/blob/new/afr_22/notebooks/AFR-22/worksheet5.ipynb
# count wet days
model_wetdays = data.collapsed('time', iris.analysis.COUNT,
function=lambda values: values > 1)
in the core EAS notebooks the example for how to calculate the number of wet days (worksheet 5, section 5.1) is wrong.
the aggregator used is:
this counts the number of days when the rainfall is not zero. The correct definition is precipitation >=1 mm/day
the correct approach is shown on the AFR-22 version:
https://github.com/MetOffice/PyPRECIS/blob/new/afr_22/notebooks/AFR-22/worksheet5.ipynb