GXVVU class

class geosoft.gxapi.GXVVU
These methods are not a class. Utility methods perform
various operations on VV objects, including pruning,
splining, clipping and filtering.
static average_repeat((GXVV)arg1, (GXVV)arg2) → None:
Average repeat values.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Repeated values in the reference VV will be averaged
in the data VV.  The first value in the data VV will be set to the
average and subsequent data VV values will be dummied out.
Data is processed only to the minimum length of the
input VV lengths.
static average_repeat2((GXVV)arg1, (GXVV)arg2, (GXVV)arg3) → None:
Average repeat values based on 2 reference channels.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Repeated values in the reference VV will be averaged
in the data VV.  The first value in the data VV will be set to the
average and subsequent data VV values will be dummied out.
Data is processed only to the minimum length of the
input VV lengths.
Both the reference VV values must repeat for the averageing
to occur. This version is useful for averaging on repeated
(X,Y) locations.

See also

RemoveDummy_VV

static average_repeat2_ex((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (int)arg4) → None:
Average repeat values based on 2 reference channels.
Parameters:
Returns:

Nothing

Return type:

None

New in version 8.0.1.

Note:

Repeated values in the reference VV will be set to the mean, median, minimum or maximum value
in the data VV.  The first value in the data VV will be reset and subsequent data VV values will be dummied out.
Data is processed only to the minimum length of the
input VV lengths.
Both the reference VV values must repeat for the averageing
to occur. This version is useful for averaging on repeated
(X,Y) locations.

See also

RemoveDummy_VV

static average_repeat_ex((GXVV)arg1, (GXVV)arg2, (int)arg3) → None:
Average repeat values.
Parameters:
Returns:

Nothing

Return type:

None

New in version 8.0.1.

Note:

Repeated values in the reference VV will be set to the mean, median, minimum or maximum value
in the data VV.  For minimum and maximum, the index in the data VV containing the minimum or maximum value
is retained, and the other repeated values are dummied out. For mean and median, the first value in the 
data VV will be reset and subsequent data VV values will be dummied out.
Data is processed only to the minimum length of the
input VV lengths.
Search  numeric value in a VV.
Parameters:
Returns:

Nothing

Return type:

None

New in version 7.1.0.

Note:

The VV should be sorted.Search comparison is made on double
comparison of the data.
static box_cox((GXVV)arg1, (float)arg2) → None:
Run Box-Cox (lambda) Transformation on VV.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.8.

static bp_filt((GXVV)arg1, (GXVV)arg2, (float)arg3, (float)arg4, (int)arg5) → None:
Band-pass filter to the specified.
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – input VV
  • arg2 (geosoft.gxapi.GXVV) – filtered VV
  • arg3 (float) – Short wavelength cutoff, 0 for highpass
  • arg4 (float) – Long wavelength cutoff, 0 for lowpass
  • arg5 (int) – Filter Length, 0 for default length
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

If the short and long wavelengths are <= 0, the input channel
is simply copied to the output channel without filtering.

The wavelengths are in fiducials.
static clip((GXVV)arg1, (float)arg2, (float)arg3, (int)arg4) → None:
Clip a VV to a range.
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – VV to clip
  • arg2 (float) – minimum value, rDUMMY for no minimum clip
  • arg3 (float) – maximum value, rDUMMY for no maximum clip
  • arg4 (int) – VVU_CLIP constants
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static clip_to_detect_limit((GXVV)arg1, (float)arg2, (int)arg3) → None:
Apply detection limit clipping of data.
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – Input data vv (altered).
  • arg2 (float) – Detection limit
  • arg3 (int) – Auto-convert negatives?
Returns:

Nothing

Return type:

None

New in version 5.1.6.

Note:

Flow:

1. If auto-converting negatives, then all negative values
    are replaced by -0.5*value, and detection limit is ignored.

2. If not auto-converting negatives, and the detection limit is not
   rDUMMY, then values less than the detection limit are converted to
   one-half the detection limit.

This function is identical to geosoft.gxapi.GXCHIMERA.clip_to_detect_limit().
static close_xy((GXVV)arg1, (GXVV)arg2, (float)arg3, (float)arg4) → int:
Find the closest point to an input point (XY).
Parameters:
Returns:

Index of closest point, -1 if no valid locations, or data is masked.

Return type:

int

New in version 5.1.8.

Note:

Input X and Y location VVs, and a location.
Returns the index of the point in the VV closest to the
input point.
static close_xym((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (float)arg4, (float)arg5) → int:
Find the closest point to an input point, with mask (XY).
Parameters:
Returns:

Index of closest point, -1 if no valid locations, or data is masked.

Return type:

int

New in version 5.1.8.

Note:

Input X and Y location VVs, and a location.
Returns the index of the point in the VV closest to the
input point.
This skips points where the mask value is dummy.
If no valid points are in the VVs, or all the mask VV values
are dummy, the returned index is -1.
static close_xyz((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (float)arg4, (float)arg5, (float)arg6) → int:
Find the closest point to an input point (XYZ).
Parameters:
Returns:

Index of closest point, -1 if no valid locations, or data is masked.

Return type:

int

New in version 5.1.8.

Note:

Input X, Y and Z location VVs, and a location.
Returns the index of the point in the VV closest to the
input point.
static close_xyzm((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (GXVV)arg4, (float)arg5, (float)arg6, (float)arg7) → int:
Find the closest point to an input point, with mask (XYZ).
Parameters:
Returns:

Index of closest point, -1 if no valid locations, or data is masked.

Return type:

int

New in version 5.1.8.

Note:

Input X, Y and Z location VVs, and a location.
Returns the index of the point in the VV closest to the
input point.
This skips points where the mask value is dummy.
If no valid points are in the VVs, or all the mask VV values
are dummy, the returned index is -1.
static decimate((GXVV)arg1, (int)arg2) → None:
Decimate a VV.
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.1.0.

Note:

For a decimation factor N, will remove all values except
those with indices equal to MN, where M is an integer.
static deviation((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (float)arg4, (float)arg5, (float)arg6, (float)arg7, (int)arg8) → None:
Calculate distance of point locations to a straight line
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – X VV,REAL VV
  • arg2 (geosoft.gxapi.GXVV) – Y VV,REAL VV
  • arg3 (geosoft.gxapi.GXVV) – Output deviation VV,REAL VV
  • arg4 (float) – X of 1st point to define straight line
  • arg5 (float) – Y of 1st point to define straight line
  • arg6 (float) – X of 2nd point or line azimuth in degrees (North is 0 degree)
  • arg7 (float) – Y of 2nd point or GS_R8DM if line azimuth is defined
  • arg8 (int) – VVU_LINE constants
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static distance((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (float)arg4, (float)arg5, (float)arg6, (float)arg7) → None:
Create a cumulative distance VV
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – X VV,REAL VV
  • arg2 (geosoft.gxapi.GXVV) – Y VV,REAL VV
  • arg3 (geosoft.gxapi.GXVV) – Output distance VV,REAL VV
  • arg4 (float) – X VV fid start
  • arg5 (float) – X VV fid incr
  • arg6 (float) – Y VV fid start
  • arg7 (float) – Y VV fid incr
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static distance_3d((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (float)arg4, (GXVV)arg5) → None:
Create a cumulative distance VV from X, Y and Z VVs
Parameters:
Returns:

Nothing

Return type:

None

New in version 8.0.1.

Note:

The output VV is the length of the shortest X,Y or Z input VV.
Any values with dummies are ignored - the distance at that
point is equal to the distance at the previous valid point.
The returned VV is the cumulative straight-line distance
between the points. No re-sampling is performed.
VVs of any type are supported.
static distance_non_cumulative((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (float)arg4, (float)arg5, (float)arg6, (float)arg7) → None:
Create a non cumulative distance VV i.e each
distance element is the distance of the corresponding
(X,Y) element and the previous element.
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – X VV,REAL VV
  • arg2 (geosoft.gxapi.GXVV) – Y VV,REAL VV
  • arg3 (geosoft.gxapi.GXVV) – Output distance VV,REAL VV
  • arg4 (float) – X VV fid start
  • arg5 (float) – X VV fid incr
  • arg6 (float) – Y VV fid start
  • arg7 (float) – Y VV fid incr
Returns:

Nothing

Return type:

None

New in version 7.2.0.

Note:

The fist distace element is rDUMMY.
static dummy_back_tracks((GXVV)arg1) → int:
Dummy all points that keep a VV from being monotonically increasing.
Parameters:arg1 (geosoft.gxapi.GXVV) – VV handle
Returns:The number of items dummied in order to render the VV montonically increasing.
Return type:int

New in version 7.0.0.

Note:

The VV length remains the same. Any point that is less than or equal to
the previous (valid) point in the VV is dummied.
static dummy_range((GXVV)arg1, (float)arg2, (float)arg3, (int)arg4, (int)arg5) → None:
Dummy values inside or outside a range in a VV
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – VV handle
  • arg2 (float) – Minimum range value
  • arg3 (float) – Maximum range value
  • arg4 (int) – If TRUE, dummy inside the range
  • arg5 (int) – If TRUE, include Min, Max in the range.
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

If the Inside flag is TRUE, values within the specified
range are set to dummy. If the inside flag is FALSE,
values outside the range are set to dummy.  If the Inclusive
flag is TRUE, then dMin and dMax are considered part of the
range. If it is FALSE, then < or > are used, and dMin and
dMax lie outside the range.
static dummy_range_ex((GXVV)arg1, (float)arg2, (float)arg3, (int)arg4, (int)arg5, (int)arg6) → None:
Like DummyRangeVVU, with inclusion options for both ends.
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – VV handle
  • arg2 (float) – Minimum range value
  • arg3 (float) – Maximum range value
  • arg4 (int) – If TRUE, dummy inside the range
  • arg5 (int) – If TRUE, include Min in the range.
  • arg6 (int) – If TRUE, include Max in the range.
Returns:

Nothing

Return type:

None

New in version 5.0.7.

Note:

If the Inside flag is TRUE, values within the specified
range are set to dummy. If the inside flag is FALSE,
values outside the range are set to dummy.  If the Inclusive
flag is TRUE, then dMin and dMax are considered part of the
range. If it is FALSE, then < or > are used, and dMin and
dMax lie outside the range.
static dummy_repeat((GXVV)arg1, (int)arg2) → None:
dummy repeat values in a VV.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Either the first, middle or last point will be left.
                  Use geosoft.gxapi.GXVVU.interp() to interpolate after if desired.
static dup_stats((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (GXVV)arg4) → None:
Calculate means and differences for duplicate sample pairs
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Created for duplicate sample handling in CHIMERA. On input,
a numeric VV containing data values, and a sample type VV.
Sample pairs have types "1" and "2". This routine searches for
types in order "1 2 1 2", and writes the mean values of pairs
to the mean value VV, and the differences with the mean (equal
values, negative and positive) to the difference VV. Results
for samples out of order, for unmatched values, or when the
sample type does not equal "1" or "2" are set to dummy.
static exp_dist((GXVV)arg1, (int)arg2, (float)arg3, (int)arg4) → None:
Fill with exponentially distributed values.
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – VV object
  • arg2 (int) – Random number generator seed
  • arg3 (float) – Mean value of distribution (> 0.0)
  • arg4 (int) – Number of values (-1 for all)
Returns:

Nothing

Return type:

None

New in version 5.1.8.

Note:

VV is set to input length (except for -1)
See RAND for a short discription of the
random number generator used.
static filter((GXVV)arg1, (GXVV)arg2, (GXFLT)arg3) → None:
Apply a convolution filter to a VV.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static find_dummy((GXVV)arg1, (int)arg2, (int)arg3, (int)arg4, (int)arg5) → int:
Find the first dummy|non-dummy value in VV
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – VV handle
  • arg2 (int) – 0 increasing order 1 decreasing order
  • arg3 (int) – 0 to find the first dummy 1 find first non-dummy
  • arg4 (int) – start search range at element
  • arg5 (int) – end search range at element (-1 for last)
Returns:

The index of the first dummy|non-dummy value in VV -1 if not found or if length of VV is 0

Return type:

int

New in version 5.0.0.

Note:

Start and end of range are always defined lowest
to largest even if decreasing search order.  To search
entire VV range, specify 0,-1.
static find_gaps_3d((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (float)arg4, (GXVV)arg5) → None:
Return indices of locations separated from previous locations by more than the input gap distance.
Parameters:
Returns:

Nothing

Return type:

None

New in version 8.1.0.

Note:

Locate the starting points of line segements determined by an input gap distance.
The returned indices indicate where to break the line, given an input gap.
The number of returned indices is one less than the number of line segments.
(So if there are no gaps the returned VV has zero length).
static find_string_items((GXVV)arg1, (GXVV)arg2, (int)arg3, (int)arg4, (int)arg5, (GXVV)arg6) → None:
Searches a VV for items in a second VV, returns indices of those found.
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – String VV in which to locate items
  • arg2 (geosoft.gxapi.GXVV) – String VV Items to search for
  • arg3 (int) – Is the first VV already sorted?
  • arg4 (int) – Is the second VV already sorted
  • arg5 (int) – Case tolerance for string comparisons
  • arg6 (geosoft.gxapi.GXVV) – GS_LONG VV of returned indices into the first LST.
Returns:

Nothing

Return type:

None

New in version 7.3.0.

Note:

This is a much more efficient way of determining if items in
one VV are found in a second, than by searching
repeatedly in a loop.
The returned GS_LONG VV contains the same number of items as
the "search items" VV, and contains -1 for items where the
value is not found, and the index of items that are found.
Comparisons are case-tolerant.
Non-string VVs are converted to string type VVs (element size 24) internally.

The method requires that the VV items be sorted, and
will do so internally. Since the input VVs may already be sorted,
the method will run faster if this stage can be skipped.
static fractal_filter((GXVV)arg1, (int)arg2, (int)arg3, (GXVV)arg4) → None:
Fractal filter a VV.
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.0.0.

static interp((GXVV)arg1, (int)arg2, (int)arg3) → None:
Replace all dummies by interpolating from valid data.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Edge behaviour: Dummies at the ends are treated as follows
for various combinations of the inside and outside interpolation
 choices:

  if ((iOutside==VV_INTERP_EDGE_NEAREST) ||
      (iOutside==VV_INTERP_EDGE_SAME && iInside==VV_INTERP_NEAREST))

     // -- Set dummies to the same value as the last defined element

  else if ((iOutside==VV_INTERP_EDGE_LINEAR) ||
           (iOutside==VV_INTERP_EDGE_SAME &&  iInside==VV_INTERP_LINEAR))

     // --- Set dummies using the slope of the last two defined elements

  endif

In all other cases and combinations of the two interpolation
choices, the dummies are left "as is".
static mask((GXVV)arg1, (GXVV)arg2) → None:
Mask dummies in one VV onto another.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

VV to mask will be resampled to reference VV if required.
The returned length of the VV to mask will be the shorter
of the reference VV or the mask VV.
static mask_and((GXVV)arg1, (GXVV)arg2, (GXVV)arg3) → None:
Create mask from logical AND of two VVs.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.8.

Note:

If both values are non-dummies, then result is 1, else dummy.
static mask_or((GXVV)arg1, (GXVV)arg2, (GXVV)arg3) → None:
Create mask from logical OR of two VVs.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.8.

Note:

If either values is non-dummy, then result is 1, else dummy.
static nl_filt((GXVV)arg1, (GXVV)arg2, (int)arg3, (float)arg4) → None:
Applies a non-linear filter.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static noise_check((GXVV)arg1, (GXVV)arg2, (float)arg3, (int)arg4) → None:
Check on deviation of data from variable background in a VV
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – input VV on which to apply quality control Required in GS_DOUBLE or GS_FLOAT
  • arg2 (geosoft.gxapi.GXVV) – output flag VV with result 0 and 1. Required in GS_BYTE
  • arg3 (float) – allowed deviation over a number of data points in input VV (next parameter). Must be >= 0.0
  • arg4 (int) – number of data points. Must be > 0
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

This function checks vertical deviation of data in input VV
against a moving straight line. The straight line at any time is
defined by two extreme points of a data segment.  Output VV will
be 0 if data point in input VV falls within the deviation,
otherwise, it will be 1.
Output VV will be 0 if the straight line is vertical.
static noise_check2((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (float)arg4, (int)arg5) → None:
Like geosoft.gxapi.GXVVU.noise_check(), but returns maximum deviation at all points.
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – input VV on which to apply quality control Required in GS_DOUBLE or GS_FLOAT
  • arg2 (geosoft.gxapi.GXVV) – output flag VV with result 0 and 1. Required in GS_BYTE
  • arg3 (geosoft.gxapi.GXVV) – Output maximum deviation VV.
  • arg4 (float) – allowed deviation over a number of data points in input VV (next parameter). Must be >= 0.0
  • arg5 (int) – number of data points in the line segment. Must be > 0
Returns:

Nothing

Return type:

None

New in version 6.3.0.

Note:

This function checks vertical deviation of data in an input VV
against a moving straight line, where the X-axis value is
taken to be the data index, and the Y-axis value is the
input data VV value. The straight line is drawn between data points
at the ends of the line segment, whose length is an input.

The output flag VV is set to 0 if data point in input VV falls within the
deviation for all the moving line segments of which it is a part, otherwise, it
will be set to 1.

The output maximum deviation VV contains the maximum deviation at each point
for all the moving line segments that it is a part of.
static normal_dist((GXVV)arg1, (int)arg2, (float)arg3, (float)arg4, (int)arg5) → None:
Fill with normally (Gaussian) distributed values.
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – VV object
  • arg2 (int) – Random number generator seed
  • arg3 (float) – Mean value of distribution
  • arg4 (float) – Variance of the distribution
  • arg5 (int) – Number of values (-1 for all)
Returns:

Nothing

Return type:

None

New in version 5.1.8.

Note:

VV is set to input length (except for -1)
See RAND for a short discription of the
random number generator used.
static offset_circles((GXVV)arg1, (GXVV)arg2, (float)arg3, (float)arg4, (GXVV)arg5, (GXVV)arg6) → None:
Get non-overlapping offset location for circular symbols.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.7.

Note:

Often on maps plotted symbols and text overlap each other.
This routine accepts of VV of locations and returns a new
set of locations offset from the originals, and guaranteed
not to overlap, given the size of the original symbols.
The returned offset X, Y
locations are offset from the original locations by
the minimum of a) the input offset, b) the input symbol
radius. This is to ensure that the original location is
never covered by the offset symbol.

Care should be taken when choosing the symbol size, because
if the point density is too high, all the points will get
pushed to the outside edge and your plot will look like a
hedgehog (it also takes a lot longer!).
static offset_correct((GXVV)arg1, (GXVV)arg2, (float)arg3, (int)arg4, (GXVV)arg5, (GXVV)arg6) → None:
Correct locations based on heading and fixed offset.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.8.

Note:

In many applications, measurements are taken with an instrument which
is towed behind, or pushed ahead of where the locations are recorded.
Use this function to estimate the actual location of the instrument.
The method determines the heading along the line, using a "thinned"
version of the line. The degree of thinning is based on the size of the
offset; the larger the offset, the greater the distance between sample
locations used to construct the thinned lined used for determining headings.
The thinned line is splined at a frequency greater than the sample
frequency, and the heading at any given point is determined from the
vector formed by the closest two points on the splined line. The
correction (behind, in front, left or right) is determined with respect
to the heading, and added to the original location.

IF this method fails, no dummies, no duplicated locations, no reversals
are produced.

The algorithm:

1. Determine average distance between each point = D
2. Smoothing interval = MAX(2*D, Offset distance) = I
3. Thin input points to be at least the smoothing interval I apart from each other.
4. Smoothly re-interpolate the thinned points at five times the
   original average distance D.
5. For each input point, calculate the bearing using the nearest points
   on the smoothed curve
static offset_correct2((GXVV)arg1, (GXVV)arg2, (float)arg3, (float)arg4, (GXVV)arg5, (GXVV)arg6) → None:
Same as geosoft.gxapi.GXVVU.offset_correct(), but for an arbitrary offset angle.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.3.

static offset_correct3((GXVV)arg1, (GXVV)arg2, (float)arg3, (float)arg4, (float)arg5, (GXVV)arg6, (GXVV)arg7) → None:
Same as geosoft.gxapi.GXVVU.offset_correct2(), but specify smoothing interval.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.4.

Note:

See the algorithm note #2 above for the default smoothing interval.
static offset_correct_xyz((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (float)arg4, (float)arg5, (float)arg6, (float)arg7, (GXVV)arg8, (GXVV)arg9, (GXVV)arg10) → None:
Correct locations based on heading and fixed offset.
Parameters:
Returns:

Nothing

Return type:

None

New in version 9.0.

Note:

In many applications, measurements are taken with an instrument which
is towed behind, or pushed ahead of where the locations are recorded.
Use this function to estimate the actual location of the instrument.
The method determines the heading along the line, using a "thinned"
version of the line. The default degree of thinning is based on the size of the
offset; the larger the offset, the greater the distance between sample
locations used to construct the thinned lined used for determining headings.
The thinned line is splined at a frequency greater than the sample
frequency, and the heading at any given point is determined from the
vector formed by the closest two points on the splined line. The
correction (behind, in front, left or right) is determined with respect
to the heading, and added to the original location.

IF this method fails, no dummies, no duplicated locations, no reversals
are produced.

The algorithm:

1. Determine average distance between each point = D
2. Default smoothing interval = MAX(2*D, Offset distance) = I
3. Thin input points to be at least the smoothing interval I apart from each other.
4. Smoothly re-interpolate the thinned points at five times the
original average distance D.
5. For each input point, calculate the bearing using the nearest points
on the smoothed curve
static offset_rectangles((GXVV)arg1, (GXVV)arg2, (float)arg3, (float)arg4, (float)arg5, (GXVV)arg6, (GXVV)arg7) → None:
Get non-overlapping offset location for rectangular symbols.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.7.

Note:

Often on maps plotted symbols and text overlap each other.
This routine accepts of VV of locations and returns a new
set of locations offset from the originals, and guaranteed
not to overlap, given the size of the original symbols.
The returned offset X, Y
locations are offset from the original locations by
the minimum of a) the input offset, b) the input symbol
X or Y size. This is to ensure that the original location is
never covered by the offset symbol. In addition, the offset
symbol is never place directly below the original location,
to make it easier to draw a connecting line.

Care should be taken when choosing the symbol size, because
if the point density is too high, all the points will get
pushed to the outside edge and your plot will look like a
hedgehog (it also takes a lot longer!).
static pick_peak((GXVV)arg1, (GXVV)arg2, (float)arg3, (int)arg4) → None:
Find peaks in a VV - method one.
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – input VV
  • arg2 (geosoft.gxapi.GXVV) – returned peak VV, all dummies except peak points.
  • arg3 (float) – minimum value to accept (0.0 to find all)
  • arg4 (int) – minimum width to accept (1 to find all)
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Peaks are the maximum point within a sequence of
positive values in the input VV.  The width is the
number of points in the positive sequence.

A VV may have to be pre-filtered before finding
the peak values:

Use geosoft.gxapi.GXVVU.bp_filt() to smooth the data as required.
Use geosoft.gxapi.GXVVU.filter() to apply a Laplace filter
"-0.5,1.0,-0.5" to make curvature data.
static pick_peak2((GXVV)arg1, (GXVV)arg2, (float)arg3, (float)arg4) → None:
Find peaks in a VV - method two.
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – input VV
  • arg2 (geosoft.gxapi.GXVV) – returned peak VV, all dummies except peak points.
  • arg3 (float) – base level to accept (0.0 to find all)
  • arg4 (float) – minimum amplitude to accept
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Peaks are the maximum point within a sequence of
values in the input VV. Maximum points must be above
the base level and have a local amplitude greater
than the minimum amplitude specified.

A VV may have to be pre-filtered before finding
the peak values.
static pick_peak3((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (float)arg4, (float)arg5, (GXVV)arg6, (GXVV)arg7, (GXVV)arg8, (GXVV)arg9) → None:
Find peaks in a VV - method two, returning width and half-amplitude widths.
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.2.0.

Note:

Uses Method 2 above, but also returns the anomaly width (defined
as the distance between the surrounding troughs), and the
width at the half-amplitude. The half-amplitude width is
calculated in two parts, individually for each side based on
the distance from the maximum to the location where the
amplitude is mid-way between the maximum and trough.

The returned VVs are packed; no dummies. Instead the
indicies of the peak locations are returned.
static poly_fill((GXVV)arg1, (int)arg2, (GXVV)arg3) → None:
Fill a VV with values from an n'th order polynomial, integral x.
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – VV with output data. (Preset length)
  • arg2 (int) – order of the polynomial 0-9
  • arg3 (geosoft.gxapi.GXVV) – VV with polynomial coefficients (input)
Returns:

Nothing

Return type:

None

New in version 5.0.6.

Note:

The output VV length must be set as desired before calling.

The X scale is unitless (1 per element), i.e. 0,1,2,3,...
static poly_fill2((GXVV)arg1, (GXVV)arg2, (int)arg3, (GXVV)arg4) → None:
Fill a VV with values from an n'th order polynomial, specified X
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.6.

Note:

The output VV length must be set as desired before calling.
The X scale is defined by a X VV (see Trend_VV for unitless X).
static polygon_mask((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (GXPLY)arg4, (int)arg5) → None:
Mask a VV using XY data and a polygon.
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.2.0.

Note:

The VVs have to be the same length
static prune((GXVV)arg1, (GXVV)arg2, (int)arg3) → None:
Prune values from a VV based on reference VV
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Pruning will shorten the VV by removing values
that are either dummy or non-dummy in the reference
VV
static qc((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (float)arg4, (float)arg5, (float)arg6, (float)arg7, (int)arg8) → None:
Qualit control on deviation of data from norm in a VV
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – input VV on which to apply quality control Required in GS_DOUBLE or GS_FLOAT
  • arg2 (geosoft.gxapi.GXVV) – distance VV (NULL if criterion #2 does not apply). In GS_DOUBLE or GS_FLOAT
  • arg3 (geosoft.gxapi.GXVV) – output flag VV with result 0,1,2,3,-1,-2,-3. Required in GS_BYTE
  • arg4 (float) – nominal reading (required, must not be GS_R8DM)
  • arg5 (float) – maximum tolerance/deviation applied to a single reading (criterion #1). GS_R8DM if criterion #1 does not apply. Otherwise, must be positive value including 0.0
  • arg6 (float) – allowed tolerance/deviation over a given distance (next parameter) (criterion #2). GS_R8DM if criterion #2 does not apply. Otherwise, must be positive value including 0.0
  • arg7 (float) – the specified distance. GS_R8DM if criterion #2 does not apply. Otherwise, must be positive value excluding 0.0
  • arg8 (int) – QC_CRITERION constants
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

This function tests data in input VV against
two separate criteria. Each element of the output VV
will have one of the following indicators:

Indicator  Meaning
---------  --------
  0        Input data passed both tests
  1        The input data and is greater than the nominal value
           plus maximum tolerance/deviation (Criterion #1)
  2        The input data over a specified distance is greater than the
                   nominal value plus allowed tolerance (Criterion #2)
  3        The input data failed on above two tests
 -1        The input data and is less than the nominal value
           minus maximum tolerance (Criterion #1)
 -2        The input data over a specified distance is less than the
                   nominal value minus allowed tolerance (Criterion #2)
 -3        The input data failed on above two tests
static qc_fill_gaps((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (GXVV)arg4, (float)arg5) → int:
Calculate fill in line segments
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – input/output X VV on which to operate Required in GS_DOUBLE or GS_FLOAT
  • arg2 (geosoft.gxapi.GXVV) – input/output Y VV on which to operate In GS_DOUBLE or GS_FLOAT
  • arg3 (geosoft.gxapi.GXVV) – input Flag VV Required in GS_BYTE
  • arg4 (geosoft.gxapi.GXVV) – input Gap VV to use for locating the fill inline segments In GS_DOUBLE or GS_FLOAT
  • arg5 (float) – Min segment length (required)
Returns:

1 if error, 0 if successful

Return type:

int

New in version 6.3.0.

Note:

The X & Y VVs are returned as the calculated fill in line segments.
static range_vector_mag((GXVV)arg1, (GXVV)arg2, (float_ref)arg3, (float_ref)arg4) → None:
Find the range of hypotenuse values of two VVs.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

For each value in the VVs, finds sqrt(dV1*dV1 + dV2*dV2)
and returns the min and max values.
static regress((GXVV)arg1, (GXVV)arg2, (float_ref)arg3, (float_ref)arg4) → None:
Calculate linear regression through data
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static rel_var_dup((GXVV)arg1, (GXVV)arg2, (float_ref)arg3, (int_ref)arg4) → None:
Estimate relative variance of duplicate sample pairs from a database.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Created for duplicate sample handling in CHIMERA. On input,
a numeric or text VV containing data values, and a sample type VV.
Sample pairs have types "1" and "2". This routine searches for
types in order "1 2 1 2", and calulates the unnormalized relative variance,
defined as the sum of the squared differences between duplicates
divided by the sum of the squared mean values of the duplicates.
(To get the true rel.var., divide by N-1, where N is the number of
duplicate pairs used.)
Samples out of order, unmatched pairs, or when the
sample type does not equal "1" or "2" are ignored.
static remove_dummy((GXVV)arg1) → None:
Remove dummy values from a VV
Parameters:arg1 (geosoft.gxapi.GXVV) – VV
Returns:Nothing
Return type:None

New in version 5.0.0.

static remove_dummy2((GXVV)arg1, (GXVV)arg2) → None:
Remove dummy values from 2 VVs.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.8.

Note:

Removes all indices where either VV has a dummy, or is
not defined (due to length differences).
static remove_dummy3((GXVV)arg1, (GXVV)arg2, (GXVV)arg3) → None:
Remove dummy values from 3 VVs.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.8.

Note:

Removes all indices where any VV has a dummy, or is
not defined (due to length differences).
static remove_dummy4((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (GXVV)arg4) → None:
Remove dummy values from 4 VVs.
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.2.0.

Note:

Removes all indices where any VV has a dummy, or is
not defined (due to length differences).
static remove_dup((GXVV)arg1, (GXVV)arg2, (int)arg3) → None:
Remove/average duplicate sample pairs from a database.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Created for duplicate sample handling in CHIMERA. On input,
a numeric or text VV containing data values, and a sample type VV.
Sample pairs have types "1" and "2". This routine searches for
types in order "1 2 1 2", and replaces the pair of values in the
data VV according to the VV_DUP constants value.
Results for samples out of order, for unmatched pairs, or when the
sample type does not equal "1" or "2" remain unchanged.
static remove_xy_dup((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (int)arg4) → None:
Remove/average duplicate samples with the same (X, Y).
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Searches for duplicated (X, Y) locations and removes the
duplicates (can be more than just a pair). The "Z" values,
if defined, are treated according to the value of VV_XYDUP.
The returned VVs are shortened to the new length, without
duplicates.
The Z VV can be set to NULL on input, in which case it is ignored.
static remove_xy_dup_index((GXVV)arg1, (GXVV)arg2, (GXVV)arg3) → None:
Remove duplicate samples with the same (X, Y) and update index.
Parameters:
Returns:

Nothing

Return type:

None

New in version 7.2.0.

Note:

Searches for duplicated (X, Y) locations and removes the
duplicates (can be more than just a pair). The Index VV is
updated accordingly .i.e if  (X,Y) location of Index[0] == Index[1]
Index[1] is removed.
static rolling_stats((GXVV)arg1, (GXVV)arg2, (int)arg3, (int)arg4, (int)arg5) → None:
Calculate a statistic in a rolling window.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.0.

Note:

If the input VVs are not REAL, copies are made to
temporary REALs for processing.

If the window size is even, it is increased by 1 so that the
output value is put at the exact center index of the window.

Statistics are calculated on the values in a window
surrounding the individual data points.

By shrinking the window at the ends, one-sided effects can be
eliminated. For instance, if the data is linear to begin with,
a rolling mean will not alter the original data.
However, if the window size is kept constant, then values
near the ends tend to be pulled up or down.

With shrinking, the window is shrunk so that it always has the
same width on both sides of the data point under analysis;
at the end points the window width is 1, at the next point in
it is 3, and so on, until the full width is reached.

The median value is calculated by sorting the valid data in
the window, then selecting the middle value. If the number
of valid data points is even, then the average of the two
central values is returned.

The mode value is defined as the value which occurs most
frequently in the data. This value may not even exist, or
may not be unique. In this implementation, the following
algorithm is used: The valid data in the window is sorted
in ascending order. The number of occurrences of each data
value is tracked, and if it occurs more times than any
value, it becomes the modal value. If all
values are different, this procedure returns the smallest
value. If two or more values each have the same (maximum)
number of occurrences, then the smallest of these values is
returned.
static search_replace((GXVV)arg1, (float)arg2, (float)arg3) → None:
Search and replace numeric values in a VV.
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – VV
  • arg2 (float) – value to replace
  • arg3 (float) – replacement
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Search comparison is made on double comparison
of the data.

See also

SearchReplaceText_VV

static search_replace_text((GXVV)arg1, (int)arg2, (int)arg3, (str)arg4, (str)arg5, (int)arg6) → None:
Search and replace text values in a VV
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – VV
  • arg2 (int) – string format for numeric VV
  • arg3 (int) – decimals for formating numeric VV
  • arg4 (str) – formatted string to replace
  • arg5 (str) – replacement
  • arg6 (int) – VVU_SRCHREPL_CASE constants
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Search comparison is made on string comparison
of the data.

See also

SearchReplace_VV

static search_replace_text_ex((GXVV)arg1, (int)arg2, (int)arg3, (str)arg4, (str)arg5, (int)arg6, (int_ref)arg7) → None:
Search and replace text values in a VV, count items changed.
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.0.1.

Note:

Search comparison is made on a string comparison
of the data.

See also

SearchReplaceText_VV

static search_text((GXVV)arg1, (str)arg2, (int)arg3, (int)arg4, (int)arg5, (int)arg6) → int:
Search for a text value in a VV
Parameters:
Returns:

Index of first matching text, -1 if not found.

Return type:

int

New in version 5.0.8.

Note:

Search comparison is made on string comparison
of the data. Returns index of first item matching
the input string.
If start index is -1 or dummy, then full VV is searched.
Use VVU_MATCH_INPUT_LENGTH to match the first part of a string.
This is also recommended for matching numerical values, since
the displayed value in the database may not be the same as the
stored value.

See also

sSearchReplace_VV

static spline((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (int)arg4, (float)arg5, (float)arg6, (float)arg7, (int)arg8, (int)arg9) → None:
Spline a Y VV onto an X VV.
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – X (no dummies)
  • arg2 (geosoft.gxapi.GXVV) – Y to be splined (no dummies)
  • arg3 (geosoft.gxapi.GXVV) – Y output
  • arg4 (int) – output Length
  • arg5 (float) – Starting Location
  • arg6 (float) – Separation Distance
  • arg7 (float) – Maximum gap to interpolate across
  • arg8 (int) – Number of elements to extend
  • arg9 (int) – VVU_SPL constants
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static spline2((GXVV)arg1, (GXVV)arg2, (GXVV)arg3, (GXVV)arg4, (int)arg5) → None:
Spline a Y VV onto an X VV. Uses specified values of X in X2
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.3.

static tokenize_to_values((GXVV)arg1, (str)arg2) → int:
Tokenize a string based on any characters.
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – VV to place values in
  • arg2 (str) – str - String to parse
Returns:

number of tokens (length of VV)

Return type:

int

New in version 9.0.0.

Note:

Parses a series of space, tab or comma-delimited values to a VV.
static translate((GXVV)arg1, (float)arg2, (float)arg3) → None:
Translate values in a VV
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

(new VV) = ((old VV) + base) * scale
static trend((GXVV)arg1, (int)arg2, (GXVV)arg3) → None:
Calculate an n'th order best-fit polynomial, integral x.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.6.

Note:

Returns coefficients c[0] .. c[n]

   Y(x) = c[0] + c[1]x + c[2](x**2) + ... + c[n](x**n)

The X scale is unitless (1 per element), i.e. 0,1,2,3,...

The polynomial VV length is set to the number of coefficients
(order + 1)
static trend2((GXVV)arg1, (GXVV)arg2, (int)arg3, (GXVV)arg4) → None:
Calculate an n'th order best-fit polynomial, specified X
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.6.

Note:

Returns coefficients c[0] .. c[n]

   Y(x) = c[0] + c[1]x + c[2](x**2) + ... + c[n](x**n)

The X scale is defined by a X VV (see Trend_VV for unitless X).

The polynomial VV length is set to the number of coefficients
(order + 1)
static uniform_dist((GXVV)arg1, (int)arg2, (float)arg3, (float)arg4, (int)arg5) → None:
Fill with uniformly distributed values.
Parameters:
  • arg1 (geosoft.gxapi.GXVV) – VV object
  • arg2 (int) – Random number generator seed
  • arg3 (float) – Minimum of range
  • arg4 (float) – Maximum of range
  • arg5 (int) – Number of values (-1 for all)
Returns:

Nothing

Return type:

None

New in version 5.1.8.

Note:

VV is set to input length (except for -1)
See rand.gxh for a short discription of the
random number generator used.

QC_CRITERION constants

Criterion
gxapi.QC_CRITERION_1 = 0
gxapi.QC_CRITERION_2 = 1
gxapi.QC_CRITERION_12 = 2

TEM_ARRAY constants

Array Type
gxapi.TEM_ARRAY_VERTICALSOUNDING = 0
gxapi.TEM_ARRAY_PROFILING = 1
gxapi.TEM_ARRAY_BOREHOLE = 2

VV_DUP constants

Duplicate handling mode
gxapi.VV_DUP_AVERAGE = 0
average numeric values (for strings, same as VV_DUP_1)
gxapi.VV_DUP_1 = 1
Use first value of the pair
gxapi.VV_DUP_2 = 2
Use second value of the pair
gxapi.VV_DUP_DUMMY = 3
Set to dummy
gxapi.VV_DUP_SAMPLE = 4
Set to "3" (cannot use with string data VV)

VV_XYDUP constants

Sample handling
gxapi.VV_XYDUP_AVERAGE = 0
gxapi.VV_XYDUP_SUM = 1

VVU_CASE constants

String case handling
gxapi.VVU_CASE_TOLERANT = 0
gxapi.VVU_CASE_SENSITIVE = 1

VVU_CLIP constants

Type of clipping
gxapi.VVU_CLIP_DUMMY = 0
clip replaces clipped values with a dummy.
gxapi.VVU_CLIP_LIMIT = 1
clip replaces clipped values with the limit.

VVU_DUMMYREPEAT constants

How to deal with repeats
gxapi.VVU_DUMMYREPEAT_FIRST = 0
dummies all but first point.
gxapi.VVU_DUMMYREPEAT_LAST = 1
dummies all but last point.
gxapi.VVU_DUMMYREPEAT_MIDDLE = 2
dummies all but middle point.

VVU_INTERP constants

Interpolation method to use
gxapi.VVU_INTERP_NEAREST = 1
gxapi.VVU_INTERP_LINEAR = 2
gxapi.VVU_INTERP_CUBIC = 3
gxapi.VVU_INTERP_AKIMA = 4
gxapi.VVU_INTERP_PREDICT = 5

VVU_INTERP_EDGE constants

Interpolation method to use on edges
gxapi.VVU_INTERP_EDGE_NONE = 0
gxapi.VVU_INTERP_EDGE_SAME = 1
gxapi.VVU_INTERP_EDGE_NEAREST = 2
gxapi.VVU_INTERP_EDGE_LINEAR = 3

VVU_LINE constants

Line Types
gxapi.LINE_2_POINTS = 0
gxapi.LINE_POINT_AZIMUTH = 1

VVU_MASK constants

Type of clipping
gxapi.VVU_MASK_INSIDE = 0
Mask VV is set to dummy at locations inside the PLY.
gxapi.VVU_MASK_OUTSIDE = 1
Mask VV is set to dummy at locations outside the PLY.

VVU_MATCH constants

Matching style
gxapi.VVU_MATCH_FULL_STRINGS = 0
entire string
gxapi.VVU_MATCH_INPUT_LENGTH = 1
match the first part of a string.

VVU_MODE constants

Statistic to select
gxapi.VVU_MODE_MEAN = 0
gxapi.VVU_MODE_MEDIAN = 1
gxapi.VVU_MODE_MAXIMUM = 2
gxapi.VVU_MODE_MINIMUM = 3

VVU_OFFSET constants

Heading
gxapi.VVU_OFFSET_FORWARD = 0
gxapi.VVU_OFFSET_BACKWARD = 1
gxapi.VVU_OFFSET_RIGHT = 2
gxapi.VVU_OFFSET_LEFT = 3

VVU_PRUNE constants

Prune options
gxapi.VVU_PRUNE_DUMMY = 0
0
gxapi.VVU_PRUNE_VALID = 1
1

VVU_SPL constants

Spline types
gxapi.VVU_SPL_LINEAR = 0
gxapi.VVU_SPL_CUBIC = 1
gxapi.VVU_SPL_AKIMA = 2
gxapi.VVU_SPL_NEAREST = 3

VVU_SRCHREPL_CASE constants

Search and Replace handling of string case
gxapi.VVU_SRCHREPL_CASE_TOLERANT = 0
gxapi.VVU_SRCHREPL_CASE_SENSITIVE = 1