Skip to content

Commit

Permalink
FIX: Fix example scripts to improve interpolation (#1695)
Browse files Browse the repository at this point in the history
* Set `nb` value for grid interpolation

* Update email address

* Update citations

* Update qpe.py

* Fix linting errors

* Fix linting errors take 2

---------

Co-authored-by: Max Grover <[email protected]>
  • Loading branch information
lauratomkins and mgrover1 authored Nov 25, 2024
1 parent 8e6a6f0 commit 56f5712
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 16 deletions.
14 changes: 9 additions & 5 deletions examples/plotting/plot_nexrad_image_muted_reflectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@
with just snow and just rain are depicted in a corresponding full-color scale.
The ultimate utility of image muting radar reflectivity is to reduce the misinterpretation
of regions of melting or mixed precipitation as opposed to heavy snow or heavy rain.
See Tomkins et al. (2022) for full details.
"""

print(__doc__)

# Author: Laura Tomkins ([email protected])
# Author: Laura Tomkins ([email protected])
# License: BSD 3 clause
# citation: Tomkins, L. M., Yuter, S. E., Miller, M. A., and Allen, L. R., 2022:
# Image muting of mixed precipitation to improve identification of regions
# of heavy snow in radar data. Atmos. Meas. Tech., 15, 5515–5525,
# https://doi.org/10.5194/amt-15-5515-2022

import matplotlib.colors as mcolors
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -65,3 +62,10 @@
display.set_limits((-300, 300), (-300, 300))
ax.set_aspect("equal")
plt.show()

# References
# ----------
# Tomkins, L. M., Yuter, S. E., Miller, M. A., and Allen, L. R., 2022:
# Image muting of mixed precipitation to improve identification of regions
# of heavy snow in radar data. Atmos. Meas. Tech., 15, 5515–5525,
# https://doi.org/10.5194/amt-15-5515-2022
2 changes: 1 addition & 1 deletion examples/retrieve/plot_cfad.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

print(__doc__)

# Author: Laura Tomkins ([email protected])
# Author: Laura Tomkins ([email protected])
# License: BSD 3 clause


Expand Down
14 changes: 11 additions & 3 deletions examples/retrieve/plot_feature_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

print(__doc__)

# Author: Laura Tomkins ([email protected])
# Author: Laura Tomkins ([email protected])
# License: BSD 3 clause


Expand All @@ -28,8 +28,8 @@
# varies with the background value. The algorithm is heavily customizable and is designed to work with a variety of
# datasets. Here, we show several examples of how to use the algorithm with different types of radar data.
#
# See Steiner et al. (1995), Yuter and Houze (1997), and Yuter et al. (2005) for full details on the algorithm. A
# manuscript (Tomkins et al. 2024) is in prep to describe feature detection in cool-season events (part 2).
# See Steiner et al. (1995), Yuter and Houze (1997), and Yuter et al. (2005) for full details on the algorithm. Tomkins
# et al. 2024 builds on this work to describe feature detection in cool-season events (part 2).

######################################
# Part 1: Warm-season convective-stratiform classification
Expand All @@ -51,6 +51,7 @@
grid_shape=(1, 201, 201),
grid_limits=((0, 10000), (-50000.0, 50000.0), (-50000.0, 50000.0)),
fields=["reflectivity_horizontal"],
nb=1.5,
)

# get dx dy
Expand Down Expand Up @@ -189,6 +190,7 @@
grid_shape=(1, 201, 201),
grid_limits=((0, 10000), (-200000.0, 200000.0), (-200000.0, 200000.0)),
fields=["reflectivity"],
nb=1.5,
)

# get dx dy
Expand Down Expand Up @@ -421,6 +423,7 @@
grid_shape=(1, 201, 201),
grid_limits=((0, 10000), (-200000.0, 200000.0), (-200000.0, 200000.0)),
fields=["reflectivity", "cross_correlation_ratio"],
nb=1.5,
)

# image mute grid object
Expand Down Expand Up @@ -807,3 +810,8 @@ def quick_image_mute(field, muted_ref):
# Image muting of mixed precipitation to improve identification of regions
# of heavy snow in radar data. Atmos. Meas. Tech., 15, 5515–5525,
# https://doi.org/10.5194/amt-15-5515-2022
#
# Tomkins, L. M., Yuter, S. E., and Miller, M. A., 2024: Dual adaptive differential
# threshold method for automated detection of faint and strong echo features
# in radar observations of winter storms. Atmos. Meas. Tech., 17, 3377–3399,
# https://doi.org/10.5194/amt-17-3377-2024
4 changes: 4 additions & 0 deletions pyart/retrieve/cfad.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ def create_cfad(
histogram that is normalized by the number of points at each altitude. Altitude bins are masked where the counts
are less than a minimum fraction of the largest number of counts for any altitude row.
Author: Laura Tomkins ([email protected])
Parameters
----------
radar : Radar
Radar object used. Can be Radar or Grid object.
field_bins : list
Expand Down
10 changes: 6 additions & 4 deletions pyart/retrieve/echo_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,10 @@ def feature_detection(
):
"""
This function can be used to detect features in a field (e.g. reflectivity, rain rate, snow rate,
etc.) described by Tomkins et al. (2023) and based on original convective-stratiform algorithms developed by
etc.) described by Tomkins et al. (2024) and based on original convective-stratiform algorithms developed by
Steiner et al. (1995), Yuter et al. (2005) and Yuter and Houze (1997) algorithm.
Author: Laura Tomkins (@lauratomkins)
Author: Laura Tomkins ([email protected])
Parameters
----------
Expand Down Expand Up @@ -422,8 +422,10 @@ def feature_detection(
2005: Physical characterization of tropical oceanic convection observed in
KWAJEX. J. Appl. Meteor., 44, 385-415. https://doi.org/10.1175/JAM2206.1
Tomkins, L. M., S. E. Yuter, and M. A. Miller, 2024: Objective identification
of faint and strong features in radar observations of winter storms. in prep.
Tomkins, L. M., Yuter, S. E., and Miller, M. A., 2024: Dual adaptive differential
threshold method for automated detection of faint and strong echo features
in radar observations of winter storms. Atmos. Meas. Tech., 17, 3377–3399.
https://doi.org/10.5194/amt-17-3377-2024
"""

Expand Down
4 changes: 2 additions & 2 deletions pyart/retrieve/qpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def est_rain_rate_kdp(radar, alpha=None, beta=None, kdp_field=None, rr_field=Non
rain : dict
Field dictionary containing the rainfall rate.
Reference
References
---------
Figueras et al. Long-term monitoring of French polarimetric radar data
quality and evaluation of several polarimetric quantitative precipitation
Expand Down Expand Up @@ -696,7 +696,7 @@ def ZtoR(radar, ref_field="reflectivity", a=300, b=1.4, save_name="NWS_primary_p
"""
Convert reflectivity (dBZ) to precipitation rate (mm/hr)
Author: Laura Tomkins
Author: Laura Tomkins ([email protected])
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion pyart/util/radar_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ def image_mute_radar(radar, field, mute_field, mute_threshold, field_threshold=N
the correlation coefficient is less than a certain threshold to discern
melting precipitation.
Author: Laura Tomkins (@lauratomkins)
Author: Laura Tomkins ([email protected])
Parameters
----------
Expand Down

0 comments on commit 56f5712

Please sign in to comment.