Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reclass: Addition of New Radar Echo Classification Function #1495

Merged
merged 59 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
e9af16a
ADD: _echo_class_wt.py: RadarEchoClass module with all methods/code f…
RBhupi Dec 4, 2023
4cb9a98
ADD:wrapper function for wt_reclass
RBhupi Dec 4, 2023
75a7cbc
REFORMAT: Function names comply with PyART & PEP8 standards.
RBhupi Dec 5, 2023
6ce7cc8
REFORMAT: Function names comply with PyART & PEP8 standards.
RBhupi Dec 5, 2023
ad60ced
Revert "REFORMAT: Function names comply with PyART & PEP8 standards."
RBhupi Dec 5, 2023
cb59422
REFORMAT: Function names comply with PyART & PEP8 standards.
RBhupi Dec 5, 2023
8e727bf
ADD: masked array, detailed func arguments
RBhupi Dec 8, 2023
8397073
MOD:func user arguments used,class num changed.
RBhupi Dec 8, 2023
8cbf8fc
DOC:function and user arguments.
RBhupi Dec 8, 2023
e7b9b0c
MOD: added metadata to field dictinery.
RBhupi Dec 8, 2023
77de7a1
Merge branch 'ARM-DOE:main' into reclass
RBhupi Dec 8, 2023
fb64b64
order of classes changed
RBhupi Dec 8, 2023
fa3e339
merged changes from pyart main branch
RBhupi Dec 8, 2023
b58541e
cappi level added;better description of calsses
RBhupi Dec 11, 2023
368fc6c
REFORMAT: PEP8 style
RBhupi Dec 12, 2023
a02ed10
FORMAT:PEP8
RBhupi Dec 12, 2023
87b85ac
MOD:sanity check for conv core threshold
RBhupi Dec 12, 2023
691dfdc
MOD:More sanity check for thresholds
RBhupi Dec 12, 2023
5435665
MOD:Added override to sanity check+documentation
RBhupi Dec 12, 2023
b5aa79d
MOD:minor
RBhupi Dec 12, 2023
71bda53
invalid grid raises exception
RBhupi Dec 12, 2023
1d7f71e
first unit test added
RBhupi Dec 12, 2023
5b04a81
ADD:func make_gaussian_storm_grid
RBhupi Dec 12, 2023
19c6cb0
ADD: test for output validity
RBhupi Dec 12, 2023
83155a7
ADD:utest for results of classification
RBhupi Dec 12, 2023
0977cd4
ENH: test documentation and apply black formatting
RBhupi Dec 12, 2023
be97289
ENH:small test func merged;name change
RBhupi Dec 12, 2023
d1f7aa0
ADD: Stat-based tests for Gaussian storm grid function
RBhupi Dec 12, 2023
4512f59
ADD: example
RBhupi Dec 13, 2023
5401b35
FORMAT:Black
RBhupi Dec 13, 2023
ba25c64
FIX: issues for #1495 the code review
RBhupi Dec 15, 2023
cdc28d7
FIX:unused imports andvariables removed
RBhupi Dec 15, 2023
ee0ea00
Removed two line func sum_conv_wavelets();
RBhupi Dec 15, 2023
edec4bf
minor
RBhupi Dec 15, 2023
09ec054
Removed reflectivity_to_rainrate()
RBhupi Dec 15, 2023
4d78ca6
Test PAssed reflectivity_to_rainrate():
RBhupi Dec 15, 2023
3eec39f
minor:autosummary
RBhupi Dec 15, 2023
76fb441
ADD:conv_wavelet_sum()
RBhupi Dec 15, 2023
c3e03fa
Func Renamed: get_reclass -> wavelet_reclas
RBhupi Dec 15, 2023
c0bc43d
Refined documentation and Descriptive user arguments
RBhupi Dec 16, 2023
7064af1
FMT: Black
RBhupi Dec 16, 2023
e4efd93
ENH:Docstring
RBhupi Dec 16, 2023
b491bc7
DOC:Better description & ordering of classification categories
RBhupi Dec 16, 2023
114e99c
REFACTOR:scale_break now computed in calling function
RBhupi Dec 18, 2023
07be2d1
ENH:scale_break is adaptive to resolution
RBhupi Dec 18, 2023
9fff87e
ENH:atol added, tests default function arguments
RBhupi Dec 18, 2023
649e3fb
FROMAT:black
RBhupi Dec 18, 2023
6b77843
MINOR:corrected tab in docstring
RBhupi Dec 18, 2023
b789192
used new scaling and added description
RBhupi Dec 18, 2023
8c11c5d
MINOR: alignment in docstring
RBhupi Dec 18, 2023
48f66a9
FORAMT:linting error corrected
RBhupi Dec 18, 2023
f3915fe
'LINTING ERR:import-block sorted;extra'()' removed'
RBhupi Dec 26, 2023
54b3436
FIX: Fix linting error
mgrover1 Jan 4, 2024
9e2578d
Merge branch 'main' into reclass
mgrover1 Jan 4, 2024
5ce8e8e
FIX: Fix more linting errors
mgrover1 Jan 4, 2024
6abcc76
Merge branch 'reclass' of https://github.com/RBhupi/pyart into reclass
mgrover1 Jan 4, 2024
2c93f6b
DOCS:minor docstrig chages from Zach
RBhupi Jan 10, 2024
bac411b
DOCS: testing precommit
RBhupi Jan 10, 2024
18d7901
Merge branch 'main' into reclass
RBhupi Jan 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 126 additions & 15 deletions examples/retrieve/wavelet_echo_class_example.ipynb

