Adds directional windshear across a MAUL#2146
Conversation
James Warner (jwarner8)
left a comment
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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). |
There was a problem hiding this comment.
| 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 |
There was a problem hiding this comment.
| 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 |
There was a problem hiding this comment.
| 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.""" |
There was a problem hiding this comment.
could this test be explained a bit more in docstring/comments?
| return precalc_wind_below_maul_5d_read_only.copy() | ||
|
|
||
|
|
||
| # EDIT FROM HERE |
There was a problem hiding this comment.
| # EDIT FROM HERE |
| # 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.""" |
There was a problem hiding this comment.
| """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.""" |
|
|
||
| @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.""" |
There was a problem hiding this comment.
| """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.""" |
|
|
||
| @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.""" |
There was a problem hiding this comment.
| """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.""" |
|
|
||
| @pytest.fixture() | ||
| def precalc_direction_shear_5d_read_only(): | ||
| """Get precalculated directional_shear_across maul 5D data. It is NOT safe to modify.""" |
There was a problem hiding this comment.
| """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.""" |
Fixes #1962
Contribution checklist
Aim to have all relevant checks ticked off before merging. See the developer's guide for more detail.
rose-suite.conf.examplehas been updated if new diagnostic added.