airbornegeo.filter1d

Contents

airbornegeo.filter1d#

filter1d(data, *, filter_type, data_column, filter_by_column, groupby_column=None, pad_width_percentage=10, pad_mode='reflect', **kwargs)[source]#

Apply a 1D filter to a column of a pandas DataFrame along values of another column. The filter_by_column would typically be either distance along track for a spatial filter, or a time column, for a temporal filter. The dataframe can be grouped by the groupby_column before applying the filter. This column could contain flight names, or lines names. The type of filter is supplied by filter_type, which uses the GMT string format for filters. For example, if filter_by_column is “distance_along_line” in meters, and filter_type is “g1000+l”, then this would give a 1000 m low pass gaussian filter. If filter_by_column is “time” in seconds, then the filter width would be 1000 seconds. Ends of lines are automatically padded to avoid edge effects.

Parameters:
  • data (DataFrame) – Dataframe containing the data points to filter.

  • filter_type (str) – A string with format “<type><width>+h” where type is GMT filter type, width is the filter width in same units as filter_by_column, and optional +h switches from low-pass to high-pass filter; e.g. “g10+h” is a 10m high-pass Gaussian filter.

  • data_column (str) – The data to filter.

  • filter_by_column (str) – The independent variable to filter against, typically either a time or distance along track values.

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

  • pad_width_percentage (float) – The width of the pad to add before and after the data in percentage of the range of values provided by filter_by_column, by default 10.

  • pad_mode (str) – The mode to use for padding, by default is “reflect”.

  • kwargs (Any) – Keyword arguments to pass to np.pad, such as stat_length and constant_values.

Returns:

The filtered data values

Return type:

GeoDataFrame | DataFrame