NHC storm tracks
The National Hurricane Center (NHC) tracks and tropical cyclones dating back to 1851.
The nhc_storms()
function provides a list of NHC storms from their online archive:
- stormevents.nhc.storms.nhc_storms(year: int = None) DataFrame
retrieve a list of hurricanes from NHC since 1851
- Parameters:
year – storm year
- Returns:
table of storms
>>> nhc_storms() name class year basin number source start_date end_date nhc_code AL021851 UNNAMED HU 1851 AL 2 ARCHIVE 1851-07-05 12:00:00 1851-07-05 12:00:00 AL031851 UNNAMED TS 1851 AL 3 ARCHIVE 1851-07-10 12:00:00 1851-07-10 12:00:00 AL041851 UNNAMED HU 1851 AL 4 ARCHIVE 1851-08-16 00:00:00 1851-08-27 18:00:00 AL051851 UNNAMED TS 1851 AL 5 ARCHIVE 1851-09-13 00:00:00 1851-09-16 18:00:00 AL061851 UNNAMED TS 1851 AL 6 ARCHIVE 1851-10-16 00:00:00 1851-10-19 18:00:00 ... ... ... ... ... ... ... ... ... CP902021 INVEST LO 2021 CP 90 METWATCH 2021-07-24 12:00:00 NaT CP912021 INVEST DB 2021 CP 91 METWATCH 2021-08-07 18:00:00 NaT EP922021 INVEST DB 2021 EP 92 METWATCH 2021-06-05 06:00:00 NaT EP712022 GENESIS001 DB 2022 EP 71 GENESIS 2022-01-20 12:00:00 NaT EP902022 INVEST LO 2022 EP 90 METWATCH 2022-01-20 12:00:00 NaT [2714 rows x 8 columns]
VortexTrack
class
- class stormevents.nhc.track.VortexTrack(storm: str | PathLike | DataFrame | BytesIO, start_date: datetime | None = None, end_date: datetime | None = None, file_deck: ATCF_FileDeck | None = None, advisories: List[ATCF_Advisory] | None = None, forecast_time: datetime | None = None)
interface to an ATCF vortex track (i.e. HURDAT, best track, HWRF, etc.)
- Parameters:
storm – storm ID, or storm name and year
start_date – start date of track
end_date – end date of track
file_deck – ATCF file deck; one of a, b, f
advisories – ATCF advisory type; one of
BEST
,OFCL
,OFCP
,HMON
,CARQ
,HWRF
>>> VortexTrack('AL112017') VortexTrack('AL112017', Timestamp('2017-08-30 00:00:00'), Timestamp('2017-09-13 12:00:00'), <ATCF_FileDeck.BEST: 'b'>, <ATCF_Mode.HISTORICAL: 'ARCHIVE'>, [<ATCF_Advisory.BEST: 'BEST'>], None)
>>> VortexTrack('AL112017', start_date='2017-09-04') VortexTrack('AL112017', Timestamp('2017-09-04 00:00:00'), Timestamp('2017-09-13 12:00:00'), <ATCF_FileDeck.BEST: 'b'>, <ATCF_Mode.HISTORICAL: 'ARCHIVE'>, [<ATCF_Advisory.BEST: 'BEST'>], None)
>>> from datetime import timedelta >>> VortexTrack('AL112017', start_date=timedelta(days=2), end_date=timedelta(days=-1)) VortexTrack('AL112017', Timestamp('2017-09-01 00:00:00'), Timestamp('2017-09-12 12:00:00'), <ATCF_FileDeck.BEST: 'b'>, <ATCF_Mode.HISTORICAL: 'ARCHIVE'>, [<ATCF_Advisory.BEST: 'BEST'>], None)
>>> VortexTrack('AL112017', file_deck='a') VortexTrack('AL112017', Timestamp('2017-08-27 06:00:00'), Timestamp('2017-09-13 12:00:00'), <ATCF_FileDeck.ADVISORY: 'a'>, <ATCF_Mode.HISTORICAL: 'ARCHIVE'>, ['OFCL', 'OFCP', 'HMON', 'CARQ', 'HWRF'], None)
- classmethod from_storm_name(name: str, year: int, start_date: datetime | None = None, end_date: datetime | None = None, file_deck: ATCF_FileDeck | None = None, advisories: List[ATCF_Advisory] | None = None, forecast_time: datetime | None = None) VortexTrack
- Parameters:
name – storm name
year – storm year
start_date – start date of track
end_date – end date of track
file_deck – ATCF file deck; one of
a
,b
,f
advisories – list of ATCF advisory types; valid choices are:
BEST
,OFCL
,OFCP
,HMON
,CARQ
, HWRF`
>>> VortexTrack.from_storm_name('irma', 2017) VortexTrack('AL112017', Timestamp('2017-08-30 00:00:00'), Timestamp('2017-09-13 12:00:00'), <ATCF_FileDeck.BEST: 'b'>, [<ATCF_Advisory.BEST: 'BEST'>], None)
- classmethod from_file(path: PathLike, start_date: datetime | None = None, end_date: datetime | None = None, file_deck: ATCF_FileDeck | None = None, advisories: List[ATCF_Advisory] | None = None, forecast_time: datetime | None = None) VortexTrack
- Parameters:
path – file path to ATCF data
start_date – start date of track
end_date – end date of track
file_deck – ATCF file deck; one of
a
,b
,f
advisories – list of ATCF advisory types; valid choices are:
BEST
,OFCL
,OFCP
,HMON
,CARQ
, HWRF`
>>> VortexTrack.from_file('tests/data/input/test_vortex_track_from_file/AL062018.dat') VortexTrack('AL062018', Timestamp('2018-08-30 06:00:00'), Timestamp('2018-09-18 12:00:00'), None, <ATCF_Mode.HISTORICAL: 'ARCHIVE'>, ['BEST', 'OFCL', 'OFCP', 'HMON', 'CARQ', 'HWRF'], PosixPath('/home/zrb/Projects/StormEvents/tests/data/input/test_vortex_track_from_file/AL062018.dat')) >>> VortexTrack.from_file('tests/data/input/test_vortex_track_from_file/irma2017_fort.22') VortexTrack('AL112017', Timestamp('2017-09-05 00:00:00'), Timestamp('2017-09-12 00:00:00'), None, <ATCF_Mode.HISTORICAL: 'ARCHIVE'>, ['BEST', 'OFCL', 'OFCP', 'HMON', 'CARQ', 'HWRF'], PosixPath('/home/zrb/Projects/StormEvents/tests/data/input/test_vortex_track_from_file/irma2017_fort.22'))
- property name: str
return: NHC storm name
>>> track = VortexTrack('AL112017') >>> track.name 'IRMA'
- property basin: str
return: basin of track
>>> track = VortexTrack('AL112017') >>> track.basin 'AL'
- property storm_number: str
return: ordinal number of storm within the basin and year
>>> track = VortexTrack('AL112017') >>> track.storm_number 11
- property year: int
return: year of storm
>>> track = VortexTrack('AL112017') >>> track.year 2017
- property nhc_code: str
return: storm NHC code (i.e.
AL062018
)>>> track = VortexTrack('AL112017') >>> track.nhc_code 'AL112017'
- property start_date: Timestamp
return: start time of current track
>>> track = VortexTrack('AL112017') >>> track.start_date Timestamp('2017-08-30 00:00:00') >>> track.start_date = '2017-09-04' >>> track.start_date Timestamp('2017-09-04 00:00:00') >>> from datetime import timedelta >>> track.start_date = timedelta(days=1) >>> track.start_date Timestamp('2017-08-31 00:00:00') >>> track.start_date = timedelta(days=-2) >>> track.start_date Timestamp('2017-09-11 12:00:00')
- property end_date: Timestamp
return: end time of current track
>>> track = VortexTrack('AL112017') >>> track.end_date Timestamp('2017-09-13 12:00:00') >>> track.end_date = '2017-09-10' >>> track.end_date Timestamp('2017-09-10 00:00:00') >>> from datetime import timedelta >>> track.end_date = timedelta(days=-1) >>> track.end_date Timestamp('2017-09-12 12:00:00') >>> track.end_date = timedelta(days=2) >>> track.end_date Timestamp('2017-09-01 00:00:00')
- property forecast_time: Timestamp
return: forecast time of forecast track
- property file_deck: ATCF_FileDeck
return: ATCF file deck; one of
a
,b
,f
- property advisories: List[ATCF_Advisory]
return: ATCF advisory types; one of
BEST
,OFCL
,OFCP
,HMON
,CARQ
,HWRF
- property filename: Path
return: file path to read file (optional)
- property data: DataFrame
return: track data for the given parameters as a data frame
>>> track = VortexTrack('AL112017') >>> track.data basin storm_number datetime advisory_number ... isowave_radius_for_SWQ extra_values geometry track_start_time 0 AL 11 2017-08-30 00:00:00 ... NaN <NA> POINT (-26.90000 16.10000) 2017-08-30 1 AL 11 2017-08-30 06:00:00 ... NaN <NA> POINT (-28.30000 16.20000) 2017-08-30 2 AL 11 2017-08-30 12:00:00 ... NaN <NA> POINT (-29.70000 16.30000) 2017-08-30 3 AL 11 2017-08-30 18:00:00 ... NaN <NA> POINT (-30.80000 16.30000) 2017-08-30 4 AL 11 2017-08-30 18:00:00 ... NaN <NA> POINT (-30.80000 16.30000) 2017-08-30 .. ... ... ... ... ... ... ... ... ... 168 AL 11 2017-09-12 12:00:00 ... NaN <NA> POINT (-86.90000 33.80000) 2017-08-30 169 AL 11 2017-09-12 18:00:00 ... NaN <NA> POINT (-88.10000 34.80000) 2017-08-30 170 AL 11 2017-09-13 00:00:00 ... NaN <NA> POINT (-88.90000 35.60000) 2017-08-30 171 AL 11 2017-09-13 06:00:00 ... NaN <NA> POINT (-89.50000 36.20000) 2017-08-30 172 AL 11 2017-09-13 12:00:00 ... NaN <NA> POINT (-90.10000 36.80000) 2017-08-30 [173 rows x 38 columns]
>>> track = VortexTrack('AL112017', file_deck='a') >>> track.data basin storm_number datetime advisory_number ... isowave_radius_for_SWQ extra_values geometry track_start_time 0 AL 11 2017-08-27 06:00:00 01 ... NaN <NA> POINT (-17.40000 11.70000) 2017-08-28 06:00:00 1 AL 11 2017-08-27 12:00:00 01 ... NaN <NA> POINT (-17.90000 11.80000) 2017-08-28 06:00:00 2 AL 11 2017-08-27 18:00:00 01 ... NaN <NA> POINT (-18.40000 11.90000) 2017-08-28 06:00:00 3 AL 11 2017-08-28 00:00:00 01 ... NaN <NA> POINT (-19.00000 12.00000) 2017-08-28 06:00:00 4 AL 11 2017-08-28 06:00:00 01 ... NaN <NA> POINT (-19.50000 12.00000) 2017-08-28 06:00:00 ... ... ... ... ... ... ... ... ... ... 10739 AL 11 2017-09-12 00:00:00 03 ... NaN <NA> POINT (-84.40000 31.90000) 2017-09-12 00:00:00 10740 AL 11 2017-09-12 03:00:00 03 ... NaN <NA> POINT (-84.90000 32.40000) 2017-09-12 00:00:00 10741 AL 11 2017-09-12 12:00:00 03 ... NaN <NA> POINT (-86.40000 33.80000) 2017-09-12 00:00:00 10742 AL 11 2017-09-13 00:00:00 03 ... NaN <NA> POINT (-88.20000 35.20000) 2017-09-12 00:00:00 10743 AL 11 2017-09-13 12:00:00 03 ... NaN <NA> POINT (-88.60000 36.40000) 2017-09-12 00:00:00 [10434 rows x 38 columns]
- to_file(path: PathLike, advisory: ATCF_Advisory | None = None, overwrite: bool = False)
write track to file path
- Parameters:
path – output file path
advisory – advisory type to write
overwrite – overwrite existing file
- atcf(advisory: ATCF_Advisory | None = None) DataFrame
https://www.nrlmry.navy.mil/atcf_web/docs/database/new/abrdeck.html
BASIN,CY,YYYYMMDDHH,TECHNUM/MIN,TECH,TAU,LatN/S,LonE/W,VMAX,MSLP,TY,RAD,WINDCODE,RAD1,RAD2,RAD3,RAD4,RADP,RRP,MRD,GUSTS,EYE,SUBREGION,MAXSEAS,INITIALS,DIR,SPEED,STORMNAME,DEPTH,SEAS,SEASCODE,SEAS1,SEAS2,SEAS3,SEAS4,USERDEFINED,userdata
- Parameters:
advisory – advisory type
- Returns:
dataframe of CSV lines in ATCF format
- fort_22(advisory: ATCF_Advisory | None = None) DataFrame
https://wiki.adcirc.org/wiki/Fort.22_file
- Parameters:
advisory – advisory type
- Returns:
fort.22 representation of the current track
- property linestrings: Dict[str, Dict[str, LineString]]
return: spatial linestrings for every advisory and track
- property distances: Dict[str, Dict[str, float]]
return: length, in meters, of the track over WGS84 (
EPSG:4326
)
- isotachs(wind_speed: float, segments: int = 91) Dict[str, Dict[str, Dict[str, Polygon]]]
isotach at the given wind speed at every time in the dataset
- Parameters:
wind_speed – wind speed to extract (in knots)
segments – number of discretization points per quadrant
- Returns:
list of isotachs as polygons for each advisory type and individual track
- wind_swaths(wind_speed: int, segments: int = 91) Dict[str, Dict[str, Polygon]]
wind swaths (per advisory type) for each advisory and track, as polygons
- Parameters:
wind_speed – wind speed in knots (one of
34
,50
, or64
)segments – number of discretization points per quadrant (default =
91
)
- property tracks: Dict[str, Dict[str, DataFrame]]
return: individual tracks sorted into advisories and initial times
- property duration: Timedelta
return: duration of current track
- property unfiltered_data: DataFrame
return: data frame containing all track data for the specified storm and file deck; NOTE: datetimes for forecasts represent the initial datetime of the forecast, not the datetime of the record