diff --git a/cht_cyclones/cyclone_track_database.py b/cht_cyclones/cyclone_track_database.py index 59a822f..9184d56 100644 --- a/cht_cyclones/cyclone_track_database.py +++ b/cht_cyclones/cyclone_track_database.py @@ -199,6 +199,12 @@ def get_track(self, index): return tc + def list_names(self, index=None): + if index is not None: + return [self.name[i] for i in index] + else: + return self.name + def to_gdf(self, index=None): """ Returns a geopandas dataframe of the tracks. @@ -254,6 +260,8 @@ def filter( year=None, year_min=None, year_max=None, + vmax_min=None, + vmax_max=None, ): """ Filter the database and return the indices of the filtered tracks. @@ -293,6 +301,11 @@ def filter( if not year_max: year_max = 9999 + if not vmax_min: + vmax_min = 0.0 + if not vmax_max: + vmax_max = 9999.0 + # Filter by basin if basin: ibasin = np.array( @@ -311,6 +324,12 @@ def filter( else: iyear = np.arange(0, self.nstorms) + # # Filter by vmax + # if vmax_min and vmax_max: + # ivmax = np.where((self.year >= year_min) & (self.year <= year_max))[0] + # else: + # iyear = np.arange(0, self.nstorms) + # Filter by name if name: iname = np.array(