GXPGU class

class GXPGU(handle=0)

GXPGU class.

A collection of methods applied to GXPG objects, including fills, trending and 2-D GXFFT operations.

classmethod add_scalar(pg, scalar)

Add a scalar value to a pager

Parameters:
  • pg (GXPG) – Pager
  • scalar (float) – Scalar Value

New in version 7.1.

License: Geosoft End-User License

Note: Only available for FLOAT or DOUBLE pagers

classmethod bool_mask(pg, ref_fil)

Apply reference file boolean mask to pager

Parameters:
  • pg (GXPG) – Pager obj
  • ref_fil (str) – sRefFil - reference file for boolean mask flag.

New in version 5.0.

License: Geosoft End-User License

classmethod correlation_matrix(pg_u, pg_o)

Find the correlations between columns in a matrix

Parameters:
  • pg_u (GXPG) – Input matrix
  • pg_o (GXPG) – Returned correlation matrix

New in version 5.0.

License: Geosoft End-User License

Note: The input matrix is M rows by N columns. The returned matrix is a symmetric N by N matrix whose elements are the normalized dot products of the columns of the input matrix with themselves. The elements take on values from 0 (orthogonal) to 1 (parallel).

classmethod correlation_matrix2(pg_u, corr, pg_o)

Same as correlation_matrix, but select correlation type.

Parameters:

New in version 5.1.8.

License: Geosoft End-User License

classmethod direct_gridding_dat(pg, xo, yo, dx, dy, rot, dat, method)

Direct-gridding method, GXDAT version.

Parameters:
  • pg (GXPG) – Input grid
  • xo (float) – X origin of grid
  • yo (float) – Y origin of grid
  • dx (float) – X cell size
  • dy (float) – Y cell size
  • rot (float) – Rotation angle (degrees CCW).
  • dat (GXDAT) – GXDAT source
  • method (int) – PGU_DIRECTGRID constants

New in version 7.3.

License: Geosoft End-User License

Note: Grid cells take on the specified statistic of the values inside the cell area. Grid cells containing no data values are set to dummy.

classmethod direct_gridding_dat_3d(pg, xo, yo, zo, dx, dy, dz, rot, dat, method)

Direct-gridding method, GXDAT version, 3D.

Parameters:
  • pg (GXPG) – Input 3D GXPG
  • xo (float) – X origin of 3D grid
  • yo (float) – Y origin of 3D grid
  • zo (float) – Z origin of 3D grid
  • dx (float) – X cell size
  • dy (float) – Y cell size
  • dz (float) – Z cell size
  • rot (float) – Rotation angle (degrees CCW, vertical axis only).
  • dat (GXDAT) – 3D GXDAT source
  • method (int) – PGU_DIRECTGRID constants

New in version 8.0.

License: Geosoft End-User License

Note: 3D grid cells take on the specified statistic of the values inside the cell area. Grid cells containing no data values are set to dummy.

classmethod direct_gridding_db(pg, xo, yo, dx, dy, rot, db, x, y, z, method)

Direct-gridding method, GXDB version.

Parameters:
  • pg (GXPG) – Input grid
  • xo (float) – X origin of grid
  • yo (float) – Y origin of grid
  • dx (float) – X cell size
  • dy (float) – Y cell size
  • rot (float) – Rotation angle (degrees CCW).
  • db (GXDB) – Database
  • x (int) – X Channel [READONLY]
  • y (int) – Y Channel [READONLY]
  • z (int) – Data Channel [READONLY]
  • method (int) – PGU_DIRECTGRID constants

New in version 7.3.

License: Geosoft End-User License

Note: Grid cells take on the specified statistic of the values inside the cell area. Grid cells containing no data values are set to dummy.

classmethod direct_gridding_db_3d(pg, xo, yo, zo, dx, dy, dz, rot, db, x, y, z, data, method)

Direct-gridding method, GXDB version, 3D.

