tobac.feature_detection.field_and_features_over_time#

tobac.feature_detection.field_and_features_over_time(field, features, time_var_name='time', time_padding=None)#

Generator that iterates over time through a paired field dataarray and a features dataframe. time_padding parameter allows a tolerance to be set for matching time stamps in the datarray and dataframe

Parameters:
  • field (xr.DataArray) – The field to iterate over

  • features (pd.DataFrame) – The features dataframe to iterate through

  • time_var_name (str, optional (default: "time")) – The name of the time dimension in field and the time column in features, by default “time”

  • time_padding (datetime.timedelta, optional (default: None)) – The tolerance for matching features at the same time as each time step in the field dataframe, by default None

Yields:

Generator[tuple[int, Union[datetime.datetime, np.datetime64, cftime.datetime], xr.DataArray, pd.DataFrame], None, None] – A generator that returns the iteration index, the time, the slice of field at that time the slice of features with times within the time padding tolerance of the time step

Return type:

Generator[Tuple[int, datetime | datetime64 | cftime.datetime, xarray.DataArray, pandas.DataFrame], None, None]