Large diffs are not rendered by default.

128 changes: 64 additions & 64 deletions pyart/retrieve/echo_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,75 +997,75 @@ def conv_strat_raut(
override_checks=False,
):
"""
zssherman marked this conversation as resolved.
Show resolved Hide resolved
A fast method to classify radar echoes into convective cores, mixed convection, and stratiform regions.

This function uses à trous wavelet transform (ATWT) for multiresolution (scale) analysis of radar field,
focusing on precipitation structure over reflectivity thresholds for classification (Raut et al 2008, 2020).

Parameters
----------
grid : Grid
Grid object containing radar data.
refl_field : str
Field name for reflectivity data in the Py-ART grid object.
zr_a : float, optional
Coefficient 'a' in the Z-R relationship Z = a*R^b for reflectivity to rain rate conversion.
The algorithm is not sensitive to precise values of 'zr_a' and 'zr_b'; however,
they must be adjusted based on the type of radar used.
Default is 200.
zr_b : float, optional
Coefficient 'b' in the Z-R relationship Z = a*R^b. Default is 1.6.
core_wt_threshold : float, optional
Threshold for wavelet components to separate convective cores from mix-intermediate type.
Default is 5. Recommended values are between 4 and 6.
conv_wt_threshold : float, optional
Threshold for significant wavelet components to separate all convection from stratiform.
Default is 1.5. Recommended values are between 1 and 2.
conv_scale_km : float, optional
Approximate scale break (in km) between convective and stratiform scales.
Scale break may vary over different regions and seasons
(Refere to Raut et al 2018 for more discussion on scale-breaks). Note that the
algorithm is insensitive to small variations in the scale break due to the
dyadic nature of the scaling. The actual scale break used in the calculation of wavelets
is returned in the output dictionary by parameter `scale_break_used`.
Default is 25 km. Recommended values are between 16 and 32 km.
min_reflectivity : float, optional
Minimum reflectivity threshold. Reflectivities below this value are not classified.
Default is 5 dBZ. This value must be greater than or equal to '0'.
conv_min_refl : float, optional
Reflectivity values lower than this threshold will be always considered as non-convective.
Default is 25 dBZ. Recommended values are between 25 and 30 dBZ.
conv_core_threshold : float, optional
Reflectivities above this threshold are classified as convective cores if wavelet components are significant (See: conv_wt_threshold).
Default is 42 dBZ.
Recommended value must be is greater than or equal to 40 dBZ. The algorithm is not sensitive to this value.
override_checks : bool, optional
If set to True, the function will bypass the sanity checks for above parameter values.
This allows the user to use custom values for parameters, even if they fall outside
the recommended ranges. The default is False.

Returns
-------
A fast method to classify radar echoes into convective cores, mixed convection, and stratiform regions.

This function uses à trous wavelet transform (ATWT) for multiresolution (scale) analysis of radar field,
focusing on precipitation structure over reflectivity thresholds for classification (Raut et al 2008, 2020).

Parameters
----------
grid : Grid
Grid object containing radar data.
refl_field : str
Field name for reflectivity data in the Py-ART grid object.
zr_a : float, optional
Coefficient 'a' in the Z-R relationship Z = a*R^b for reflectivity to rain rate conversion.
The algorithm is not sensitive to precise values of 'zr_a' and 'zr_b'; however,
they must be adjusted based on the type of radar used.
Default is 200.
zr_b : float, optional
Coefficient 'b' in the Z-R relationship Z = a*R^b. Default is 1.6.
core_wt_threshold : float, optional
Threshold for wavelet components to separate convective cores from mix-intermediate type.
Default is 5. Recommended values are between 4 and 6.
conv_wt_threshold : float, optional
Threshold for significant wavelet components to separate all convection from stratiform.
Default is 1.5. Recommended values are between 1 and 2.
conv_scale_km : float, optional
Approximate scale break (in km) between convective and stratiform scales.
Scale break may vary over different regions and seasons
(Refere to Raut et al 2018 for more discussion on scale-breaks). Note that the
algorithm is insensitive to small variations in the scale break due to the
dyadic nature of the scaling. The actual scale break used in the calculation of wavelets
is returned in the output dictionary by parameter `scale_break_used`.
Default is 25 km. Recommended values are between 16 and 32 km.
min_reflectivity : float, optional
Minimum reflectivity threshold. Reflectivities below this value are not classified.
Default is 5 dBZ. This value must be greater than or equal to '0'.
conv_min_refl : float, optional
Reflectivity values lower than this threshold will be always considered as non-convective.
Default is 25 dBZ. Recommended values are between 25 and 30 dBZ.
conv_core_threshold : float, optional
Reflectivities above this threshold are classified as convective cores if wavelet components are significant (See: conv_wt_threshold).
Default is 42 dBZ.
Recommended value must be is greater than or equal to 40 dBZ. The algorithm is not sensitive to this value.
override_checks : bool, optional
If set to True, the function will bypass the sanity checks for above parameter values.
This allows the user to use custom values for parameters, even if they fall outside
the recommended ranges. The default is False.

Returns
-------
zssherman marked this conversation as resolved.
Show resolved Hide resolved

dict:
A dictionary structured as a Py-ART grid field, suitable for adding to a Py-ART Grid object. The dictionary
contains the classification data and associated metadata. The classification categories are as follows:
- 3: Convective Cores: associated with strong updrafts and active collision-coalescence.
- 2: Mixed-Intermediate: capturing a wide range of convective activities, excluding the convective cores.
- 1: Stratiform: remaining areas with more uniform and less intense precipitation.
- 0: Unclassified: for reflectivity below the minimum threshold.
dict:
A dictionary structured as a Py-ART grid field, suitable for adding to a Py-ART Grid object. The dictionary
contains the classification data and associated metadata. The classification categories are as follows:
- 3: Convective Cores: associated with strong updrafts and active collision-coalescence.
- 2: Mixed-Intermediate: capturing a wide range of convective activities, excluding the convective cores.
- 1: Stratiform: remaining areas with more uniform and less intense precipitation.
- 0: Unclassified: for reflectivity below the minimum threshold.


References
----------
Raut, B. A., Karekar, R. N., & Puranik, D. M. (2008). Wavelet-based technique to extract convective clouds from
infrared satellite images. IEEE Geosci. Remote Sens. Lett., 5(3), 328-330.
References
----------
Raut, B. A., Karekar, R. N., & Puranik, D. M. (2008). Wavelet-based technique to extract convective clouds from
infrared satellite images. IEEE Geosci. Remote Sens. Lett., 5(3), 328-330.

Raut, B. A., Seed, A. W., Reeder, M. J., & Jakob, C. (2018). A multiplicative cascade model for high‐resolution
space‐time downscaling of rainfall. J. Geophys. Res. Atmos., 123(4), 2050-2067.
Raut, B. A., Seed, A. W., Reeder, M. J., & Jakob, C. (2018). A multiplicative cascade model for high‐resolution
space‐time downscaling of rainfall. J. Geophys. Res. Atmos., 123(4), 2050-2067.

Raut, B. A., Louf, V., Gayatri, K., Murugavel, P., Konwar, M., & Prabhakaran, T. (2020). A multiresolution technique
for the classification of precipitation echoes in radar data. IEEE Trans. Geosci. Remote Sens., 58(8), 5409-5415.
Raut, B. A., Louf, V., Gayatri, K., Murugavel, P., Konwar, M., & Prabhakaran, T. (2020). A multiresolution technique
for the classification of precipitation echoes in radar data. IEEE Trans. Geosci. Remote Sens., 58(8), 5409-5415.
"""

# Check if the grid is a Py-ART Grid object
Expand Down
Loading