Parameters:
  • pg (GXPG) – Input 3D GXPG
  • xo (float) – X origin of 3D grid
  • yo (float) – Y origin of 3D grid
  • zo (float) – Z origin of 3D grid
  • dx (float) – X cell size
  • dy (float) – Y cell size
  • dz (float) – Z cell size
  • rot (float) – Rotation angle (degrees CCW, vertical axis only).
  • db (GXDB) – Database
  • x (int) – X Channel [READONLY]
  • y (int) – Y Channel [READONLY]
  • z (int) – Z Channel [READONLY]
  • data (int) – Data Channel [READONLY]
  • method (int) – PGU_DIRECTGRID constants

New in version 8.0.

License: Geosoft End-User License

Note: 3D grid cells take on the specified statistic of the values inside the cell area. Grid cells containing no data values are set to dummy.

classmethod direct_gridding_vv(pg, xo, yo, dx, dy, rot, v_vx, v_vy, v_vz, method)

Direct-gridding method, GXVV version.

Parameters:
  • pg (GXPG) – Input grid
  • xo (float) – X origin of grid
  • yo (float) – Y origin of grid
  • dx (float) – X cell size
  • dy (float) – Y cell size
  • rot (float) – Rotation angle (degrees CCW).
  • v_vx (GXVV) – X locations of values
  • v_vy (GXVV) – Y locations of values
  • v_vz (GXVV) – Z values to grid
  • method (int) – PGU_DIRECTGRID constants

New in version 7.3.

License: Geosoft End-User License

Note: Grid cells take on the specified statistic of the values inside the cell area. Grid cells containing no data values are set to dummy.

classmethod dw_gridding_dat(pg, dat, reg)

dw_gridding_dat Inverse-distance weighting gridding method, GXDAT version.

Parameters:

New in version 7.3.

License: Geosoft End-User License

Note: See the notes for dw_gridding_db.

classmethod dw_gridding_dat_3d(pg, dat, reg)

dw_gridding_dat_3d Inverse-distance weighting gridding method, GXDAT version, 3D.

Parameters:

New in version 8.0.

License: Geosoft End-User License

Note: See the notes for dw_gridding_db_3d.

classmethod dw_gridding_db(pg, db, x, y, z, reg)

dw_gridding_db Inverse-distance weighting gridding method, GXDB version.

Parameters:
  • pg (GXPG) – Input grid
  • db (GXDB) – Database
  • x (int) – X Channel [READONLY]
  • y (int) – Y Channel [READONLY]
  • z (int) – Data Channel [READONLY]
  • reg (GXREG) – Parameters (see above)

New in version 7.3.

License: Geosoft End-User License

Note: Grid cells take on the averaged values within a search radius, weighted inversely by distance.

Weighting can be controlled using the power and slope properties;

weighting = 1 / (distance^wtpower + 1/slope) where distance is in units of grid cells (X dimenstion). Default is 0.0,

If the blanking distance is set, all cells whose center point is not within the blanking distance of at least one data point are set to dummy.

GXREG Parameters:

X0, Y0, DX, DY: Grid origin, and cell sizes (required) WT_POWER (default=2), WT_SLOPE (default=1) Weighting function parameters SEARCH_RADIUS: Distance weighting limit (default = 4 * SQRT(DX*DY)) BLANKING_DISTANCE: Dummy values farther from data than this distance. (default = 4 * SQRT(DX*DY)) LOG: Apply log transform to input data before gridding (0:No (default), 1:Yes)? LOG_BASE: One of VV_LOG_BASE_10 (default) or VV_LOG_BASE_E LOG_NEGATIVE: One of VV_LOG_NEGATIVE_NO (default) or VV_LOG_NEGATIVE_YES

classmethod dw_gridding_db_3d(pg, db, x, y, z, data, reg)

dw_gridding_db_3d Inverse-distance weighting gridding method, GXDB version, 3D.

Parameters:
  • pg (GXPG) – Input 3D GXPG
  • db (GXDB) – Database
  • x (int) – X Channel [READONLY]
  • y (int) – Y Channel [READONLY]
  • z (int) – Z Channel [READONLY]
  • data (int) – Data Channel [READONLY]
  • reg (GXREG) – Parameters (see above)

New in version 8.0.

License: Geosoft End-User License

Note: 3D cells take on the averaged values within a search radius, weighted inversely by distance.

Weighting can be controlled using the power and slope properties;

weighting = 1 / (distance^wtpower + 1/slope) where distance is in units of grid cells (X dimenstion). Default is 0.0,

