airbornegeo.directional_velocity#
- directional_velocity(data, *, time_column='unixtime', coordinate_column='easting', groupby_column=None, progressbar=True)[source]#
Calculate one component of velocity, which is the change in coordinate values divided by the change in time between each successive row in the dataframe. For example, if latitude in decimal degrees are provided via column coordinate_column and time in seconds is provided to time_column, this would return the latitudinal component of velocity in degrees per second. This assumes the data have been sorted by time, and that there are not flights which overlap in time. If there are, you can 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. The returned units are based on the units provided by the coordinate_column and time_column.
- Parameters:
data (
DataFrame) – Dataframe containing the data points to calculate the ground speed for, must have columns ‘unixtime’ and ‘relative_distance’time_column (
str) – name of the column containing the time in secondscoordinate_column (
str) – name of the column containing the coordinates to use for calculating velocitygroupby_column (
str|None) – Column name to group by before calculation, by default Noneprogressbar (
bool) – Show progress bar for each group, by default True
- Returns:
The velocity component in units of the provided coordinate and time columns
- Return type:
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]