geolime.operations.grid.geometry_calculations

Classes:

BlockModel(data, metadata)

SortingRank(value)

An enumeration.

StatKind(value)

An enumeration.

Surface(data, mesh, metadata)

Functions:

check_grid_above_surf(bm, surface, …)

Write in a dataframe for each block if above or under a surface

create_mplcontour_from_grid(bm, column[, …])

Creates a matplotlib contour from a bm and a property.

df_xy_to_arr2d(bm[, attribute])

Take x,y,z column of bm to make a 2D array, with attribute as values.

extend_grid_2d(bm, extension)

Extends a regular 2d bm with a given extension.

flatten_grid(bm[, sorting_type])

Flatten a DataFrame that has many rows with same (x,y).

guess_dx_dy(x_array[, y_array, z_array])

Return the dx,dy of a grid guess from the x,y values

vertical_intersection(x, y, surface)

Compute the z coordinates of the vertical intersection between a Trimesh triangulated mesh and a (x,y) coordinates.

geolime.operations.grid.geometry_calculations.check_grid_above_surf(bm: geolime.objects.blockmodel.BlockModel, surface: geolime.objects.surface.Surface, new_column_name: str)

Write in a dataframe for each block if above or under a surface

Parameters
  • bm (Grid2d) – GeoLime 2 dimensions BlockModel object

  • surface (Surface) – GeoLime surface Object

  • new_column_name (str) – Name of the created column, eg : above_surface

Returns

bm – GeoLime 2 dimensions BlockModel object with new column filled with 1 if block is above surface and 0 if under surface

Return type

Grid2d

geolime.operations.grid.geometry_calculations.create_mplcontour_from_grid(bm: geolime.objects.blockmodel.BlockModel, column: str, sorting_type: geolime.enumerator.enumerator.SortingRank = <SortingRank.ASCENDING: 'ASCENDING'>, single_line: int = -1)

Creates a matplotlib contour from a bm and a property. Returns a matplotlib contour with as many contours as the number of values of the property If a number if specified for single_line the contour created will have only one contour corrresponding to a threshold set by the number SortingRank is used to specify how property values are ranked : grade values are ranked in ascending order, but classification values are ranked in descending order (4 is worse, 1 is better)

Parameters
  • bm (Grid2d) – GeoLime 2 dimensions BlockModel object

  • column (str) – Property name used for creating the contour

  • sorting_type (Enum.SortingRank) – Type of how the values are ranked : - SortingRank.ASCENDING : ascending order taken (eg : grade) - SortingRank.DESCENDING : descending order taken (eg : classification)

  • single_line (int, optional) –

Returns

contour – Matplotlib contour

Return type

matplotlib.contour.QuadContourSet