If the blanking distance is set, all cells whose center point is not within the blanking distance of at least one data point are set to dummy.

GXREG Parameters:

X0, Y0, Z0, DX, DY, DZ: Grid origin, and cell sizes (required) WT_POWER (default=2), WT_SLOPE (default=1) Weighting function parameters SEARCH_RADIUS: Distance weighting limit (default = 4 * CUBE_ROOT(DX*DY*DZ)) BLANKING_DISTANCE: Dummy values farther from data than this distance. (default = 4 * CUBE_ROOT(DX*DY*DZ)) LOG: Apply log transform to input data before gridding (0:No (default), 1:Yes)? LOG_BASE: One of VV_LOG_BASE_10 (default) or VV_LOG_BASE_E LOG_NEGATIVE: One of VV_LOG_NEGATIVE_NO (default) or VV_LOG_NEGATIVE_YES

classmethod dw_gridding_vv(pg, vv_x, vv_y, vv_z, reg)

dw_gridding_vv Inverse-distance weighting gridding method, GXVV version.

Parameters:
  • pg (GXPG) – Input grid
  • vv_x (GXVV) – X locations
  • vv_y (GXVV) – Y locations
  • vv_z (GXVV) – Data values to grid
  • reg (GXREG) – Parameters (see above)

New in version 7.3.

License: Geosoft End-User License

Note: See the notes for dw_gridding_db.

classmethod expand(pg_i, pg_o, ex_pcnt, ex_shp, ex_x, ex_y)

Expand a pager by filling the dummies for expanded edges

Parameters:
  • pg_i (GXPG) – Original pager obj
  • pg_o (GXPG) – Expanded pager obj
  • ex_pcnt (float) – % expansion
  • ex_shp (int) – Option 0 - rectangular, 1 - square
  • ex_x (int) – X dimension to expand to (0 for expansion to FFT2D legal dimension)
  • ex_y (int) – Y dimension to expand to (0 for expansion to FFT2D legal dimension)

New in version 5.0.

License: Geosoft End-User License

Note: 3D pagers are expanded in X,Y direction the number of slices(Z) is unchanged .

classmethod fill(pg, fl_roll_wt, fl_roll_base, fl_roll_dist, fl_mxf, fl_mxp, fl_amp_lmt, fl_edge_lmt, fl_edge_wid, fl_npass, ref_fil)

Replace all dummies in a pager by predict values.

Parameters:
  • pg (GXPG) – Pager obj
  • fl_roll_wt (int) – Roll off weighting option: 1 - linear, 2 - square
  • fl_roll_base (float) – dRollBase - the value to roll off to, GS_R8DM for roll off to mean value line by line.
  • fl_roll_dist (int) – lRollDist - (at unit of cell dist.) for roll-off. 0 for no roll of, -1 for the default: 2 times of min. dummy edge dim.
  • fl_mxf (int) – lMxf - max. filter length. -1 for no max. entropy. 0 for the default of MIN(minimum dummy edge dim, 32).
  • fl_mxp (int) – lMxp - max. pred. sample 0 for the default of 2*lMxf.
  • fl_amp_lmt (float) – dAmpLmt - limit (abs. value) amplitudes to this level. Amplitudes are limited starting at half this value. <=0.0 for no amp limit.
  • fl_edge_lmt (float) – dEdgeLmt - limit edge (abs. value) amplitudes to this level. <0.0 for no edge limit.
  • fl_edge_wid (int) – lEdgeWidth - within this dist. (at unit of cell size) for amp. limited. -1 for no edge limit. 0 for the default of minimum dummy edge dim.
  • fl_npass (int) – iNPass - number of time to pass smooth filter
  • ref_fil (str) – sRefFil - reference file for smooth filter flag.

New in version 5.0.

License: Geosoft End-User License

classmethod fill_value(pg, value)

Set all values in a pager to a single value.

Parameters:
  • pg (GXPG) – Pager obj
  • value (float) – Value to set in pager

New in version 5.0.8.

License: Geosoft End-User License

classmethod filt_sym(pg, npass, usefile, file, size, vv)

Apply 5x5, 7x7 or 9X9 symmetric convolution filter to a GXPG.

