surface_apps.iso_surfaces package

Submodules

surface_apps.iso_surfaces.driver module

class surface_apps.iso_surfaces.driver.Driver(*args: Any, **kwargs: Any)

Bases: BaseSurfaceDriver

Driver for the detection of iso-surfaces within geoh5py objects.

Parameters:

parameters – Application parameters.

static iso_surface(entity: ObjectBase, data: Data, levels: list, *, resolution: float = 100, max_distance: float = numpy.inf, horizon: Surface | None = None)

Generate 3D iso surface from an entity vertices or centroids and values.

Parameters:
  • entity – Any entity with ‘vertices’ or ‘centroids’ attribute.

  • data – Data objects whose values will be used to create iso-surfaces.

  • levels – List of iso values

  • max_distance – Maximum distance from input data to generate iso surface. Only used for input entities other than BlockModel.

  • resolution – Grid size used to generate the iso surface. Only used for input entities other than BlockModel.

  • horizon – Clipping surface to restrict interpolation from bleeding into the air.

Returns surfaces:

List of surfaces (one per levels) defined by vertices and cell indices. [(vertices, cells)_level_1, …, (vertices, cells)_level_n]

make_surfaces()

Make surface objects from iso-surfaces detected in source data.

surface_apps.iso_surfaces.params module

class surface_apps.iso_surfaces.params.IsoSurfaceDetectionParameters(*args: Any, **kwargs: Any)

Bases: BaseModel

Contour specification parameters.

Parameters:
  • interval_min – Minimum value for contours.

  • interval_max – Maximum value for contours.

  • interval_spacing – Step size for contours.

  • fixed_contours – String defining list of fixed contours.

  • max_distance – Maximum distance for interpolation.

  • resolution – Resolution of underlying grid.

property contours: list[float]

Returns a list of requested contours merging interval and fixed values.

fixed_contour_input_to_list_of_floats()

Parse fixed contour string into list of floats.

fixed_contours: list[float] | None = None
interval_max: float | None = None
interval_min: float | None = None
property intervals: list[float]

Returns arange of requested contour intervals.

max_distance: float = 500.0
resolution: float = 50.0
class surface_apps.iso_surfaces.params.IsoSurfaceParameters(*args: Any, **kwargs: Any)

Bases: Options

Contour parameters for use with contours.driver.

Parameters:
  • contours – Contouring parameters.

  • source – Parameters for the source object and data.

  • output – Output

conda_environment: str = 'surface_apps'
default_ui_json: ClassVar[Path] = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/mirageoscience-surface-apps/envs/release-ga-4.8/lib/python3.12/site-packages/surface_apps-assets/uijson/iso_surfaces.ui.json')
detection: IsoSurfaceDetectionParameters
name: ClassVar[str] = 'iso_surfaces'
out_group: UIJsonGroup | None = None
run_command: ClassVar[str] = 'surface_apps.iso_surface.driver'
source: IsoSurfaceSourceParameters
title: ClassVar[str] = 'IsoSurface Detection'
class surface_apps.iso_surfaces.params.IsoSurfaceSourceParameters(*args: Any, **kwargs: Any)

Bases: BaseModel

Source parameters providing input data to the driver.

Parameters:
  • objects – A Grid2D, Points, Curve or Surface source object.

  • data – Data values to create iso-surfaces from.

  • horizon – Clipping surface to restrict interpolation from bleeding into the air.

data: Data
horizon: Surface | None = None
no_single_layer_grids()

Ensure a grid has more than a single layer in any dimension.

objects: Points | CellObject | GridObject

surface_apps.iso_surfaces.utils module

surface_apps.iso_surfaces.utils.block_model_to_grid(model: geoh5py.objects.BlockModel, values: numpy.ndarray) tuple[list[numpy.ndarray], numpy.ndarray]

Convert block model cell delimiters arrays to centroids based grid.

Parameters:
  • model – BlockModel object.

  • values – Data to be reshaped to grid ordering.

surface_apps.iso_surfaces.utils.entity_to_grid(entity: ObjectBase, data: Data, resolution: float, max_distance: float, horizon: Surface | None = None)

Extracts grid and values from a geoh5py object.

Parameters:
  • entity – geoh5py object with locations data.

  • data – Data to be reshaped or interpolated to grid ordering.

  • max_distance – Maximum distance used in weighted average.

  • horizon – Clipping surface to restrict interpolation from bleeding into the air.

Resolution:

Grid resolution.

Returns:

Tuple of grid and values.

surface_apps.iso_surfaces.utils.extract_iso_surfaces(entity: geoh5py.objects.ObjectBase, grid: list[numpy.ndarray], levels: list[float], values: numpy.ndarray) list[list[numpy.ndarray]]
surface_apps.iso_surfaces.utils.interp_to_grid(entity: ObjectBase, data: Data, resolution: float, max_distance: float, horizon: Surface | None = None) tuple[list[np.ndarray], np.ndarray]

Interpolate values into a regular grid bounding all finite data points.

Parameters:
  • entity – Geoh5py object with locations data.

  • data – Data to be interpolated to grid.

  • resolution – Grid resolution

  • max_distance – Maximum distance used in weighted average.

  • horizon – Clipping surface to restrict interpolation from bleeding into the air.

Returns:

Tuple of grid and nearest neighbor interpolated values. The resulting grid bounds all the points in entity for which the data is not nan.

surface_apps.iso_surfaces.utils.remove_nan(verts: numpy.ndarray, faces: numpy.ndarray) tuple[numpy.ndarray, numpy.ndarray]

Remove all vertices and cells with nan.

Parameters:
  • verts – Vertices array.

  • faces – Faces array.

Returns:

vertices and faces without nans.

Module contents