tobac.utils.general.transform_feature_points#

tobac.utils.general.transform_feature_points(features, new_dataset, latitude_name=None, longitude_name=None, altitude_name=None, max_time_away=None, max_space_away=None, max_vspace_away=None, warn_dropped_features=True)#

Function to transform input feature dataset horizontal grid points to a different grid. The typical use case for this function is to transform detected features to perform segmentation on a different grid.

The existing feature dataset must have some latitude/longitude coordinates associated with each feature, and the new_dataset must have latitude/longitude available with the same name. Note that due to xarray/iris incompatibilities, we suggest that the input coordinates match the standard_name from Iris.

Parameters:
  • features (pd.DataFrame) – Input feature dataframe

  • new_dataset (iris.cube.Cube or xarray) – The dataset to transform the

  • latitude_name (str) – The name of the latitude coordinate. If None, tries to auto-detect.

  • longitude_name (str) – The name of the longitude coordinate. If None, tries to auto-detect.

  • altitude_name (str) – The name of the altitude coordinate. If None, tries to auto-detect.

  • max_time_away (datetime.timedelta) – The maximum time delta to associate feature points away from.

  • max_space_away (float) – The maximum horizontal distance (in meters) to transform features to.

  • max_vspace_away (float) – The maximum vertical distance (in meters) to transform features to.

  • warn_dropped_features (bool) – Whether or not to print a warning message if one of the max_* options is going to result in features that are dropped.

Returns:

transformed_features – A new feature dataframe, with the coordinates transformed to the new grid, suitable for use in segmentation

Return type:

pd.DataFrame