airbornegeo.interpolate_intersections

airbornegeo.interpolate_intersections#

interpolate_intersections(df, intersections, *, line_column, to_interp, interp_on, method='cubic', extrapolate=False, fill_value=None, window_width=None, progressbar=True)[source]#

_summary_

Parameters:
  • df (DataFrame) – Dataframe containing the data to interpolate

  • intersections (DataFrame) – Dataframe containing the intersection points

  • line_column (str) – Column name containing the line / flight / segment names

  • to_interp (str) – specify which column to interpolate NaNs for

  • interp_on (str) – Decide which column interpolation is based on, such as “distance_along_line”

  • method (str) – Decide between interpolation methods of ‘linear’, ‘nearest’, ‘nearest-up’, ‘zero’, ‘slinear’, ‘quadratic’,’cubic’, ‘previous’, or ‘next’, by default “cubic”

  • window_width (float | None) – window width around each NaN to use for interpolation fitting, by default None

  • progressbar (bool) – Show progress bars for the underlying steps, by default True.

  • extrapolate (bool)

  • fill_value (tuple[float, float] | str | None)

Return type:

tuple[DataFrame, DataFrame]

Returns:

  • pd.DataFrame – the dataframe with new columns ‘is_intersection’ for booleans, ‘intersecting_line’ containing the name of the intersection line rows which are intersections, ‘<to_interp>_interpolation_type’ with string ‘interpolated’ or ‘extrapolated’ describing what interpolation type was used for each row, and column specified with to_interp updated with interpolated values at the intersection rows.

  • pd.DataFrame – the intersection dataframe with new columns ‘dist_along_flight_line’, ‘dist_along_flight_tie’, ‘line1_interpolation_type’, ‘line2_interpolation_type’. Rows where the interpolation failed will be removed.