Skip to content

RealizationSelection plugin modification#2364

Open
gavinevans wants to merge 15 commits into
metoppv:masterfrom
gavinevans:mobt_783_realization_selection_error
Open

RealizationSelection plugin modification#2364
gavinevans wants to merge 15 commits into
metoppv:masterfrom
gavinevans:mobt_783_realization_selection_error

Conversation

@gavinevans
Copy link
Copy Markdown
Contributor

@gavinevans gavinevans commented Apr 21, 2026

Related to https://github.com/metoppv/mo-blue-team/issues/783

Description
This PR makes a number of updates to the RealizationSelection plugin following trying to use the plugin with more realistic data:

  • Building on changes made in Support resetting the forecast_reference_time when clustering #2359, the forecast_reference_time and forecast_period on the input is reset to be from a common forecast_reference_time.
  • Add an exception is no forecast cubes are provided as an input.
  • Alter how the realizations are selected from the model cubes, so that the index of the realization is used, rather than the realization number on the coordinate.
  • Add the "cluster_sources" attribute to the result cube, from the cluster_cube, as this attribute is expected by the ForecastTrajectoryGapFiller plugin.
  • Alter how the name of the primary model is identified. Now the cluster_sources attribute is used, rather than expecting a "mosg__model_configuration" to be present on the cluster_cube. This attribute wouldn't be expected to be present on the cluster_cube.
  • Alter how the nearest secondary input is identified. This was an issue, for example, if one secondary input finished at T+12, the T+12:15 forecast would get mapped to using the secondary input from T+12, even though that input is not available at T+12:15. Therefore, the nearest, larger forecast period is now identified e.g. T+13, and the mapping from this forecast period is used.

Testing:

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

@gavinevans gavinevans marked this pull request as draft April 21, 2026 14:42
…_realization_selection_error

* mobt_783_reset_cycletime_when_clustering:
  Modifications
  Modifications following review.
  Modifications following review comments.
  Add handling for cube without forecast_reference_time coordinate.
  Add cycletime argument to realization_cluster_and_match, so that different inputs can be reset to have a common forecast_reference_time.
…ion_selection_error

* upstream/master:
  Support resetting the forecast_reference_time when clustering (metoppv#2359)
  Added support for equality operator (metoppv#2362)
@gavinevans gavinevans changed the title Add exception to RealizationSelection plugin RealizationSelection plugin modification Apr 24, 2026
@gavinevans gavinevans marked this pull request as ready for review April 24, 2026 16:42
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.

1 participant