Parameters:
  • pg (GXPG) – Pager obj
  • npass (int) – Number of time to pass smooth filter
  • usefile (int) – Flag to use filter file
  • file (str) – File for filter values
  • size (int) – Size of filter window, 5/7/9
  • vv (GXVV) – Array of 6/10/15 filter coefficients

New in version 5.1.5.

License: Geosoft End-User License

classmethod filt_sym5(pg, npass, usefile, file, vv)

Apply 5x5 symmetric convolution filter to a GXPG.

Parameters:
  • pg (GXPG) – Pager obj
  • npass (int) – Number of time to pass smooth filter
  • usefile (int) – Flag to use filter file
  • file (str) – File for filter values
  • vv (GXVV) – Array of 6 filter coefficients at position 00, 10, 11, 20, 21, 22. Symmetric filters look like : 22 21 20 21 22 21 11 10 11 21 20 10 00 10 20 21 11 10 11 21 22 21 20 21 22

New in version 5.0.

License: Geosoft End-User License

classmethod grid_peak(grid, nlmt, vv_x, vv_y, vv_z)

Pick grid peaks.

Parameters:
  • grid (str) – Grid file name
  • nlmt (int) – BLAKEY_TEST constants
  • vv_x (GXVV) – X of found peaks
  • vv_y (GXVV) – Y of found peaks
  • vv_z (GXVV) – Z values of found peaks

New in version 5.0.

License: Geosoft End-User License

Note: Blakey test limit defines how grid peaks are to be found. For example, with the BLAKEY_TEST_ONESIDE, a grid point will be picked if its grid value is greater than the value of one or more of its four neighouring points.

classmethod invert_matrix(pg_i, pg_o)

Inverts a square matrix using LU decomp. and back-substitution

Parameters:
  • pg_i (GXPG) – Input matrix
  • pg_o (GXPG) – Output inverted matrix (can be same as input).

New in version 5.0.

License: Geosoft End-User License

Note: This is an “in-place” operation, and set up so that the input and output pagers may be the same handle. (If they are different, the input pager remains unchanged). Pagers and VVs must be type GS_DOUBLE.

is_null()

Check if this is a null (undefined) instance

Returns:True if this is a null (undefined) instance, False otherwise.
Return type:bool
classmethod jacobi(pg_i, vv_d, pg_eigen)

Find eigenvalues, eigenvectors of a real symmetric matrix.

Parameters:
  • pg_i (GXPG) – Input Pager
  • vv_d (GXVV) – Eigenvalues (returned)
  • pg_eigen (GXPG) – Eigenvectors (returned)

New in version 5.0.

License: Geosoft End-User License

Note: The number of rows must equal the number of columns. Eienvalues, vectors are sorted in descending order.

classmethod lu_back_sub(pg_a, vv_i, vv_b, vv_sol)

Solve a linear system using LU decomposition and back-substitution.

Parameters:
  • pg_a (GXPG) – LU decomposition of A
  • vv_i (GXVV) – Permutation vector (type INT)
  • vv_b (GXVV) – Right hand side vector B (input)
  • vv_sol (GXVV) – Solution vector (output)

New in version 5.0.

License: Geosoft End-User License

Note: Solves the system Ax = b for a given b, using the LU decomposition of the matrix a The LU decomposition and the permutation vector are obtained from lu_back_sub. Pagers and VVs must be type GS_DOUBLE except for the permutation vector, which should be INT

classmethod lu_decomp(pg_i, pg_o, vv_perm)

Perform an LU decomposition on a square pager.

Parameters:
  • pg_i (GXPG) – Input
  • pg_o (GXPG) – LU decomposition (may be same pager as input)
  • vv_perm (GXVV) – Permutation vector (type INT)

New in version 5.0.

License: Geosoft End-User License

Note: The L and U matrix are both contained in the returned pager; The “L” matrix is composed of the sub-diagonal elements of the output pager, as well as “1” values on the diagonal. The “U” matrix is composed of the diagonal elements (sub-diagonal elements set to 0). This is an “in-place” operation, and set up so that the input and output pagers may be the same handle. (If they are different, the input pager remains unchanged). The LU decomposition, and the permutation vector are used for lu_back_sub. Pagers must be type GS_DOUBLE and the permutation vector type INT

