Skip to content

Gridded Surface🍋

GriddedSurface 🍋

Bases: GridObject

A GriddedSurface is a XY oriented elevation surface with fixed cell size between its points. The grid points are defined at its corners in the XY plane and the Z-value of the points are not constrained. Gridded surfaces cannot be multi-Z. The cells may not be contiguous and don't have to all be defined.

For instance, a gridded surface can be of shape 5 x 3 x 2 but only have 3 cells defined at [1, 2, 1], [1, 3, 1] and [2, 3, 1].

Grid shape and cell sizes are inferred from the X, Y geometry. The grid is assumed to be cartesian and to have a constant cell size.

Parameters:

Name Type Description Default
name str

object name.

required
xyz Optional[Data]

cell corners of the gridded surface.

None
atol float

absolute tolerance used to automatically calculate the cell dimension. It is the distance tolerance (same unit as xyz) to consider whether the dimensions of all cells can be considered equal. Defaults to 0.001.

0.001

Raises:

Type Description
ValueError
  • Variable cell size is inferred.
  • There is a single cell in one of the axes.

Example

import geolime as geo
import numpy as np
xyz = np.arange(30).reshape(10, 3)
gs = geo.GriddedSurface("MyGS", xyz)

delete_cells(region) 🍋

Delete cells in region.

Parameters:

Name Type Description Default
region str

Region or condition to select cells.

required

downscale(name, discr) 🍋

Downscale the GriddedSurface by a given discretisation.

Parameters:

Name Type Description Default
name str

name of the newly created GriddedSurface.

required
discr Vector

Discretisation of the new GriddedSurface.

required

Returns:

Type Description
GriddedSurface

GriddedSurface object downscaled.

Raises:

Type Description
ValueError
  • discr must be of dimension 2.
  • discr must be composed of integers.

keep_only_cells(region) 🍋

Keep cells in region.

Parameters:

Name Type Description Default
region str

Region or condition to select cells.

required

to_pyvista(elevation=None, properties=None) 🍋

Export GriddedSurface and selected properties to Pyvista PolyData.

Parameters:

Name Type Description Default
elevation Optional[str]

Property to export to Pyvista as elevation data.

None
properties Optional[Union[str, List[str]]]

Property or list of properties to export to Pyvista.

None

Returns:

Type Description
PolyData

PolyData object.


Last update: 2022-01-06