From 2cdab71485b6a457afe54c4e5fde7aaa2b21be01 Mon Sep 17 00:00:00 2001 From: Marcus Spelman Date: Mon, 10 Jul 2023 14:18:00 +0100 Subject: [PATCH 1/2] Clarifys docstring of generate-percentiles regarding mask_percentiles option --- improver/cli/generate_percentiles.py | 8 +++++++- .../ensemble_copula_coupling/ensemble_copula_coupling.py | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/improver/cli/generate_percentiles.py b/improver/cli/generate_percentiles.py index 2d5c872222..31da1ecfe9 100755 --- a/improver/cli/generate_percentiles.py +++ b/improver/cli/generate_percentiles.py @@ -78,7 +78,13 @@ def process( range, raises a warning rather than an exception. mask_percentiles (bool): A boolean determining whether the final percentiles should - be masked. This is only implemented to work when converting + be masked. If True, then where the percentile is higher than + the probability of the diagnostic existing the outputted + percentile will be masked. + The probability of being below the final threshold in + forecast_probabilities is used as the probability of the diagnostic + existing. + This is only implemented to work when converting probability cubes to percentiles. optimal_crps_percentiles (bool): If True, percentiles are computed following the diff --git a/improver/ensemble_copula_coupling/ensemble_copula_coupling.py b/improver/ensemble_copula_coupling/ensemble_copula_coupling.py index c8ca55a7b6..d7b69aa1bd 100644 --- a/improver/ensemble_copula_coupling/ensemble_copula_coupling.py +++ b/improver/ensemble_copula_coupling/ensemble_copula_coupling.py @@ -516,6 +516,9 @@ def __init__( The probability of being below the final threshold in forecast_probabilities is used as the probability of the diagnostic existing. + For example if at some grid square the probability of cloud base + being below 15000m (the highest threshold) is 0.7 then every percentile + above the 70th would be masked. """ self.ecc_bounds_warning = ecc_bounds_warning self.mask_percentiles = mask_percentiles From eb035f29da47c21d564f952ca052bf03f981c391 Mon Sep 17 00:00:00 2001 From: Marcus Spelman Date: Wed, 26 Jul 2023 08:40:21 +0100 Subject: [PATCH 2/2] Updates doc string following review --- improver/cli/generate_percentiles.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/improver/cli/generate_percentiles.py b/improver/cli/generate_percentiles.py index 31da1ecfe9..6432828bab 100755 --- a/improver/cli/generate_percentiles.py +++ b/improver/cli/generate_percentiles.py @@ -78,14 +78,19 @@ def process( range, raises a warning rather than an exception. mask_percentiles (bool): A boolean determining whether the final percentiles should - be masked. If True, then where the percentile is higher than + be masked. If True then where the percentile is higher than the probability of the diagnostic existing the outputted percentile will be masked. - The probability of being below the final threshold in - forecast_probabilities is used as the probability of the diagnostic - existing. - This is only implemented to work when converting - probability cubes to percentiles. + This masking acts to cap the maximum percentile + that can be generated for any grid point relative to the + probability of exceeding the highest threshold at that point. + For example, if the probability of a temperature exceeding 40C + is 5%, the 95th and above percentiles will all be masked. + Likewise, if at some grid point the probability of the cloud base + being below 15000m (the highest threshold) is 70% then every + percentile above the 70th would be masked. + This is only implemented to work when converting probabilities to + percentiles. optimal_crps_percentiles (bool): If True, percentiles are computed following the recommendation of Bröcker, 2012 for optimising the CRPS using