Point/Line Setsο
Add Cell Connectivity to Pointsο
- class PVGeo.filters.xyz.AddCellConnToPoints(**kwargs)[source]ο
Bases:
FilterBase
This filter will add linear cell connectivity between scattered points. You have the option to add
VTK_Line
orVTK_PolyLine
connectivity.VTK_Line
connectivity makes a straight line between the points in order (either in the order by index or using a nearest neighbor calculation). TheVTK_PolyLine
adds a poly line connectivity between all points as one spline (either in the order by index or using a nearest neighbor calculation). Type map is specified in vtkCellType.h.Cell Connectivity Types:
4: Poly Line
3: Line
- set_cell_type(cell_type)[source]ο
Set the cell typ by the integer id as specified in vtkCellType.h
Append Cell Centersο
- class PVGeo.filters.xyz.AppendCellCenters(**kwargs)[source]ο
Bases:
FilterPreserveTypeBase
Build Surface From Pointsο
- class PVGeo.filters.xyz.BuildSurfaceFromPoints(**kwargs)[source]ο
Bases:
FilterBase
From the sorted x, y, and z station locations in the input PolyData, create a surface to project down from the line of those points. Use the Z cells to control the size of the mesh surface
- static create_surface(points, z_range)[source]ο
From the sorted x, y, and z station locations, create a surface to display a seismic recording/migration on in space. The result is defined in the X,Y,Z-z_range 3D space.
The z_range should be treated as relative coordinates to the values given on the third column of the points array. If you want the values in the z_range to be treated as the absolute coordinates, simply do not pass any Z values in the points array - if points is N by 2, then the values in z_range will be inferred as absolute.
- Parameters:
points (np.ndarray) β array-like of the station x and y locations
z_range ((npts by 2-3)) β The linear space of the z
location. (dimension. This will be filled out for every station) β
- Returns:
pyvista.UnstructuredGrid
Convert XYZ Unitsο
- class PVGeo.filters.xyz.ConvertUnits(conversion='meter_to_feet', **kwargs)[source]ο
Bases:
FilterPreserveTypeBase
Convert points in an input data object from meters to feet or vice versa. This simply uses a
vtkTransformFilter
and scales input data object with common conversions.
Extract Cell Centersο
- class PVGeo.filters.xyz.ExtractCellCenters(**kwargs)[source]ο
Bases:
FilterBase
Extract Pointsο
- class PVGeo.filters.xyz.ExtractPoints[source]ο
Bases:
FilterBase
Extracts XYZ coordinates and point/cell data from an input
vtkDataSet
Iterate Over Pointsο
- class PVGeo.filters.xyz.IterateOverPoints(dt=1.0)[source]ο
Bases:
FilterBase
Iterate over points in a time varying manner.
Lat Lon To UTMο
- class PVGeo.filters.xyz.LonLatToUTM(**kwargs)[source]ο
Bases:
FilterPreserveTypeBase
Converts Points from Lon Lat to UTM
- __convert_2d(lon, lat, elev)ο
Converts 2D Lon Lat coords to 2D XY UTM points
Points to Tubeο
- class PVGeo.filters.xyz.PointsToTube(num_sides=20, radius=10.0, capping=False, **kwargs)[source]ο
Bases:
AddCellConnToPoints
Takes points from a vtkPolyData object and constructs a line of those points then builds a polygonal tube around that line with some specified radius and number of sides.
Rotate Pointsο
- class PVGeo.filters.xyz.RotatePoints(angle=45.0, origin=None, use_corner=True)[source]ο
Bases:
FilterBase
Rotates XYZ coordinates in vtkPolyData around an origin at a given angle on the XY plane.
Rotation Toolο
- class PVGeo.filters.xyz.RotationTool(decimals=6)[source]ο
Bases:
object
A class that holds a set of methods/tools for performing and estimating coordinate rotations.
- _converge_angle(pt1, pt2)[source]ο
Internal use only: pts should only be a two neighboring points.
- static _get_rotation_matrix(theta)[source]ο
Internal helper to generate a rotation matrix given a rotation angle
- estimate_and_rotate(x, y, z)[source]ο
A method to estimate the rotation of a set of points and correct that rotation on the XY plane
- static rotate_around(pts, theta, origin)[source]ο
Rotate points around an origins given an angle on the XY plane
- static rotation_matrix(vector_orig, vector_fin)[source]ο
Calculate the rotation matrix required to rotate from one vector to another. For the rotation of one vector to another, there are an infinite series of rotation matrices possible. Due to axial symmetry, the rotation axis can be any vector lying in the symmetry plane between the two vectors. Hence the axis-angle convention will be used to construct the matrix with the rotation axis defined as the cross product of the two vectors. The rotation angle is the arccosine of the dot product of the two unit vectors. Given a unit vector parallel to the rotation axis, w = [x, y, z] and the rotation angle a, the rotation matrix R is:
| 1 + (1-cos(a))*(x*x-1) -z*sin(a)+(1-cos(a))*x*y y*sin(a)+(1-cos(a))*x*z | R = | z*sin(a)+(1-cos(a))*x*y 1 + (1-cos(a))*(y*y-1) -x*sin(a)+(1-cos(a))*y*z | | -y*sin(a)+(1-cos(a))*x*z x*sin(a)+(1-cos(a))*y*z 1 + (1-cos(a))*(z*z-1) |
- Parameters:
vector_orig (umpy array, len 3) β The unrotated vector defined in the reference frame.
vector_fin (numpy array, len 3) β The rotated vector defined in the reference frame.
Note
This code was adopted from printipi under the MIT license.