Skip to content

Add attribute to record secondary forecast sources when clustering realizations#127

Merged
gavinevans merged 3 commits intomasterfrom
mobt_1074_record_secondary_sources
Mar 24, 2026
Merged

Add attribute to record secondary forecast sources when clustering realizations#127
gavinevans merged 3 commits intomasterfrom
mobt_1074_record_secondary_sources

Conversation

@gavinevans
Copy link
Copy Markdown
Contributor

@gavinevans gavinevans commented Mar 13, 2026

Related to metoppv/improver#2332

The only significant change introduced in this PR is an additional attribute "secondary_input_realizations_to_clusters", as can be seen in the print out below.

Processing  single_lead_time_kgo.nc
different attributes of /lwe_precipitation_rate - ['secondary_input_realizations_to_clusters']

lwe_precipitation_rate / (m s-1)                 (realization: 2; projection_y_coordinate: 200; projection_x_coordinate: 200)
    Dimension coordinates:
        realization                                          x                           -                             -
        projection_y_coordinate                              -                           x                             -
        projection_x_coordinate                              -                           -                             x
    Scalar coordinates:
        forecast_period                          21600 seconds
        forecast_reference_time                  2025-12-01 06:00:00
        time                                     2025-12-01 12:00:00
    Attributes:
        Conventions                              'CF-1.7'
        cluster_sources                          '{"0": {"uk_ens": [21600]}, "1": {"uk_ens": [21600]}}'
        history                                  '2025-12-01T07:53:52Z: StaGE Decoupler'
        institution                              'Met Office'
        primary_input_realizations_to_clusters   '{"0": [19], "1": [0, 18]}'
        secondary_input_realizations_to_clusters '{"uk_ens": {"0": [{"realization": 5, "forecast_periods": [21600]}], ...'
        source                                   'Met Office Unified Model'
        title                                    'MOGREPS-UK Model Forecast on UK 2 km Standard Grid'
lwe_precipitation_rate / (m s-1)               (realization: 2; projection_y_coordinate: 200; projection_x_coordinate: 200)
    Dimension coordinates:
        realization                                        x                           -                             -
        projection_y_coordinate                            -                           x                             -
        projection_x_coordinate                            -                           -                             x
    Scalar coordinates:
        forecast_period                        21600 seconds
        forecast_reference_time                2025-12-01 06:00:00
        time                                   2025-12-01 12:00:00
    Attributes:
        Conventions                            'CF-1.7'
        cluster_sources                        '{"0": {"uk_ens": [21600]}, "1": {"uk_ens": [21600]}}'
        history                                '2025-12-01T07:53:52Z: StaGE Decoupler'
        institution                            'Met Office'
        primary_input_realizations_to_clusters '{"0": [19], "1": [0, 18]}'
        source                                 'Met Office Unified Model'
        title                                  'MOGREPS-UK Model Forecast on UK 2 km Standard Grid'

Processing  multiple_lead_time_kgo.nc
different attributes of /lwe_precipitation_rate - ['secondary_input_realizations_to_clusters']
lwe_precipitation_rate / (m s-1)                 (realization: 2; time: 2; projection_y_coordinate: 200; projection_x_coordinate: 200)
    Dimension coordinates:
        realization                                          x        -                           -                             -
        time                                                 -        x                           -                             -
        projection_y_coordinate                              -        -                           x                             -
        projection_x_coordinate                              -        -                           -                             x
    Auxiliary coordinates:
        forecast_period                                      -        x                           -                             -
    Scalar coordinates:
        forecast_reference_time                  2025-12-01 06:00:00
    Attributes:
        Conventions                              'CF-1.7'
        cluster_sources                          '{"0": {"gl_ens": [43200], "uk_ens": [21600]}, "1": {"gl_ens": [43200], ...'
        institution                              'Met Office'
        primary_input_realizations_to_clusters   '{"0": [19], "1": [0, 18]}'
        secondary_input_realizations_to_clusters '{"uk_ens": {"0": [{"realization": 5, "forecast_periods": [21600]}], ...'
        source                                   'Met Office Unified Model'
lwe_precipitation_rate / (m s-1)               (realization: 2; time: 2; projection_y_coordinate: 200; projection_x_coordinate: 200)
    Dimension coordinates:
        realization                                        x        -                           -                             -
        time                                               -        x                           -                             -
        projection_y_coordinate                            -        -                           x                             -
        projection_x_coordinate                            -        -                           -                             x
    Auxiliary coordinates:
        forecast_period                                    -        x                           -                             -
    Scalar coordinates:
        forecast_reference_time                2025-12-01 06:00:00
    Attributes:
        Conventions                            'CF-1.7'
        cluster_sources                        '{"0": {"gl_ens": [43200], "uk_ens": [21600]}, "1": {"gl_ens": [43200], ...'
        institution                            'Met Office'
        primary_input_realizations_to_clusters '{"0": [19], "1": [0, 18]}'
        source                                 'Met Office Unified Model'

Copy link
Copy Markdown
Contributor

@maxwhitemet maxwhitemet left a comment

Choose a reason for hiding this comment

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

Happy with the changes made. Approved 👍

@gavinevans gavinevans merged commit b524f1c into master Mar 24, 2026
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