geost.analysis.combine.add_nearest_voxelmodel_variable#

geost.analysis.combine.add_nearest_voxelmodel_variable(collection: Collection, model: VoxelModel, data_vars: str | list[str], tolerances: tuple[float, float, float] | None = None) Collection[source]#

Add information from a VoxelModel instance as columns to the data of a Collection instance. This checks for each survey in the Collection in which voxel stack the survey is located and adds the relevant data variables of the VoxelModel to the data object of the Collection based on depth.

Note

This function simply assigns the nearest voxel value to each layer or measurement, while add_voxelmodel_variable also updates layer boundaries based on the voxel model.

If the variable name is already present in the columns of the data attribute of the collection, the present column is overwritten. To avoid this, rename the variable before either in collection.data or in the voxelmodel.

Parameters:
  • collection (Collection) – Collection to add the VoxelModel variable to.

  • model (VoxelModel) – VoxelModel instance to add the information from to the Collection instance.

  • data_vars (str | list[str]) – Name(s) of the variable(s) in the VoxelModel to add.

  • tolerances (tuple[float, float, float] | None) – Optional tolerances in x, y and z direction for matching the survey points to the voxel centers. If not given, the x/y/z resolution of the VoxelModel is used as tolerance.

Returns:

Collection instance with the information from the VoxelModel variable added.

Return type:

Collection