Skip to content

Fix for compatibility with ADCIRC GAHM #76

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

Merged
merged 4 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 12 additions & 1 deletion stormevents/nhc/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import numpy
import pandas
import typepigeon
from pandas import DataFrame
from pandas import DataFrame, Timedelta
from pyproj import Geod
from shapely import ops
from shapely.geometry import LineString
Expand Down Expand Up @@ -721,6 +721,17 @@ def fort_22(self, advisory: ATCF_Advisory = None) -> DataFrame:
(self.data.groupby(["datetime"]).ngroup() + 1).astype("string").str.pad(4)
)

if advisory == ATCF_Advisory.BEST or advisory == ATCF_Advisory.BEST.value:
fort22["forecast_hours"] = (
(
(self.data["datetime"] - self.data["datetime"].iloc[0])
/ Timedelta("1 hour")
)
.astype(int)
.astype("string")
.str.pad(4)
)

return fort22

@property
Expand Down
Loading