classmethod matrix_mult(pg_u, transpose_u, pg_v, transpose, pg_uv)

Multiply two pagers as if they were matrices.

Parameters:
  • pg_u (GXPG) – Matrix U
  • transpose_u (int) – TRUE (1) if U should be transposed before multiplication
  • pg_v (GXPG) – Matrix V
  • transpose (int) – TRUE (1) if V should be transposed before multiplication
  • pg_uv (GXPG) – Returned matrix U*V

New in version 5.0.

License: Geosoft End-User License

Note: The matrices must be correctly dimensioned, taking into account whether transposition should occur before multiplication. The input matrices are not altered on output (even if transposition is requested). Assertions if: Matrices are not expected sizes Dummies are treated as 0 values.

classmethod matrix_vector_mult(pg_u, vv_x, vv_o)

Multiply a GXVV by a pager like a matrix*vector multiply.

Parameters:
  • pg_u (GXPG) – Matrix U
  • vv_x (GXVV) – Vector x
  • vv_o (GXVV) – Returned vector U*x

New in version 5.0.

License: Geosoft End-User License

Note: The matrix is input as an M rows (data) by N columns (variables) GXPG. The vector must be of length N. The output GXVV is set to length M. The GXPG and VVs must be type GS_DOUBLE.

Terminates if:

Matrices, GXVV are not expected sizes (taken from U) PGs are not GS_DOUBLE.

Dummies are treated as 0 values.

classmethod maximum_terrain_steepness(pg, annular_size)

Compute the Maximum Steepness of a topography Pager

Parameters:
  • pg (GXPG) – Topography Pager
  • annular_size (int) – Annular Size
Returns:

Maximum Terrain Steepness Computation.

Return type:

float

New in version 7.1.

License: Geosoft End-User License

Note: Calculates forward-looking slopes SX and SY in the X and Y directions using pager locations (ix, iy), (ix+size, iy), (ix, iy+isize) and returns SX*SX + SY*SY. The values in the last “size” rows and columns are not processed. The wrapper was created for testing and development purposes.

classmethod multiply_scalar(pg, scalar)

Multiply a scalar value and a pager

Parameters:
  • pg (GXPG) – Pager
  • scalar (float) – Scalar Value

New in version 7.1.

License: Geosoft End-User License

Note: Only available for FLOAT or DOUBLE pagers

classmethod null()

A null (undefined) instance of GXPGU

Returns:A null GXPGU
Return type:GXPGU
classmethod numeric_to_thematic(pg_i, vv, pg_o)

numeric_to_thematic Set index values in a pager based on a numeric pager with translation GXVV.

Returns Nothing

Parameters:
  • pg_i (GXPG) – Input numeric GXPG
  • vv (GXVV) – Translation GXVV (see notes above)
  • pg_o (GXPG) – Output thematic GXPG

New in version 7.3.

License: Geosoft End-User License

Note: The values in the input data GXVV represent the center-of-range values of unique properties with indices 0 to N-1, where N is the number of items in the input GXVV.

This GXVV is sorted from smallest to largest, and each value in in the input numeric GXPG is tested to see into which range it goes. The closest range value for each item is used, so the half-way point is the dividing point. The top and bottom-most range widths are determined by the “inside half-width” to the nearest range.

The INDEX of the closest range is then inserted into the output GXPG, so it can be used in a thematic voxel (for instance).

classmethod pc_communality(pg_i, vv_c)

Determines principal component communalities.

Parameters:
  • pg_i (GXPG) – Input pager of the principal components
  • vv_c (GXVV) – Returned communality values

New in version 5.0.

License: Geosoft End-User License

Note: Calculate communalities (sums of the squares of the column values in each row) Pagers and VVs must be type GS_DOUBLE.

classmethod pc_loadings(pg_x, pg_loadings)

Compute the principal component loadings from the standardized data.

Parameters:
  • pg_x (GXPG) – Standardized data matrix (M by N)
  • pg_loadings (GXPG) – Principal component loadings (N by N)

New in version 5.0.

License: Geosoft End-User License

