Skip to content

Commit

Permalink
Update name of the RMW fill method
Browse files Browse the repository at this point in the history
  • Loading branch information
SorooshMani-NOAA committed Aug 22, 2024
1 parent 894692c commit f926078
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion stormevents/nhc/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class RMWFillMethod(Enum):
none = None
persistent = auto()
psurge_v2_9 = auto()
regression_penny_2023 = auto()


# Bias correction values for the Rmax forecast
Expand Down
10 changes: 5 additions & 5 deletions stormevents/nhc/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(
file_deck: ATCF_FileDeck = None,
advisories: List[ATCF_Advisory] = None,
forecast_time: datetime = None,
rmw_fill: RMWFillMethod = RMWFillMethod.psurge_v2_9,
rmw_fill: RMWFillMethod = RMWFillMethod.regression_penny_2023,
):
"""
:param storm: storm ID, or storm name and year
Expand Down Expand Up @@ -128,7 +128,7 @@ def from_storm_name(
file_deck: ATCF_FileDeck = None,
advisories: List[ATCF_Advisory] = None,
forecast_time: datetime = None,
rmw_fill: RMWFillMethod = RMWFillMethod.psurge_v2_9,
rmw_fill: RMWFillMethod = RMWFillMethod.regression_penny_2023,
) -> "VortexTrack":
"""
:param name: storm name
Expand Down Expand Up @@ -164,7 +164,7 @@ def from_file(
file_deck: ATCF_FileDeck = None,
advisories: List[ATCF_Advisory] = None,
forecast_time: datetime = None,
rmw_fill: RMWFillMethod = RMWFillMethod.psurge_v2_9,
rmw_fill: RMWFillMethod = RMWFillMethod.regression_penny_2023,
) -> "VortexTrack":
"""
:param path: file path to ATCF data
Expand Down Expand Up @@ -1274,7 +1274,7 @@ def combine_tracks(tracks: Dict[str, Dict[str, DataFrame]]) -> DataFrame:

def correct_ofcl_based_on_carq_n_hollandb(
tracks: Dict[str, Dict[str, DataFrame]],
rmw_fill: RMWFillMethod = RMWFillMethod.psurge_v2_9,
rmw_fill: RMWFillMethod = RMWFillMethod.regression_penny_2023,
) -> Dict[str, Dict[str, DataFrame]]:
"""
Correct official forecast using consensus track along with holland-b
Expand Down Expand Up @@ -1328,7 +1328,7 @@ def clamp(n, minn, maxn):
"radius_of_maximum_winds"
]

elif rmw_fill == RMWFillMethod.psurge_v2_9:
elif rmw_fill == RMWFillMethod.regression_penny_2023:
# fill OFCL maximum wind radius based on regression method from
# Penny et al. (2023). https://doi.org/10.1175/WAF-D-22-0209.1
isotach_radii = forecast[
Expand Down
2 changes: 1 addition & 1 deletion stormevents/stormevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def track(
advisories: List[ATCF_Advisory] = None,
filename: PathLike = None,
forecast_time: datetime = None,
rmw_fill: RMWFillMethod = RMWFillMethod.psurge_v2_9,
rmw_fill: RMWFillMethod = RMWFillMethod.regression_penny_2023,
) -> VortexTrack:
"""
retrieve NHC ATCF track data
Expand Down
12 changes: 6 additions & 6 deletions tests/test_nhc.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def test_rmw_fill_from_event_default_value():
florence2018 = stormevents.StormEvent("Florence", 2018)
tr = florence2018.track(file_deck="a", advisories=["OFCL"])

assert tr.rmw_fill == RMWFillMethod.psurge_v2_9
assert tr.rmw_fill == RMWFillMethod.regression_penny_2023


def test_rmw_fill_from_track():
Expand All @@ -431,7 +431,7 @@ def test_rmw_fill_from_track_default_value():
file_deck="a",
advisories=["OFCL"],
)
assert tr_florence2018.rmw_fill == RMWFillMethod.psurge_v2_9
assert tr_florence2018.rmw_fill == RMWFillMethod.regression_penny_2023


def test_rmw_fill_method_none():
Expand Down Expand Up @@ -468,15 +468,15 @@ def test_rmw_fill_method_persistent():
assert rmw.unique() == 10


def test_rmw_fill_method_psurge_v29():
def test_rmw_fill_method_regression_penny_2023():
tr_florence2018 = VortexTrack.from_storm_name(
"Florence",
2018,
file_deck="a",
advisories=["OFCL"],
rmw_fill=RMWFillMethod.psurge_v2_9,
rmw_fill=RMWFillMethod.regression_penny_2023,
)
assert tr_florence2018.rmw_fill == RMWFillMethod.psurge_v2_9
assert tr_florence2018.rmw_fill == RMWFillMethod.regression_penny_2023
data = tr_florence2018.data
i_uq_row = 40
rmw = data.loc[data.track_start_time == data.track_start_time.unique()[i_uq_row]][
Expand All @@ -491,7 +491,7 @@ def test_rmw_fill_method_set_after_creation():
2018,
file_deck="a",
advisories=["OFCL"],
rmw_fill=RMWFillMethod.psurge_v2_9,
rmw_fill=RMWFillMethod.regression_penny_2023,
)

i_uq_row = 40
Expand Down

0 comments on commit f926078

Please sign in to comment.