Skip to content

Mobt991 ApplySAMOS plugin distribution fix#2311

Merged
gavinevans merged 9 commits intometoppv:masterfrom
brhooper:mobt991-samos_distribution_fix
Feb 20, 2026
Merged

Mobt991 ApplySAMOS plugin distribution fix#2311
gavinevans merged 9 commits intometoppv:masterfrom
brhooper:mobt991-samos_distribution_fix

Conversation

@brhooper
Copy link
Contributor

@brhooper brhooper commented Feb 19, 2026

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 DistributionalParameters plugin 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:

  • Ran tests and they passed OK
  • Added new tests for the new feature(s)

…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.
@brhooper brhooper changed the title Mobt991 samos distribution fix Mobt991 ApplySAMOS plugin distribution fix Feb 19, 2026
@bayliffe bayliffe self-assigned this Feb 19, 2026
Copy link
Contributor

@bayliffe bayliffe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bayliffe bayliffe assigned brhooper and unassigned bayliffe Feb 19, 2026
@brhooper brhooper assigned bayliffe and unassigned brhooper Feb 19, 2026
@brhooper
Copy link
Contributor Author

Thanks for your review @bayliffe. I've responded to each of your comments.

bayliffe
bayliffe previously approved these changes Feb 20, 2026
Copy link
Contributor

@bayliffe bayliffe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes @brhooper, I'm happy with this PR.

@bayliffe bayliffe removed their assignment Feb 20, 2026
@gavinevans gavinevans self-assigned this Feb 20, 2026
Copy link
Contributor

@gavinevans gavinevans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @brhooper 👍

This looks functionally fine. I've added some minor comments.

@gavinevans gavinevans assigned brhooper and unassigned gavinevans Feb 20, 2026
…ethod. Modify and extend tests for this method. Other minor changes following review.
@brhooper
Copy link
Contributor Author

Thanks for your review @gavinevans. I've responded to each of your comments.

@gavinevans gavinevans merged commit ada2f30 into metoppv:master Feb 20, 2026
6 of 7 checks passed
@gavinevans gavinevans removed their assignment 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants