Subsettingο
Extract Topographyο
- class PVGeo.grids.subset.ExtractTopography(op='underneath', tolerance=0.001, offset=0.0, invert=False, remove=False)[source]ο
Bases:
FilterBase
This filter takes two inputs: any mesh dataset and a set of points for a topography source. This will add a boolean data array to the cell data of the input grid on whether that cell should be active (under topographic layer). A user can also choose to directly extract the data rather than appending a boolean scalar array via the
remove
argument.- Parameters:
op (str, int, or callable) β The operation as a string key, int index, or callable method
tolerance (float) β buffer around the topography surface to include as part of the decision boundary
offset (float) β static value to shift the reference topography surface
ivert (bool) β optional to invert the extraction.
remove (bool) β Optional parameter to apply a thresholding filter and return a
vtkUnstructuredGrid
object with only the extracted cells. Theremove
option is only available in Python environments (not available in ParaView). Theremove
flag must be set at the time of instantiation of this algorithm. This does not actually update the algorithmβs output data object but applies a PyVista threshold filter to pass a new data object after callingapply
.
Note
This currently ignores time varying inputs. We can implement time variance but need to think about how we would like to do that. Should the topography surface be static and the volumetric data have time variance?
- FillInputPortInformation(port, info)[source]ο
This simply makes sure the user selects the correct inputs
- RequestDataObject(request, inInfo, outInfo)[source]ο
Constructs the output data object based on the input data object
- static _intersection(topo_points, data_points, tolerance)[source]ο
Extract cells intersecting the topography surface
- static _query(topo_points, data_points)[source]ο
Queries the data points for their closest point on the topography surface
- static _underneath(topo_points, data_points, tolerance)[source]ο
Extract cells underneath the topography surface
- static get_operation(idx)[source]ο
Gets a extraction operation based on an index in the keys
- Returns:
the operation method
- Return type:
callable
- static get_operation_names()[source]ο
Gets a list of the extraction operation keys
- Returns:
the keys for getting the operations
- Return type:
list(str)
- static get_operations()[source]ο
Returns the extraction operation methods as callable objects in a dictionary
- set_operation(op)[source]ο
Set the type of extraction to perform.
- Parameters:
op (str, int, or callable) β The operation as a string key, int index, or callable method
Note
This can accept a callable method to set a custom operation as long as its signature is
<callable>(self, topo_points, data_points)
and it strictly produces an integer array of zeros and ones.