@@ -1620,42 +1620,6 @@ def from_netcdf(cls, folder_name):
16201620 data .append (track )
16211621 return cls (data )
16221622
1623- @staticmethod
1624- def define_tc_category_FAST (max_sust_wind : np .array , units : str = "kn" ) -> int :
1625- """Define category of the tropical cyclone according to Saffir-Simpson scale.
1626-
1627- Parameters:
1628- ----------
1629- max_wind : str
1630- Maximal sustained wind speed
1631- units: str
1632- Wind speed units, kn or m/s. Default: kn
1633-
1634- Returns:
1635- -------
1636- category : int
1637- -1: "Tropical Depression",
1638- 0: "Tropical Storm",
1639- 1: "Hurricane Cat. 1",
1640- 2: "Hurricane Cat. 2",
1641- 3: "Hurricane Cat. 3",
1642- 4: "Hurricane Cat. 4",
1643- 5: "Hurricane Cat. 5",
1644- """
1645-
1646- max_sust_wind = max_sust_wind .astype (
1647- float
1648- ) # avoid casting errors if max_sust_wind is int
1649- max_sust_wind *= 1.943844 if units == "m/s" else 1
1650-
1651- max_wind = np .nanmax (max_sust_wind )
1652- category_test = np .full (len (SAFFIR_SIM_CAT ), max_wind ) < np .array (
1653- SAFFIR_SIM_CAT
1654- )
1655- category = np .argmax (category_test ) - 1
1656-
1657- return category
1658-
16591623 @classmethod
16601624 def from_FAST (cls , folder_name : str ):
16611625 """Create a new TCTracks object from NetCDF files generated by the FAST model, modifying
@@ -1707,13 +1671,13 @@ def from_FAST(cls, folder_name: str):
17071671 track .time .data , unit = "s" , origin = reference_time
17081672 ).astype ("datetime64[s]" )
17091673 # Define variables
1710- max_sustained_wind_knots = track .vmax_trks .data * 1.943844
1674+ max_wind_kn = track .vmax_trks .data * 1.943844
17111675 env_pressure = BASIN_ENV_PRESSURE [track .tc_basins .data .item ()]
17121676 cen_pres = _estimate_pressure (
17131677 np .full (lat .shape , np .nan ),
17141678 lat ,
17151679 lon ,
1716- max_sustained_wind_knots ,
1680+ max_wind_kn ,
17171681 )
17181682
17191683 data .append (
@@ -1758,8 +1722,8 @@ def from_FAST(cls, folder_name: str):
17581722 "orig_event_flag" : True ,
17591723 "data_provider" : "FAST" ,
17601724 "id_no" : track .n_trk .item (),
1761- "category" : TCTracks . define_tc_category_FAST (
1762- max_sustained_wind_knots
1725+ "category" : set_category (
1726+ max_wind_kn , wind_unit = "kn" , saffir_scale = None
17631727 ),
17641728 },
17651729 )
0 commit comments