Skip to content

Commit

Permalink
fixed stormIdentifier drop condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmelo-Belo committed Sep 12, 2023
1 parent 576e36e commit 7e67080
Show file tree
Hide file tree
Showing 7 changed files with 1,305 additions and 15 deletions.
695 changes: 687 additions & 8 deletions notebooks-examples-trials/data/ibtracs.ACTIVE.list.v04r00.csv

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 2 additions & 4 deletions notebooks-examples-trials/tracks_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,10 @@ def create_storms_df(start_date):
Dataframe containing the forecast data for the active cyclones.
"""
# Load cyclone dataframe with Mean sea level pressure value
# df_storms = pdbufr.read_bufr('data/tc_test_track_data.bufr',
df_storms = pdbufr.read_bufr(f"data/tracks/{start_date.strftime('%Y%m%d')}.bufr",
columns=("stormIdentifier", "longStormName", "ensembleMemberNumber", "year", "month", "day", "hour", "latitude", "longitude",
"pressureReducedToMeanSeaLevel"))
# Load cyclone dataframe with Wind speed at 10m value
# df1 = pdbufr.read_bufr('data/tc_test_track_data.bufr',
df1 = pdbufr.read_bufr(f"data/tracks/{start_date.strftime('%Y%m%d')}.bufr",
columns=("stormIdentifier", "longStormName", "ensembleMemberNumber", "latitude", "longitude",
"windSpeedAt10M"))
Expand All @@ -97,8 +95,8 @@ def create_storms_df(start_date):
# Add the Wind speed at 10m column adn the timePeriod column to the storms dataframe
df_storms["windSpeedAt10M"] = df1.windSpeedAt10M
df_storms["timePeriod"] = timeperiod
# Storms with number higher than 10 are not real storms (according to what Fernando said)
drop_condition = df_storms.stormIdentifier < '11'
# Storms with stormIdentifier higher than 70 are not real storms
drop_condition = df_storms.stormIdentifier < '70'
df_storms = df_storms[drop_condition]
return df_storms

Expand Down
Loading

0 comments on commit 7e67080

Please sign in to comment.