RectilinearMesh3D
digraph inheritanceb5cabbf6a5 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "Mesh" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Abstract Base Class"]; "myObject" -> "Mesh" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RectilinearMesh2D" [URL="RectilinearMesh2D.html#geobipy.src.classes.mesh.RectilinearMesh2D.RectilinearMesh2D",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Class defining a 2D rectilinear mesh with cell centres and edges."]; "Mesh" -> "RectilinearMesh2D" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RectilinearMesh3D" [URL="#geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Class defining a 3D rectilinear mesh with cell centres and edges."]; "RectilinearMesh2D" -> "RectilinearMesh3D" [arrowsize=0.5,style="setlinewidth(0.5)"]; "myObject" [URL="../core/myObject.html#geobipy.src.classes.core.myObject.myObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ABC" -> "myObject" [arrowsize=0.5,style="setlinewidth(0.5)"]; }@RectilinearMesh2D_Class Module describing a 2D Rectilinear Mesh class with x and y axes specified
- class geobipy.src.classes.mesh.RectilinearMesh3D.RectilinearMesh3D(x=None, y=None, z=None, **kwargs)
Class defining a 3D rectilinear mesh with cell centres and edges.
Contains a simple mesh with cell edges, widths, and centre locations. There are two ways of instantiating the RectilinearMesh2D. The first is by specifying the x and y cell centres or edges. In this case, the abscissa is the standard x axis, and y is the ordinate. The z co-ordinates are None. The second is by specifyin the x, y, and z cell centres or edges. In this case, The mesh is a 2D plane with the ordinate parallel to z, and the “horizontal” locations have co-ordinates (x, y). This allows you to, for example, create a vertical 2D mesh that is not parallel to either the x or y axis, like a typical line of data. If x, y, and z are specified, plots can be made against distance which calculated cumulatively between points.
RectilinearMesh2D([x_centres or x_edges], [y_centres or y_edges], [z_centres or z_edges])
- Parameters:
x_centres (geobipy.StatArray, optional) – The locations of the centre of each cell in the “x” direction. Only x_centres or x_edges can be given.
x_edges (geobipy.StatArray, optional) – The locations of the edges of each cell, including the outermost edges, in the “x” direction. Only x_centres or x_edges can be given.
y_centres (geobipy.StatArray, optional) – The locations of the centre of each cell in the “y” direction. Only y_centres or y_edges can be given.
y_edges (geobipy.StatArray, optional) – The locations of the edges of each cell, including the outermost edges, in the “y” direction. Only y_centres or y_edges can be given.
z_centres (geobipy.StatArray, optional) – The locations of the centre of each cell in the “z” direction. Only z_centres or z_edges can be given.
z_edges (geobipy.StatArray, optional) – The locations of the edges of each cell, including the outermost edges, in the “z” direction. Only z_centres or z_edges can be given.
relative_toCentres (geobipy.StatArray, optional) – The relative_to of each point at the x, y locations. Only relative_toCentres or relative_toEdges can be given, not both. Has shape (y.nCells, x.nCells).
relative_toEdges (geobipy.StatArray, optional) – The relative_to of each point at the x, y locations of the edges of each cell, including the outermost edges. Only relative_toCentres or relative_toEdges can be given, not both. Has shape (y.nEdges, x.nEdges).
[x (float, optional) – See geobipy.RectilinearMesh1D for log description.
y (float, optional) – See geobipy.RectilinearMesh1D for log description.
z]log ('e' or float, optional) – See geobipy.RectilinearMesh1D for log description.
[x – See geobipy.RectilinearMesh1D for relative_to description.
y – See geobipy.RectilinearMesh1D for relative_to description.
z]relative_to (float, optional) – See geobipy.RectilinearMesh1D for relative_to description.
- Returns:
out – The 2D mesh.
- Return type:
- cellIndices(x, y, z, clip=False, trim=False)
Return the cell indices in x and z for two floats.
- Parameters:
x (scalar or array_like) – x location
y (scalar or array_like) – y location (or z location if instantiated with 3 co-ordinates)
clip (bool) – A negative index which would normally wrap will clip to 0 instead.
trim (bool) – Do not include out of axis indices. Negates clip, since they wont be included in the output.
- Returns:
out – indices for the locations along [axis0, axis1]
- Return type:
ints
- centres(axis)
Ravelled cell centres
- Returns:
out – ravelled cell centre locations.
- Return type:
array_like
- createHdf(parent, name, withPosterior=True, add_axis=None, fillvalue=None, upcast=None)
Create the hdf group metadata in file parent: HDF object to create a group inside myName: Name of the group
- edges(axis)
Gets the cell edges in the given dimension
- classmethod fromHdf(grp, index=None, skip_posterior=False)
Reads in the object from a HDF file
- property nCells
The number of cells in the mesh.
- Returns:
out – Number of cells
- Return type:
int
- property nNodes
The number of nodes in the mesh.
- Returns:
out – Number of nodes
- Return type:
int
- plot_grid()
Plot the mesh grid lines.
- Parameters:
xAxis (str) – If xAxis is ‘x’, the horizontal axis uses self.x If xAxis is ‘y’, the horizontal axis uses self.y If xAxis is ‘r’, the horizontal axis uses sqrt(self.x^2 + self.y^2)
- pyvista_mesh(**kwargs)
Creates a pyvista plotting object linked to VTK.
Use mesh.plot(show_edges=True, show_grid=True) to plot the mesh.
- ravelIndices(indices, order='C')
Return a global index into a 1D array given the two cell indices in x and z.
- Parameters:
indices (array_like) – A tuple of integer arrays, one array for each dimension.
- Returns:
out – Global index.
- Return type:
int
- property shape
The dimensions of the mesh
- Returns:
out – Array of integers
- Return type:
array_like
- property summary
Display a summary of the 3D Point Cloud
- unravelIndex(index, order='C')
Return local indices given a global one.
- Parameters:
indices (array_like) – An integer array whose elements are indices into the flattened version of an array.
- Returns:
unraveled_coords – Each array in the tuple has the same shape as the self.shape.
- Return type:
tuple of ndarray
- writeHdf(parent, name, withPosterior=True, index=None)
Write the StatArray to an HDF object parent: Upper hdf file or group myName: object hdf name. Assumes createHdf has already been called create: optionally create the data set as well before writing
- xRange()
Get the range of x
- Returns:
out – The range of x
- Return type:
numpy.float64
- property x_centres
Creates an array suitable for plt.pcolormesh for the abscissa.
- Parameters:
xAxis (str) – If xAxis is ‘x’, the horizontal xAxis uses self.x If xAxis is ‘y’, the horizontal xAxis uses self.y If xAxis is ‘r’, the horizontal xAxis uses cumulative distance along the line.
- property x_edges
Creates an array suitable for plt.pcolormesh for the ordinate
- property y_centres
Creates an array suitable for plt.pcolormesh for the abscissa.
- Parameters:
xAxis (str) – If xAxis is ‘x’, the horizontal xAxis uses self.x If xAxis is ‘y’, the horizontal xAxis uses self.y If xAxis is ‘r’, the horizontal xAxis uses cumulative distance along the line.
- property y_edges
Creates an array suitable for plt.pcolormesh for the ordinate
- zRange()
Get the range of z
- Returns:
out – The range of z
- Return type:
numpy.float64