Note: Works on columns of the GXPG. Calculates the correlation matrix from the columns of the standardized data, then computes the eigen values and eigenvectors of the correlation matrix. The loadings are the eigenvectors, ordered by descending eigenvalues, scaled by the square root of the eigenvalues. The returned pager must be sized the same as the input pager. Correlations are performed using “PGU_CORR_SIMPLE”, so if you want Pearson correlations, or wish to use a modified correlation matrix, use pc_loadings2 and input the correlation matrix directly.

classmethod pc_loadings2(pg_c, pg_loadings)

Same as PCLoading_PGU, but input correlation matrix.

Parameters:
  • pg_c (GXPG) – Correllation matrix (N by N)
  • pg_loadings (GXPG) – Principal component loadings (N by N)

New in version 5.1.8.

License: Geosoft End-User License

Note: See pc_loadings.

classmethod pc_scores(pg_x, pg_loadings, pg_scores)

Compute the principal component scores from the standardized data.

Parameters:
  • pg_x (GXPG) – Standardized data matrix (M by N)
  • pg_loadings (GXPG) – Principal component loadings (input) (N by L, L<=N)
  • pg_scores (GXPG) – Principal component scores (returned) (M by L, L<=N)

New in version 5.0.

License: Geosoft End-User License

Note: t -1 Forms the product X Ap (Ap Ap), where X is the standardized data matrix, and Ap is the matrix of principal component loadings (see pc_loadings). The loadings must be input, and can be calculated by calling pc_loadings. Pagers and VVs must be type GS_DOUBLE.

classmethod pc_standardize(pg, vv_m, vv_s, dir)

Remove/Replace mean and standard deviation

Parameters:

New in version 5.0.

License: Geosoft End-User License

Note: Works on columns of the GXPG.

classmethod pc_standardize2(pg, vv_mask, vv_m, vv_s, dir)

Remove/Replace mean and standard deviation, subset values.

Parameters:
  • pg (GXPG) – Matrix to standardize
  • vv_mask (GXVV) – Mask GXVV for data selection (forward only)
  • vv_m (GXVV) – Means
  • vv_s (GXVV) – Standard deviations
  • dir (int) – Forward or reverse

New in version 5.1.8.

License: Geosoft End-User License

Note: Like pc_standardize, except that not all the values are included in the calculation of the means and standard deviations. The inclusion is controlled by a mask GXVV, The rows where the mask is dummy are not included in the calculation, but ALL the values are standardized.

classmethod pc_transform(pg, vv_d, vv_f, vv_t, dir)

Transform/De-transform data.

Parameters:

New in version 5.0.

License: Geosoft End-User License

Note: Works on columns of the GXPG. Forward direction: Applies the selected transform to the data. Backward direction: Applies the inverse transform to the data. The detection limits are input with a GXVV. In the forward transform, data values less than the detection limit are set to the limit. The factor limits are input with a GXVV. In the forward transform, data values greater than the maximum values are set to the maximum.

classmethod pc_varimax(pg_i, pg_o)

Perform the Kaiser Varimax transformation on pr. comp. loadings

Parameters:
  • pg_i (GXPG) – Principal component loadings (input) (N by M, M<=N)
  • pg_o (GXPG) – Rotated principal component loadings (returned) (N by L, L<=M)

New in version 5.0.

License: Geosoft End-User License

Note: Rotates the principal components using the Kaiser’s varimax scheme to move move each factor axis to positions so that projections from each variable on the factor axes are either near the extremities or near the origin. Pagers must be type GS_DOUBLE.

classmethod peakedness(grid, pkness, vv_x, vv_y, vv_z)

Find all peaks in peakedneess grid pager

Parameters:
  • grid (str) – Grid file name
  • pkness (int) – Cutoff limit for finding peaks
  • vv_x (GXVV) – X of found peaks
  • vv_y (GXVV) – Y of found peaks
  • vv_z (GXVV) – Z values of found peaks

New in version 5.0.8.

License: Geosoft End-User License

classmethod peakedness_grid(grdi, grdo, radius, percent_lesser)

Create peakedneess grid from input grid.

Parameters:
  • grdi (str) – Input grid file name
  • grdo (str) – Output grid (peakedness) file name
  • radius (int) – Radius
  • percent_lesser (float) – Percent Lesser value (see notes)

New in version 5.0.8.

License: Geosoft End-User License

