GXTIN class¶
-
class
GXTIN
(handle=0)[source]¶ GXTIN class.
The
GXTIN
class calculates the Delaunay triangulation of the positions in a database. This is the “best” set of triangles that can be formed from irregularly distributed points. The serializedGXTIN
files can be used for gridding using the Tin-based Nearest Neighbour Algorithm, or for plotting the Delaunay triangles or Voronoi cells to a map.-
copy
(source)[source]¶ Copy
GXTIN
New in version 5.0.
License: Geosoft End-User License
-
classmethod
create
(vv_x, vv_y, vv_z)[source]¶ This method creates a
GXTIN
object.- Parameters
- Returns
GXTIN
Object- Return type
New in version 5.0.
License: Geosoft End-User License
Note: CreateTIN does the
GXTIN
calculation. The Z values are not required, and a 0-lengthGXVV
can be used to indicate the values are not to be used.
-
classmethod
create_s
(bf)[source]¶ Create
GXTIN
from a serialized sourceNew in version 5.0.
License: Geosoft End-User License
-
classmethod
export_xml
(tin, crc, file)[source]¶ Export a
GXTIN
object as XML- Parameters
New in version 6.0.1.
License: Geosoft End-User License
-
get_convex_hull
(ply)[source]¶ Get the convex hull of the
GXTIN
.New in version 5.0.
License: Geosoft End-User License
Note: The convex hull is the outside boundary of the triangulated region.
-
get_ipj
(ipj)[source]¶ Get the projection.
New in version 5.0.3.
License: Geosoft End-User License
-
get_joins
(vv_joins, vv_index, vv_num)[source]¶ Get joins from a
GXTIN
mesh.- Parameters
New in version 5.0.
License: Geosoft End-User License
Note: The join information is returned in three VVs.
All VVs must be type
GS_LONG
.
-
get_mesh
(vv)[source]¶ Get lines from a
GXTIN
mesh.New in version 5.0.
License: Geosoft End-User License
-
get_nodes
(vvx, vvy, vvz)[source]¶ Get the X,Y locations and Z values of the
GXTIN
nodes.New in version 5.0.
License: Geosoft End-User License
Note: If this is not a Z-valued
GXTIN
, the Z values will be dummies.
-
get_triangle
(index, x0, y0, x1, y1, x2, y2)[source]¶ Get the locations of the vertices of a specific triangle
- Parameters
New in version 5.0.
License: Geosoft End-User License
-
get_triangles
(tri_vv_pt1, tri_vv_pt2, tri_vv_pt3)[source]¶ Get the triangle nodes.
- Parameters
New in version 8.4.
License: Geosoft End-User License
-
get_voronoi_edges
(vv)[source]¶ Get line segments defining Voronoi cells.
New in version 5.0.
License: Geosoft End-User License
-
interp_vv
(vvx, vvy, vvz)[source]¶ Interp TINned values using the natural neighbour method.
- Parameters
New in version 5.0.
License: Geosoft End-User License
Note: The
GXTIN
have been created using max length =rDUMMY
to ensure that theGXTIN
has a convex hull (otherwise the routine that locates the triangle for a given location may fail). TheGXTIN
must also have been created using the Z values. Values located outside the convex hull are set torDUMMY
. The method is based on the following paper:Sambridge, M., Braun, J., and McQueen, H., 1995, Geophysical parameterization and interpolation of irregular data using natural neighbours: Geophysical Journal International, 122 p. 837-857.
-
is_null
()[source]¶ Check if this is a null (undefined) instance
- Returns
True if this is a null (undefined) instance, False otherwise.
- Return type
bool
-
is_z_valued
()[source]¶ Does the
GXTIN
contain Z values with each X,Y?- Returns
Returns 1 if Z values are defined in the
GXTIN
- Return type
int
New in version 5.0.
License: Geosoft End-User License
-
linear_interp_vv
(vvx, vvy, vvz)[source]¶ Interp TINned values using the linear interpolation
- Parameters
New in version 5.1.4.
License: Geosoft End-User License
Note: The
GXTIN
have been created using max length =rDUMMY
to ensure that theGXTIN
has a convex hull (otherwise the routine that locates the triangle for a given location may fail). TheGXTIN
must also have been created using the Z values. Values located outside the convex hull are set torDUMMY
.The values are set assuming that each
GXTIN
triangle defines a plane.
-
locate_triangle
(t, x, y)[source]¶ Get the index of the triangle containing X, Y.
- Parameters
t (int) – Seed triangle (can be iDummy or <0)
x (float) – Target X location
y (float) – Target Y location
- Returns
The index of the triangle containing X, Y.
- Return type
int
New in version 5.0.
License: Geosoft End-User License
Note: Index returned begins at 0, but could be negative.
-1: If X,Y is not contained in a triangle (or triangle not found)
- -2: If the location is on an edge
This is for “fall-back” purposes only.
Frequently edge positions are located as being part of a triangle, so do not rely on this result to determine if a node position is on an edge.
- -3: If the location is a vertex.
This is for “fall-back” purposes only in the code. Normal operation is to include a node position inside a triangle, so do not rely on this result to determine if a node position is input.
-
nearest_vv
(vvx, vvy, vvz)[source]¶ Interp TINned values using the nearest neighbour.
- Parameters
New in version 6.0.
License: Geosoft End-User License
Note: The
GXTIN
have been created using max length =rDUMMY
to ensure that theGXTIN
has a convex hull (otherwise the routine that locates the triangle for a given location may fail). TheGXTIN
must also have been created using the Z values. Values located outside the convex hull are set torDUMMY
.Within each voronoi triangle, the Z value of node closest to the input X,Y location is returned.
-
nodes
()[source]¶ Returns the number of nodes in the
GXTIN
- Returns
The number of nodes in the
GXTIN
- Return type
int
New in version 5.0.
License: Geosoft End-User License
-
range_xy
(x_min, y_min, x_max, y_max)[source]¶ Find the range in X and Y of the TINned region.
- Parameters
New in version 5.0.
License: Geosoft End-User License
Note: The TINned range is the range of X and Y covered by the
GXTIN
triangles. It can thus be less than the full X and Y range of the nodes themselves, if a full convex hull is not calculated.
-
serial
(bf)[source]¶ Serialize
GXTIN
New in version 5.0.
License: Geosoft End-User License
-
set_ipj
(ipj)[source]¶ Set the projection.
New in version 5.0.3.
License: Geosoft End-User License
-
triangles
()[source]¶ Returns the number of triangles in the
GXTIN
.- Returns
The number of triangles in the
GXTIN
- Return type
int
New in version 5.0.
License: Geosoft End-User License
-