Skip to content

Adds light rain diagnostic for spatial plots, difference and timeseries#1957

Merged
ukmo-huw-lewis merged 10 commits into
mainfrom
1853_light_rain
Mar 13, 2026
Merged

Adds light rain diagnostic for spatial plots, difference and timeseries#1957
ukmo-huw-lewis merged 10 commits into
mainfrom
1853_light_rain

Conversation

@daflack
Copy link
Copy Markdown
Collaborator

@daflack David Flack (daflack) commented Mar 10, 2026

Includes recipes, and plumbing into the workflow.

Fixes #1853

Contribution checklist

Aim to have all relevant checks ticked off before merging. See the developer's guide for more detail.

  • Documentation has been updated to reflect change.
  • New code has tests, and affected old tests have been updated.
  • All tests and CI checks pass.
  • Ensured the pull request title is descriptive.
  • Ensure rose-suite.conf.example has been updated if new diagnostic added.
  • Conda lock files have been updated if dependencies have changed.
  • Attributed any Generative AI, such as GitHub Copilot, used in this PR.
  • Marked the PR as ready to review.

@daflack David Flack (daflack) self-assigned this Mar 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 10, 2026

Coverage

@daflack
Copy link
Copy Markdown
Collaborator Author

Example of light rain presence and rainfall field for same time showing only light rain is selected
image

example of spatial difference:
image

example of timeseries:
image

@daflack
Copy link
Copy Markdown
Collaborator Author

As two masks are multiplied together we lose the name of the diagnostic in the cube we are plotting. To get a name will necessitate a new operator that can add the name as meta-data to the cube. The operator will just call cube.rename, with an input of the name of the variable and the cube.

Thus a question for reviewers: should this operator be included in this PR or as a different PR? I'm happy either way.

@ukmo-huw-lewis
Copy link
Copy Markdown
Contributor

Happy to pick up review on this one if useful and others requested don't get there first.

First look through proposed changes and example output looks sensible and to be working, and nice use of masking to capture upper and lower thresholds.

On the question re. extra PR for the naming operator, I suggest you capture this within this current PR, as a function of the multiply operator being introduced. Rather than create a new operator however, suggest you consider any options for preserving or adjusting names more directly in the multiplier code. There is arguably some precedent for this with the difference operator in misc.py. Maybe the difference here is we're showing "mask x mask", but want it labelled as "rain present diagnostic"...... Interested to see proposed solution.

@daflack
Copy link
Copy Markdown
Collaborator Author

Added in naming convention into the multiplication operator and an extra operator for renaming for situations like "mask x mask" when they have a specific meaning like "light rain", and put this into the recipe. I kept the naming convection "mask_for" to allow the relevant mask colourscales for the mask and mask differences to be plotted. Examples for spatial plot and spatial plot difference below. Only difference for timeseries is axis name and the fixed axis between 0 and 1.

image

ukmo-huw-lewis now ready for full review

Copy link
Copy Markdown
Contributor

@ukmo-huw-lewis ukmo-huw-lewis left a comment

Choose a reason for hiding this comment

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

Changes look good overall, and update to plotting output example look great.

Suggest to tidy up and respond to comments before happy to take another look and close this one out.

Comment thread src/CSET/operators/misc.py
Comment thread src/CSET/operators/misc.py Outdated
Comment thread tests/operators/test_misc.py
Comment thread tests/operators/test_misc.py
Comment thread tests/operators/test_misc.py
Comment thread tests/operators/test_misc.py
Comment thread tests/operators/test_misc.py
Comment thread src/CSET/operators/misc.py
Comment thread src/CSET/operators/misc.py Outdated
@daflack
Copy link
Copy Markdown
Collaborator Author

ukmo-huw-lewis comments addressed/responded to, back to you.

Copy link
Copy Markdown
Contributor

@ukmo-huw-lewis ukmo-huw-lewis 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 responses. Happy to approve.

Will merge.

@ukmo-huw-lewis ukmo-huw-lewis merged commit f48ca8f into main Mar 13, 2026
8 checks passed
@ukmo-huw-lewis ukmo-huw-lewis deleted the 1853_light_rain branch March 13, 2026 17:05
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.

Presence of Light Rain

2 participants