Note: This function creates a peakedneess grid from input grid. Radius, is the maximum radius at which the value of the parent pixel is compared to the value of surrounding pixels. percent_lesser, is used to indicate the percentage of pixels at each radii smaller than or equal to Radius that must have value lower than the parent pixel in order to call that radius true or equal to 1. Description: For each pixel in the grid a series of radii are evaluated from 1 to Radius. If the percentage of pixels for a given radius is less than percent_lesser the parent pixel receives an additional 1. For examples if the Radius is set to 5 and the percent_lesser is set to 70%. And radius 1 = 90%, radius 2 = 85%, radius 3 = 75%, radius 4 = 70% and radius 5 = 65% then the parent pixel would receive 1+1+1+1+0 = 4. Use: This function is useful in isolating the anomaly peaks in data that has a large value range for anomalies. For example the 1 mV anomaly could quite possibly have the same representation as the 100 mV anomaly using this function.

classmethod ref_file(pg, ref_fil)

Create a reference file (boolean mask flag) from pager.

Parameters:
  • pg (GXPG) – GXPG object
  • ref_fil (str) – Reference file name

New in version 5.0.

License: Geosoft End-User License

Note: A reference file is a binary file with the following format:

The first 8 bytes are the pager dimensions NX and NY as longs. The remaining bits, one bit per pager cell - (NX * NY)/8 bytes are zero where the pager is dummy, and 1 where the pager is defined.

The reference file is used in various operations where it is necessary to mask some output to the original defined cells.

classmethod save_file(pg, xo, yo, dx, dy, rot, tr, ipj, file)

Writes a GXPG to an image file.

Parameters:
  • pg (GXPG) – Input GXPG object
  • xo (float) – X origin
  • yo (float) – Y origin
  • dx (float) – DX
  • dy (float) – DY
  • rot (float) – Rotation angle
  • tr (GXTR) – Trend information or NULL
  • ipj (GXIPJ) – Projection or NULL
  • file (str) – Output file name

New in version 5.0.

License: Geosoft End-User License

Note: The trend object and projection are optional.

classmethod sv_decompose(pg_a, pg_u, vv_w, pg_v)

Do a singular value decomposition on a matrix stored as a GXPG

Parameters:
  • pg_a (GXPG) – Input A matrix, M data (rows), N variables (columns)
  • pg_u (GXPG) – The returned U Matrix
  • vv_w (GXVV) – Returned weights (W)
  • pg_v (GXPG) – Returned V matrix

New in version 5.0.

License: Geosoft End-User License

Note: The matrix is input as an N rows (data) by M columns (variables) GXPG. On return, the matrix is decomposed to A = U * W * Vt. If M<N, then an error will be registered. In this case, augment the “A” GXPG with rows of zero values.

The input matrices must be A[M,N], U[M.N] and V[N,N]. The length of the W GXVV is set by sSVD_PGU to N.

The Pagers must be type GS_DOUBLE.

Terminates if:

