@@ -1657,7 +1657,7 @@ def define_tc_category_fast(max_sust_wind: np.array, units: str = "kn") -> int:
16571657 return category
16581658
16591659 @classmethod
1660- def from_fast (cls , folder_name : str ):
1660+ def from_FAST (cls , folder_name : str ):
16611661 """Create a new TCTracks object from NetCDF files generated by the FAST model, modifying
16621662 the xr.array structure to ensure compatibility with CLIMADA, and calculating the central
16631663 pressure and radius of maximum wind.
@@ -1708,12 +1708,6 @@ def from_fast(cls, folder_name: str):
17081708 cen_pres = _estimate_pressure (
17091709 np .full (lat .shape , np .nan ), lat , lon , max_sustained_wind_knots
17101710 )
1711- rmw = estimate_rmw (np .full (lat .shape , np .nan ), cen_pres )
1712-
1713- # Define attributes
1714- category = TCTracks .define_tc_category_fast (
1715- max_sustained_wind_knots
1716- )
17171711
17181712 data .append (
17191713 xr .Dataset (
@@ -1724,7 +1718,10 @@ def from_fast(cls, folder_name: str):
17241718 ),
17251719 "max_sustained_wind" : ("time" , track .v_trks .data ),
17261720 "central_pressure" : ("time" , cen_pres ),
1727- "radius_max_wind" : ("time" , rmw ),
1721+ "radius_max_wind" : (
1722+ "time" ,
1723+ estimate_rmw (np .full (lat .shape , np .nan ), cen_pres ),
1724+ ),
17281725 "environmental_pressure" : (
17291726 "time" ,
17301727 np .full (time .shape [0 ], env_pressure ),
@@ -1742,12 +1739,14 @@ def from_fast(cls, folder_name: str):
17421739 attrs = {
17431740 "max_sustained_wind_unit" : "m/s" ,
17441741 "central_pressure_unit" : "hPa" ,
1745- "name" : "storm_%s" % track .n_trk .item (),
1742+ "name" : f "storm_{ track .n_trk .item ()} " ,
17461743 "sid" : track .n_trk .item (),
17471744 "orig_event_flag" : True ,
17481745 "data_provider" : "FAST" ,
17491746 "id_no" : track .n_trk .item (),
1750- "category" : category ,
1747+ "category" : TCTracks .define_tc_category_fast (
1748+ max_sustained_wind_knots
1749+ ),
17511750 },
17521751 )
17531752 )
0 commit comments