geost.analysis.layers.get_layer_top#

geost.analysis.layers.get_layer_top(data: DataFrame, column: str, value: int | float | str | list[str] | slice, min_thickness: float = None, min_fraction: float = None) Series[source]#

Find the top depth in individual survey ids where a column in a Pandas DataFrame contains specified search value or values, or falls within a specified range.

Parameters:
  • data (pd.DataFrame) – Pandas DataFrame containing the data. The DataFrame must contain columns specifying depth intervals, such as “top” and “bottom” or “depth” and “thickness”. See GeostFrame.has_depth_columns for more information.

  • column (str) – Name of the column to search for the specified value or values.

  • value (int | float | str | list[str] | slice) – Value or values to search for in the specified column. If a slice is provided, the function will search for values within the specified range.

  • min_thickness (float, optional) – Minimum thickness of the layer to consider. Layers thinner than this value will be ignored. The thickness of a layer is calculated as the difference uppermost top and the lowermost bottom of consecutive elements that meet the value criteria. If None, no minimum thickness is applied which returns the first encountered layer.

  • min_fraction (float, optional) – Whether or not to allow for disturbing layers: layers that do not meet the value criteria in between. The minimum fraction is the minimal fraction of the ‘min_thickness’ that must meet the value criteria. If None, the entire layer must meet the criteria. Note that ‘min_fraction’ is only applied when ‘min_thickness’ is specified.

Returns:

Series containing the top depth of the layers that meet the specified criteria for each survey id as the index.

Return type:

pd.Series

Raises:

ValueError

  • If the input DataFrame does not contain columns specifying depth intervals - If min_thickness is below zero - If min_fraction is not between 0 and 1