U is not M by N. (Taken from size of A) V is not N by N. (Taken from #columns in A). PGs, VV are not GS_DOUBLE
classmethod sv_recompose(pg_u, vv_w, pg_v, min_w, pg_a)

Reconstitute the original matrix from an SVD.

Parameters:
  • pg_u (GXPG) – U matrix
  • vv_w (GXVV) – Weights (W)
  • pg_v (GXPG) – V matrix
  • min_w (float) – Minimum weight to use (Dummy for all)
  • pg_a (GXPG) – A matrix (returned)

New in version 5.0.

License: Geosoft End-User License

Note: The matrix is input as an N rows (data) by M columns (variables) GXPG. On return, the matrix is decomposed to A = U * W * Vt. If M<N, then an error will be registered. In this case, augment the “A” GXPG with rows of zero values. The input matrices must be A[M,N], U[M.N] and V[N,N]. The length of the W GXVV is set by sSVDecompose_PGU to N. The Pagers must be type GS_DOUBLE.

Terminates if:

U is not M by N. (Taken from size of A) V is not N by N. (Taken from #columns in A). PGs, VV are not GS_DOUBLE.

Dummies are treated as 0 values.

classmethod thematic_to_numeric(pg_i, vv, pg_o)

Set numeric values in a pager based on an index pager with translation GXVV.

Returns Nothing

Parameters:

New in version 7.3.

License: Geosoft End-User License

Note: The items in the input data GXVV are inserted into the output GXPG using the indices in the index GXPG.

This function is useful when converting a thematic voxel, which is type GS_LONG and contains indices into its own internal GXTPAT object, and you provide a numeric mapping GXVV, calculated using SetupTranslateToNumericVV_TPAT.

classmethod trend(pg_i, pg_o, tr, tr_opt, tr_pt_bs, xo, yo, dx, dy)

Trend remove or replace back in pager

Parameters:
  • pg_i (GXPG) – Original pager obj
  • pg_o (GXPG) – Trended pager obj
  • tr (GXTR) – Trend obj
  • tr_opt (int) – Option 0 - calculate, 1 - given in GXTR, 2 - replace back from GXTR
  • tr_pt_bs (int) – Trend base on: 0 - all points, 1 - edge points
  • xo (float) – Trend origin rXo,
  • yo (float) – Trend origin rYo,
  • dx (float) – Increment in X direction rDx,
  • dy (float) – Increment in Y direction rDy

New in version 5.0.

License: Geosoft End-User License

BLAKEY_TEST constants

Types of BLAKEY tests

BLAKEY_TEST_ONESIDE

Oneside

gxapi.BLAKEY_TEST_ONESIDE = 1
BLAKEY_TEST_TWOSIDE

Twoside

gxapi.BLAKEY_TEST_TWOSIDE = 2
BLAKEY_TEST_THREESIDE

Threeside

gxapi.BLAKEY_TEST_THREESIDE = 3
BLAKEY_TEST_FOURSIDE

Fourside

gxapi.BLAKEY_TEST_FOURSIDE = 4

PGU_CORR constants

Correlation (must be synchronized with ST2_CORRELATION constants)

PGU_CORR_SIMPLE

Simple correlation

gxapi.PGU_CORR_SIMPLE = 0
PGU_CORR_PEARSON

Pearson’s correlation (normalized to standard deviations)

gxapi.PGU_CORR_PEARSON = 1

PGU_DIRECTGRID constants

Type of statistic to use on the data points in each cell.

PGU_DIRECTGRID_MINIMUM

Select the minimum value found in each cell

gxapi.PGU_DIRECTGRID_MINIMUM = 0
PGU_DIRECTGRID_MAXIMUM

Select the maximum value found in each cell

gxapi.PGU_DIRECTGRID_MAXIMUM = 1
PGU_DIRECTGRID_MEAN

Select the mean of all values found in each cell

gxapi.PGU_DIRECTGRID_MEAN = 2
PGU_DIRECTGRID_ITEMS

The number of valid (non-dummy) items found in each cell

gxapi.PGU_DIRECTGRID_ITEMS = 3

PGU_DIRECTION constants

Direction

PGU_FORWARD

Forward direction: Removes mean and standard deviation, storing the values in the VVs.

gxapi.PGU_FORWARD = 0
PGU_BACKWARD

Backward direction: Applies mean and standard deviation values in the VVs to the data.

gxapi.PGU_BACKWARD = 1

PGU_TRANS constants

Transform methods for the columns

PGU_TRANS_NONE

None

gxapi.PGU_TRANS_NONE = 0
PGU_TRANS_LOG

Log

gxapi.PGU_TRANS_LOG = 1

PGU_INTERP_ORDER constants

Interpolation direction order

PGU_INTERP_ORDER_XYZ

Xyz

gxapi.PGU_INTERP_ORDER_XYZ = 0
PGU_INTERP_ORDER_XZY

Xzy

gxapi.PGU_INTERP_ORDER_XZY = 1
PGU_INTERP_ORDER_YXZ

Yxz

gxapi.PGU_INTERP_ORDER_YXZ = 2
PGU_INTERP_ORDER_YZX

Yzx

gxapi.PGU_INTERP_ORDER_YZX = 3
PGU_INTERP_ORDER_ZXY

Zxy

gxapi.PGU_INTERP_ORDER_ZXY = 4
PGU_INTERP_ORDER_ZYX

Zyx

gxapi.PGU_INTERP_ORDER_ZYX = 5