airbornegeo.equivalent_source_levelling

airbornegeo.equivalent_source_levelling#

equivalent_source_levelling(data, *, data_column, distance_column, max_dist, degree, lines_to_level=None, damping=None, depth='default', data_block_size=None, source_block_size=None, max_iterations=1, rms_tolerance=None, rms_percent_change_tolerance=10, rms_percent_increase_tolerance=20, seed=42, plot_levelling_convergence=True, progressbar=True)[source]#

Iteratively levelling lines by comparing the line to the forward calculated effect of equivalent sources which have been fitted to nearby data from other lines. The difference between the prediction and the observed data gives a misfit, which a trend is then fit to, creating the levelling correction, which is subsequently added to the line. Randomly iterate through all the lines, creating new equivalent source models and calculating levelling corrections for each line. Then repeat this entire process several times, until one of several stopping criteria are met.

Parameters:
  • data (DataFrame) – The dataframe containing columns ‘easting’, ‘northing’, ‘height’, ‘line’, ‘distance_along_line’, and the data, specified by parameter data_column.

  • data_column (str) – The name of the column containing the data values to fit equivalent sources to and level, typically gravity or magnetics.

  • distance_column (str) – The column containing the distance along the line in meters.

  • max_dist (float) – For each line to be levelled, only fit equivalent sources using data within this distance to the line, excluding the line data itself. This should be large enough to include at least 1 adjacent flight line.

  • degree (int) – The degree order of the polynomial trend to fit the misfit between the data_column and the predicted values from the equivalent sources. 0 gives a DC-shift, 1 additionally allows a tilt, 2 additional allows a curve, etc.

  • lines_to_level (list[float] | None) – Which lines to level, by default will level all lines.

  • damping (float | None) – The damping regularization to use when fitting the equivalent sources, by default None

  • depth (str | float) – The source depths for the equivalent sources, by default “default”, which uses 4.5 times the median distance between first neighboring sources.

  • data_block_size (float | None) – The block size for reducing the number of data points used in fitting the equivalent sources, by default None. If given, data will be block reduced along individual lines.

  • source_block_size (float | None) – The block size for placing the equivalent sources, by default None which places 1 source beneath each (blocked) datapoint. If given, will instead place 1 source in each window of line data with a width of the block size.

  • max_iterations (int) – End the iterations after this value, by default 1

  • rms_tolerance (float | None) – End the iteration once the levelling correction RMS is less than this value, by default None

  • rms_percent_change_tolerance (float) – End the iterations if the percentage change of levelling correction RMS over 2 consecutive iterations is less the than this percentage. This helps stop the iterations once improvement has plateaued, by default 10.

  • rms_percent_increase_tolerance (float) – End the iterations if the levelling correction RMS of the current iterations is more than this percent greater then the minimum RMS of past iterations. This helps stop run-away iterations which keep getting worse, by default 20

  • seed (int) – Seed supplied to the random number generator for shuffling the lines so they are iterated over in a random order, by default 42

  • plot_levelling_convergence (bool) – Plot the convergence of levelling correction RMS value, by default True

  • progressbar (bool) – Show progress bars for both iterations and levelling of lines, by default True

Returns:

The levelled data column, which can be assigned back to the original dataframe.

Return type:

Series