Skip to content

Adds directional windshear across a MAUL#2146

Open
David Flack (daflack) wants to merge 6 commits into
MAUL_windspeed_propertiesfrom
MAUL_directional_windshear_properties_1962
Open

Adds directional windshear across a MAUL#2146
David Flack (daflack) wants to merge 6 commits into
MAUL_windspeed_propertiesfrom
MAUL_directional_windshear_properties_1962

Conversation

@daflack
Copy link
Copy Markdown
Collaborator

@daflack David Flack (daflack) commented May 19, 2026

Fixes #1962

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 May 19, 2026
@daflack David Flack (daflack) linked an issue May 19, 2026 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

Coverage

@daflack
Copy link
Copy Markdown
Collaborator Author

Note comment on #2140 about refactoring and optimization being made in #2114 - like #2140 have not run in workflow, but code produces sensible results when testing.

Copy link
Copy Markdown
Contributor

@jwarner8 James Warner (jwarner8) left a comment

Choose a reason for hiding this comment

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

Looks good, and methods look scientifically grounded. I haven't run the diagnostic myself, as don't have any appropriate data to test with.
Most comments minor, mostly just increasing explainability of tests/some bits of the code, so its easier for those not familiar to be able to understand.

].data
)
elif (
len(number_of_MAULs.coord("realization").points)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this general code block could do with some single line comments, as its quite hard to follow what's happening

temperature alongside the relative humidity of that layer exceeding 90 %, following
[Takemi and Unuma (2020)](https://doi.org/10.2151/sola.2020-006). The equivalent
potential temperature is calculated using air temperature, pressure and specific humidity.
A vertical differentitation occurs to determine the stability (< 0 with dz implies unstable air).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
A vertical differentitation occurs to determine the stability (< 0 with dz implies unstable air).
A vertical differentiation occurs to determine the stability (< 0 with dz implies unstable air).

potential temperature is calculated using air temperature, pressure and specific humidity.
A vertical differentitation occurs to determine the stability (< 0 with dz implies unstable air).
The relative humidity is linearly interpolated onto the same grid as the vertical
derivative of the equivalent potenital temperature. The masks for each criterion are multiplied
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
derivative of the equivalent potenital temperature. The masks for each criterion are multiplied
derivative of the equivalent potential temperature. The masks for each criterion are multiplied

The relative humidity is linearly interpolated onto the same grid as the vertical
derivative of the equivalent potenital temperature. The masks for each criterion are multiplied
together and then image processing is used to identify the number of objects (values of
ones that are connected) the depth of each object is found the deepest MAUL is used. The
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
ones that are connected) the depth of each object is found the deepest MAUL is used. The
ones that are connected) where(?) the depth of each object is found the deepest MAUL is used. The

def test_maul_properties_direction_shear_cubelist(
maul_mask, u_wind_maul, v_wind_maul, precalc_direction_shear
):
"""Ensure correct directional shear across maul in cubelist."""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could this test be explained a bit more in docstring/comments?

Comment thread tests/conftest.py
return precalc_wind_below_maul_5d_read_only.copy()


# EDIT FROM HERE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
# EDIT FROM HERE

Comment thread tests/conftest.py
# EDIT FROM HERE
@pytest.fixture()
def precalc_direction_shear_read_only():
"""Get precalculated directional shear across maul 3D data. It is NOT safe to modify."""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"""Get precalculated directional shear across maul 3D data. It is NOT safe to modify."""
"""Get precalculated directional shear across maul for 3D data. It is NOT safe to modify."""

Comment thread tests/conftest.py

@pytest.fixture()
def precalc_direction_shear_4d_time_read_only():
"""Get precalculated directional shear across maul 4D data varying time. It is NOT safe to modify."""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"""Get precalculated directional shear across maul 4D data varying time. It is NOT safe to modify."""
"""Get precalculated directional shear across maul for 4D data varying time. It is NOT safe to modify."""

Comment thread tests/conftest.py

@pytest.fixture()
def precalc_direction_shear_4d_realization_read_only():
"""Get precalculated directional shear across maul 4D data varying realization. It is NOT safe to modify."""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"""Get precalculated directional shear across maul 4D data varying realization. It is NOT safe to modify."""
"""Get precalculated directional shear across maul for 4D data varying realization. It is NOT safe to modify."""

Comment thread tests/conftest.py

@pytest.fixture()
def precalc_direction_shear_5d_read_only():
"""Get precalculated directional_shear_across maul 5D data. It is NOT safe to modify."""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"""Get precalculated directional_shear_across maul 5D data. It is NOT safe to modify."""
"""Get precalculated directional_shear_across maul for 5D data. It is NOT safe to modify."""

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.

MAUL properties: windshear

2 participants