airbornegeo.split_at_turns

Contents

airbornegeo.split_at_turns#

split_at_turns(data, *, track_column, distance_column, groupby_column=None, max_turn_rate=0.5, smoothing_distance=10000.0, min_length=None, keep_turns=True)[source]#

Split flights into lines wherever the aircraft turns.

A released survey often gives a whole flight one line number, so an out-and-back flight is a single line that doubles back on itself. Anything defined along the line – a filter, a trend, a levelling correction – then treats the two legs as far apart when on the ground they are side by side. This cuts each flight into the straight runs between its turns.

Unlike split_into_segments, which cuts at an isolated jump in one column, turning is a condition sustained over many points, so it is found from the smoothed turn rate rather than from a single difference. See airbornegeo.turn_rate.

Parameters:
  • data (DataFrame) – Dataframe containing the data points, which must have the columns given by track_column and distance_column.

  • track_column (str) – Name of the column holding the track angle in degrees clockwise from north, for example as calculated by airbornegeo.track.

  • distance_column (str) – Name of the column holding the cumulative along-track distance in metres.

  • groupby_column (str | None) – The existing flight or line column. The first line of each flight keeps its name and later ones extend it, so flight 12 becomes 12, 12_1, 12_2 and so on, by default None

  • max_turn_rate (float) – Degrees per kilometre above which the aircraft counts as turning. Straight survey flight holds well below 0.5, by default 0.5

  • smoothing_distance (float) – Passed to airbornegeo.turn_rate, by default 10e3

  • min_length (float | None) – Runs shorter than this, in metres, are given a line name of NaN, by default None which keeps them all

  • keep_turns (bool) – If True each turn becomes a line of its own, so an out-and-back flight gives an outward leg, a turn, and a return leg. If False the turns are given NaN and only the straight runs are named, by default True

Returns:

The new line name for each row, NaN where a row belongs to no line.

Return type:

Series

See also

airbornegeo.turn_rate

the turn rate this thresholds.

airbornegeo.split_into_segments

split at a gap in time, distance or angle.