airbornegeo.relative_distance

airbornegeo.relative_distance#

relative_distance(data, *, groupby_column=None, progressbar=True)[source]#

Calculate distance between successive points in a dataframe. This assumes the data have been sorted by time, and that there are not flights which overlap in time. If there are, you must first sort by flight, then by time. For example, if you have columns ‘flight’ and ‘unixtime’, you can accomplish this with data = data.sort_values([“flight”, “unixtime”]). If groupby_column is provided, the dataframe will first be grouped by this.

Parameters:
  • data (DataFrame) – Dataframe containing the data, must have columns ‘easting’ and ‘northing’.

  • groupby_column (str | None) – Column name to group by before calculation, by default None

  • progressbar (bool) – Show progress bar for each group, by default True

Returns:

Returns an array of the relative distances which can be assigned to a new column.

Return type:

ndarray[tuple[Any, ...], dtype[TypeVar(_ScalarT, bound= generic)]]