Skip to content

Commit daea5f7

Browse files
committed
adding option for the penny et al (2023) rmw regression fill without the moving mean smoother
1 parent d505a90 commit daea5f7

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

stormevents/nhc/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class RMWFillMethod(Enum):
88
none = None
99
persistent = auto()
1010
regression_penny_2023 = auto()
11+
regression_penny_2023_no_smoothing = auto()
1112

1213

1314
# Bias correction values for the Rmax forecast

stormevents/nhc/track.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,10 @@ def movingmean(dff):
13771377
"radius_of_maximum_winds"
13781378
]
13791379

1380-
elif rmw_fill == RMWFillMethod.regression_penny_2023:
1380+
elif (
1381+
rmw_fill == RMWFillMethod.regression_penny_2023
1382+
or rmw_fill == RMWFillMethod.regression_penny_2023_no_smoothing
1383+
):
13811384
# fill OFCL maximum wind radius based on regression method from
13821385
# Penny et al. (2023). https://doi.org/10.1175/WAF-D-22-0209.1
13831386
isotach_radii = forecast[

tests/test_nhc.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,24 @@ def test_rmw_fill_method_regression_penny_2023():
482482
rmw = data.loc[data.track_start_time == data.track_start_time.unique()[i_uq_row]][
483483
"radius_of_maximum_winds"
484484
]
485-
assert len(rmw.unique()) > 1
485+
assert len(rmw.unique()) == 11
486+
487+
488+
def test_rmw_fill_method_regression_penny_2023_no_smoothing():
489+
tr_florence2018 = VortexTrack.from_storm_name(
490+
"Florence",
491+
2018,
492+
file_deck="a",
493+
advisories=["OFCL"],
494+
rmw_fill=RMWFillMethod.regression_penny_2023_no_smoothing,
495+
)
496+
assert tr_florence2018.rmw_fill == RMWFillMethod.regression_penny_2023_no_smoothing
497+
data = tr_florence2018.data
498+
i_uq_row = 40
499+
rmw = data.loc[data.track_start_time == data.track_start_time.unique()[i_uq_row]][
500+
"radius_of_maximum_winds"
501+
]
502+
assert len(rmw.unique()) == 10
486503

487504

488505
def test_rmw_fill_method_setvalue_invalid():

0 commit comments

Comments
 (0)