airbornegeo.level_to_grid

Contents

airbornegeo.level_to_grid#

level_to_grid(data, *, degree, data_column, grid_column, groupby_column=None)[source]#

Fit a trend to the misfit between the data_column and grid_column values and subtract the fitted trend from the data to level it to the grid values. The grid values can be sampled into the dataframe with ::func`sample_grid`. If groupby_column is provided, the trend will be fit a line-by-line basis in 1D using the column distance_along_line. If groupby_column is not provided, the trend will be fit to the entire survey in 2D using the columns “easting” and “northing”.

Parameters:
  • data (DataFrame) – dataframe with the data and grid values.

  • degree (int) – the degree order to fit to the misfit values.

  • data_column (str) – the column name for the data to fit.

  • grid_column (str) – the column name with the sample grid values.

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

Returns:

The levelled data

Return type:

Series