Mobt991 ApplySAMOS plugin distribution fix#2311
Merged
gavinevans merged 9 commits intometoppv:masterfrom Feb 20, 2026
Merged
Conversation
…r are given to the process method rather than the __init__. Modify existing unit tests to handle this change.
…o handle changes to ConvertLocationScaleParameters* plugins.
…use the distribution of the GAMs rather than the distribution associated with the EMOS coefficiencients.
…rameters plugin behaviour with distribution = gamma so that a location parameter which is zero everywhere is returned.
bayliffe
reviewed
Feb 19, 2026
Contributor
bayliffe
left a comment
There was a problem hiding this comment.
This wasn't entirely trivial, so well done. A few comments on code, but I think it all looks okay from a functionality stand point.
improver_tests/calibration/samos_calibration/test_ApplySAMOS.py
Outdated
Show resolved
Hide resolved
improver_tests/ensemble_copula_coupling/test_ConvertLocationAndScaleParameters.py
Outdated
Show resolved
Hide resolved
Contributor
Author
|
Thanks for your review @bayliffe. I've responded to each of your comments. |
gavinevans
requested changes
Feb 20, 2026
Contributor
gavinevans
left a comment
There was a problem hiding this comment.
Thanks @brhooper 👍
This looks functionally fine. I've added some minor comments.
…ethod. Modify and extend tests for this method. Other minor changes following review.
Contributor
Author
|
Thanks for your review @gavinevans. I've responded to each of your comments. |
gavinevans
approved these changes
Feb 20, 2026
gavinevans
added a commit
to gavinevans/improver
that referenced
this pull request
Mar 5, 2026
…sformation * upstream/master: EPPT3121 Add clip option to fine fuel moisture content calculation (metoppv#2317) Edit CLI docstring. (metoppv#2318) Update WeightAndBlend.process() to use *cubes and as_cubelist (metoppv#2314) Lighting in vicinity cell_method alignment for master (metoppv#2296) Add quantile mapping and associated tests (metoppv#2264) MOBT-1069: Using adjacent validity times in SAMOS (metoppv#2310) Mobt991 ApplySAMOS plugin distribution fix (metoppv#2311) Add attribute to realization clustering to record source realizations (metoppv#2305) MOBT-1070: Time-zone safe handling of time point extraction in SAMOS calibration (metoppv#2306) Set START_DATE_DICT to outside largest lag period to silence warnings (metoppv#2304) Eppt2408 implement initialisation process for fire severity iterative parameters (metoppv#2302) FireWeatherIndexBase plugin - change Error to Warning for input values outside expected ranges (metoppv#2301)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses https://github.com/metoppv/mo-blue-team/issues/1051
This PR fixes a bug in the ApplySAMOS plugin which caused the EMOS coefficients distribution, rather than the distribution used in the GAMs, when converting the calibrated forecast into probabilities or percentiles.
In order to achieve this, the code used to convert location and scale parameters (defining a parametric distribution) has been modified to handle gamma distributions. Previously it could only handle normal and truncated normal distributions. The functionality added for this should be extendable to other distributions if required in the future.
The new
DistributionalParametersplugin is added so that the mean and standard deviation cubes produced when applying EMOS and SAMOS calibration can be converted to location, scale, and shape parameters for the desired distribution. This is necessary as, unlike for normal distributions, the parameters of a gamma distribution are not equal to the mean and standard deviation of that distribution.Testing: