Skip to content

Wet days - using threshold of 0 not 1 -replace custom aggregator with count > 1 #140

Description

@nhsavage

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)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions