airbornegeo.level_to_grid#
- level_to_grid(data, *, data_column, grid_column, fit_by_column, degree=None, filter_kwargs=None, groupby_column=None)[source]#
Level flight lines based on the misfit between the data_column and grid_column values. The levelling correction is determined from the misfit values, by either fitting a trend with a specified order to the misfits, or by spatially or temporally filtering the misfits. This fitting or filtering use the data in fit_by_column as the independent variable. The levelling correction is the subtracted from the line data. 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 cartesian coordinate columns provided by groupby_column.
- Parameters:
data (
DataFrame) – dataframe with the data and grid values.data_column (
str) – the column name for the data to fit.grid_column (
str) – the column name with the sample grid values.fit_by_column (
str|tuple[str]) – the column(s) to filter or fit a trend against, for example a column called ‘unixtime’ which contains sequentially second values, if filtering temporally, or a column called ‘distance_along_line’ with sequential distance values in meters, if filtering spatially, or if groupby_column is not used, then you must provide two column names to fit a trend / filter in 2D, for each ‘easting’ and ‘northing’.groupby_column (
str|None) – Column name to group by, by default Nonedegree (
int|None) – the degree order to fit to the misfit values.filter_kwargs (
dict[str,Any] |None) – Alternative to degree: keyword arguments forwarded to airbornegeo.filter_line to low-pass filter the misfit values (besides data_column and filter_by_column, which are set for you). Must include filter_width; anything else you don’t provide falls back to filter_line’s own defaults (e.g. filter_shape=”gaussian”, engine=”scipy”).
- Returns:
The levelled data
- Return type: