geost.models.model_dataset.ModelDataset.most_common#

ModelDataset.most_common(return_thickness=False, only_most_common_layer=False) → DataArray | Dataset[source]#

Determine the “most common” value and corresponding thickness in a voxelmodel or a layermodel. In a voxelmodel, this calculates the mode (most frequently occurring value) along the depth (z) dimension for each horizontal location (x, y) in the model. In a layermodel, it identifies the layer with the maximum thickness at each x,y-location and returns the corresponding value and most common layer name.

Parameters:
  • return_thickness (bool, optional) – If True, also return the thickness of the most common value. The default is False. Note that a layermodel that already has a thickness variable will return a duplicate thickness variable if this is set to True.

  • only_most_common_layer (bool, optional) – If True, only return the most common layer and thickness (if return_thickness=True) for layermodels. The default is False. This option is ignored for voxelmodels.

Returns:

  • For a voxelmodel: xarray.DataArray (x, y, data_var) with the most common

value for each x,y-location for each data variable. If return_thickness is True, returns an xarray.Dataset (x, y, data_var) with data variables “most_common” and “thickness”. - For a layermodel: xarray.Dataset (x, y) with a “most_common” variable for each of the data variables and an added “most_common_layer” variable that contains the name of the most common layer at each x,y-location.

Return type:

xr.DataArray | xr.Dataset