ModelDataset#

This is the GeoST extension for xarray.Dataset. Available after importing geost. For example:

import numpy as np
import xarray as xr

import geost

# Create example model dataset with 3D data variable
ds = xr.Dataset(
    data_vars={"value": (("y", "x", "z"), np.random.rand(3, 3, 4))},
    coords={"y": [2, 1, 0], "x": [0, 1, 2], "z": [0, 1, 2, 3]},
)
ds.gst
# Output:
# <geost.models.model_dataset.ModelDataset at 0x7f8c4e4c0d30>

Analysis#

ModelDataset.get_thickness(condition)

Calculate the thickness where a voxelmodel or layermodel meets a specified condition.

ModelDataset.get_top_bottom(condition)

Derive the top and bottom depths at each x,y-location of a specified condition from a voxelmodel or layermodel.

ModelDataset.most_common([return_thickness, ...])

Determine the "most common" value and corresponding thickness in a voxelmodel or a layermodel.

Coordinate Reference System#

ModelDataset.write_crs(crs[, inplace])

Write the coordinate reference system (CRS) to the model.

Export#

ModelDataset.to_collection()

Create a Collection from the model data.

ModelDataset.to_geopackage_3d(filepath)

Write data to geopackage file containing a layer "locations" with point geometries and a layer "3dlines" with 3D line geometries.

ModelDataset.to_pyvista_grid([data_vars, ...])

Convert the model to a PyVista grid.

General#

ModelDataset.bounds()

Determine the bounding box of the model.

ModelDataset.resolution([meters])

Determine the resolution of the model.

ModelDataset.vertical_bounds()

Determine the vertical bounds (depth min, depth max) of the model.

Selection#

ModelDataset.slice_depth_interval([upper, ...])

Slice a specified depth interval from a voxelmodel or layermodel between upper and lower bounds.

ModelDataset.slice_xy(xmin, ymin, xmax, ymax)

Slice the model in the x and y dimensions.

Spatial#

ModelDataset.mask_geometries(geometries[, ...])

Mask 'x','y'-locations that overlap with geometries (points, lines, polygons).

ModelDataset.select_points(points[, crs, ...])

Select model data at specified point locations.

ModelDataset.select_along_lines(lines[, ...])

Select model data at specified distances along given line geometries.

ModelDataset.select_within_bbox(xmin, ymin, ...)

Select data within a specified bounding box (xmin, ymin, xmax, ymax).

Attributes#

ModelDataset.bottom

xarray.DataArray with the depths of the bottom of each layer in a layermodel.

ModelDataset.crs

The Coordinate Reference System (CRS) represented as a pyproj.CRS object.

ModelDataset.model_type

The type of the model as a ModelType enum member.

ModelDataset.ndims

The number of dimensions in the Dataset/DataArray

ModelDataset.shape

The shape of the model as a tuple of integers with the size of each dimension.

ModelDataset.surface_level

xarray.DataArray with the surface level elevation of the model.

ModelDataset.top

xarray.DataArray with the depths of the top of each layer in a layermodel.

ModelDataset.x

The x coordinates of the model as an xarray.DataArray.

ModelDataset.x_dim

The name of the x dimension in the Dataset/DataArray

ModelDataset.y

The y coordinates of the model as an xarray.DataArray.

ModelDataset.y_dim

The name of the y dimension in the Dataset/DataArray

ModelDataset.z

The coordinates of the model's vertical dimension as an xarray.DataArray.

ModelDataset.z_dim

The name of the z dimension in the Dataset/DataArray