GXVVU class¶
- class GXVVU(handle=0)[source]¶
GXVVU class.
These methods are not a class. Utility methods perform various operations on
GXVV
objects, including pruning, splining, clipping and filtering.- classmethod average_repeat(ref_vv, dat_vv)[source]¶
Average repeat values.
New in version 5.0.
License: Geosoft End-User License
Note: Repeated values in the reference
GXVV
will be averaged in the dataGXVV
. The first value in the dataGXVV
will be set to the average and subsequent dataGXVV
values will be dummied out. Data is processed only to the minimum length of the inputGXVV
lengths.See also
- classmethod average_repeat2(ref_vv1, ref_vv2, dat_vv)[source]¶
Average repeat values based on 2 reference channels.
- Parameters:
New in version 5.0.
License: Geosoft End-User License
Note: Repeated values in the reference
GXVV
will be averaged in the dataGXVV
. The first value in the dataGXVV
will be set to the average and subsequent dataGXVV
values will be dummied out. Data is processed only to the minimum length of the inputGXVV
lengths. Both the referenceGXVV
values must repeat for the averaging to occur. This version is useful for averaging on repeated (X,Y) locations.See also
RemoveDummy_VV
- classmethod average_repeat2_ex(ref_vv1, ref_vv2, dat_vv, mode)[source]¶
Average repeat values based on 2 reference channels.
- Parameters:
New in version 8.0.1.
License: Geosoft End-User License
Note: Repeated values in the reference
GXVV
will be set to the mean, median, minimum or maximum value in the dataGXVV
. The first value in the dataGXVV
will be reset and subsequent dataGXVV
values will be dummied out. Data is processed only to the minimum length of the inputGXVV
lengths. Both the referenceGXVV
values must repeat for the averaging to occur. This version is useful for averaging on repeated (X,Y) locations.See also
RemoveDummy_VV
- classmethod average_repeat_ex(ref_vv, dat_vv, mode)[source]¶
Average repeat values.
- Parameters:
mode (int) – VVU_MODE constants
New in version 8.0.1.
License: Geosoft End-User License
Note: Repeated values in the reference
GXVV
will be set to the mean, median, minimum or maximum value in the dataGXVV
. For minimum and maximum, the index in the dataGXVV
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 dataGXVV
will be reset and subsequent dataGXVV
values will be dummied out. Data is processed only to the minimum length of the inputGXVV
lengths.See also
- classmethod binary_search(vv, val, l_min, l_max)[source]¶
Search numeric value in a
GXVV
.- Parameters:
New in version 7.1.
License: Geosoft End-User License
Note: The
GXVV
should be sorted.Search comparison is made on double comparison of the data.
- classmethod box_cox(vv, lm)[source]¶
Run Box-Cox (lambda) Transformation on
GXVV
.New in version 5.1.8.
License: Geosoft End-User License
- classmethod bp_filt(vv_i, vv_o, pr_sw, pr_lw, flen)[source]¶
Band-pass filter to the specified.
- Parameters:
New in version 5.0.
License: Geosoft End-User License
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.
- classmethod clip(vv, min, max, clip)[source]¶
Clip a
GXVV
to a range.- Parameters:
min (float) – Minimum value,
rDUMMY
for no minimum clipmax (float) – Maximum value,
rDUMMY
for no maximum clipclip (int) – VVU_CLIP constants
New in version 5.0.
License: Geosoft Open License
- classmethod clip_to_detect_limit(vv, det_limit, conv)[source]¶
Apply detection limit clipping of data.
- Parameters:
vv (GXVV) – Input data vv (altered).
det_limit (float) – Detection limit
conv (int) – Auto-convert negatives?
New in version 5.1.6.
License: Geosoft End-User License
Note: Flow:
- If auto-converting negatives, then all negative values
are replaced by -0.5*value, and detection limit is ignored.
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
GXCHIMERA.clip_to_detect_limit
.
- classmethod close_xy(vv_x, vv_y, x, y)[source]¶
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.
License: Geosoft End-User License
Note: Input X and Y location VVs, and a location. Returns the index of the point in the
GXVV
closest to the input point.
- classmethod close_xym(vv_x, vv_y, vv_m, x, y)[source]¶
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.
License: Geosoft End-User License
Note: Input X and Y location VVs, and a location. Returns the index of the point in the
GXVV
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 maskGXVV
values are dummy, the returned index is -1.
- classmethod close_xyz(vv_x, vv_y, vv_z, x, y, z)[source]¶
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.
License: Geosoft End-User License
Note: Input X, Y and Z location VVs, and a location. Returns the index of the point in the
GXVV
closest to the input point.
- classmethod close_xyzm(vv_x, vv_y, vv_z, vv_m, x, y, z)[source]¶
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.
License: Geosoft End-User License
Note: Input X, Y and Z location VVs, and a location. Returns the index of the point in the
GXVV
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 maskGXVV
values are dummy, the returned index is -1.
- classmethod decimate(vv, decimate)[source]¶
Decimate a
GXVV
.- Parameters:
decimate (int) – Decimation factor (must be > 0)
New in version 6.1.
License: Geosoft End-User License
Note: For a decimation factor N, will remove all values except those with indices equal to MN, where M is an integer.
- classmethod deviation(vv_x, vv_y, vv_d, x1, y1, x2, y2, line)[source]¶
Calculate distance of point locations to a straight line
- Parameters:
x1 (float) – X of 1st point to define straight line
y1 (float) – Y of 1st point to define straight line
x2 (float) – X of 2nd point or line azimuth in degrees (North is 0 degree)
y2 (float) – Y of 2nd point or
GS_R8DM
if line azimuth is definedline (int) – VVU_LINE constants
New in version 5.0.
License: Geosoft End-User License
- classmethod distance(vv_x, vv_y, vv_d, x_fid_start, x_fid_incr, y_fid_start, y_fid_incr)[source]¶
Create a cumulative distance
GXVV
- Parameters:
New in version 5.0.
License: Geosoft End-User License
- classmethod distance_3d(vv_x, vv_y, vv_z, start_distance, vv_d)[source]¶
Create a cumulative distance
GXVV
from X, Y and Z VVs- Parameters:
New in version 8.0.1.
License: Geosoft End-User License
Note: The output
GXVV
is the length of the shortest X,Y or Z inputGXVV
. Any values with dummies are ignored - the distance at that point is equal to the distance at the previous valid point. The returnedGXVV
is the cumulative straight-line distance between the points. No re-sampling is performed. VVs of any type are supported.
- classmethod distance_link_non_dummies(vv_x, vv_y, vv_d, x_fid_start, x_fid_incr, y_fid_start, y_fid_incr)[source]¶
Create distance linking non-dummies
GXVV
- Parameters:
New in version 2022.2.
License: Geosoft End-User License
- classmethod distance_non_cumulative(vv_x, vv_y, vv_d, x_fid_start, x_fid_incr, y_fid_start, y_fid_incr)[source]¶
Create a non cumulative distance
GXVV
i.e each distance element is the distance of the corresponding (X,Y) element and the previous element.- Parameters:
New in version 7.2.
License: Geosoft End-User License
Note: The fist distace element is
rDUMMY
.
- classmethod dummy_back_tracks(vv)[source]¶
Dummy all points that keep a
GXVV
from being monotonically increasing.- Parameters:
- Returns:
The number of items dummied in order to render the
GXVV
montonically increasing.- Return type:
int
New in version 7.0.
License: Geosoft End-User License
Note: The
GXVV
length remains the same. Any point that is less than or equal to the previous (valid) point in theGXVV
is dummied.
- classmethod dummy_range(vv, min, max, inside, incl)[source]¶
Dummy values inside or outside a range in a
GXVV
- Parameters:
New in version 5.0.
License: Geosoft Open License
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.
- classmethod dummy_range_ex(vv, min, max, inside, include_min, include_max)[source]¶
Like DummyRangeVVU, with inclusion options for both ends.
- Parameters:
New in version 5.0.7.
License: Geosoft Open License
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.
- classmethod dummy_repeat(vv, mode)[source]¶
Dummy repeat values in a
GXVV
.- Parameters:
mode (int) – VVU_DUMMYREPEAT constants
New in version 5.0.
License: Geosoft End-User License
- Note: Either the first, middle or last point will be left.
Use
interp
to interpolate after if desired.
- classmethod dup_stats(data_vv, sample_vv, mean_vv, diff_vv)[source]¶
Calculate means and differences for duplicate sample pairs
- Parameters:
New in version 5.0.
License: Geosoft End-User License
Note: Created for duplicate sample handling in
GXCHIMERA
. On input, a numericGXVV
containing data values, and a sample typeGXVV
. 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 valueGXVV
, and the differences with the mean (equal values, negative and positive) to the differenceGXVV
. Results for samples out of order, for unmatched values, or when the sample type does not equal “1” or “2” are set to dummy.
- classmethod exp_dist(vv, seed, mean, length)[source]¶
Fill with exponentially distributed values.
- Parameters:
New in version 5.1.8.
License: Geosoft End-User License
Note:
GXVV
is set to input length (except for -1) See RAND for a short discription of the random number generator used.
- classmethod filter(vv_i, vv_o, flt)[source]¶
Apply a convolution filter to a
GXVV
.- Parameters:
New in version 5.0.
License: Geosoft End-User License
- classmethod find_dummy(vv, dir, type, start, end)[source]¶
Find the first dummy|non-dummy value in
GXVV
- Parameters:
- Returns:
The index of the first dummy|non-dummy value in
GXVV
-1 if not found or if length ofGXVV
is 0- Return type:
int
New in version 5.0.
License: Geosoft End-User License
Note: Start and end of range are always defined lowest to largest even if decreasing search order. To search entire
GXVV
range, specify 0,-1.
- classmethod find_gaps_3d(vv_x, vv_y, vv_z, gap, vv_g)[source]¶
Return indices of locations separated from previous locations by more than the input gap distance.
- Parameters:
New in version 8.1.
License: Geosoft End-User License
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
GXVV
has zero length).
- classmethod find_string_items(vv_source, vv_search, pis_source_sorted, pis_search_sorted, pis_case_tolerant, vv_i)[source]¶
Searches a
GXVV
for items in a secondGXVV
, returns indices of those found.- Parameters:
New in version 7.3.
License: Geosoft End-User License
Note: This is a much more efficient way of determining if items in one
GXVV
are found in a second, than by searching repeatedly in a loop. The returnedGS_LONG
GXVV
contains the same number of items as the “search items”GXVV
, 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
GXVV
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.
- classmethod fractal_filter(vv_i, order, number, vv_o)[source]¶
Fractal filter a
GXVV
.- Parameters:
New in version 6.0.
License: Geosoft End-User License
- classmethod interp(vv, input, output)[source]¶
Replace all dummies by interpolating from valid data.
- Parameters:
input (int) – VVU_INTERP constants
output (int) – VVU_INTERP_EDGE constants
New in version 5.0.
License: Geosoft End-User License
- 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”.
- 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
- classmethod mask(vv_d, vv_m)[source]¶
Mask dummies in one
GXVV
onto another.New in version 5.0.
License: Geosoft End-User License
Note:
GXVV
to mask will be resampled to referenceGXVV
if required. The returned length of theGXVV
to mask will be the shorter of the referenceGXVV
or the maskGXVV
.
- classmethod mask_and(vv_a, vv_b, vv_c)[source]¶
Create mask from logical AND of two VVs.
New in version 5.1.8.
License: Geosoft End-User License
Note: If both values are non-dummies, then result is 1, else dummy.
- classmethod mask_or(vv_a, vv_b, vv_c)[source]¶
Create mask from logical OR of two VVs.
New in version 5.1.8.
License: Geosoft End-User License
Note: If either values is non-dummy, then result is 1, else dummy.
- classmethod nl_filt(vv_i, vv_o, fwid, pr_ftol)[source]¶
Applies a non-linear filter.
- Parameters:
New in version 5.0.
License: Geosoft End-User License
- classmethod noise_check(vv_i, vv_f, all_tol, num)[source]¶
Check on deviation of data from variable background in a
GXVV
- Parameters:
vv_i (GXVV) – Input
GXVV
on which to apply quality control Required inGS_DOUBLE
orGS_FLOAT
vv_f (GXVV) – Output flag
GXVV
with result 0 and 1. Required inGS_BYTE
all_tol (float) – Allowed deviation over a number of data points in input
GXVV
(next parameter). Must be >= 0.0num (int) – Number of data points. Must be > 0
New in version 5.0.
License: Geosoft End-User License
Note: This function checks vertical deviation of data in input
GXVV
against a moving straight line. The straight line at any time is defined by two extreme points of a data segment. OutputGXVV
will be 0 if data point in inputGXVV
falls within the deviation, otherwise, it will be 1. OutputGXVV
will be 0 if the straight line is vertical.
- classmethod noise_check2(vv_i, vv_f, vv_d, all_tol, num)[source]¶
Like
noise_check
, but returns maximum deviation at all points.- Parameters:
vv_i (GXVV) – Input
GXVV
on which to apply quality control Required inGS_DOUBLE
orGS_FLOAT
vv_f (GXVV) – Output flag
GXVV
with result 0 and 1. Required inGS_BYTE
all_tol (float) – Allowed deviation over a number of data points in input
GXVV
(next parameter). Must be >= 0.0num (int) – Number of data points in the line segment. Must be > 0
New in version 6.3.
License: Geosoft End-User License
Note: This function checks vertical deviation of data in an input
GXVV
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 dataGXVV
value. The straight line is drawn between data points at the ends of the line segment, whose length is an input.The output flag
GXVV
is set to 0 if data point in inputGXVV
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
GXVV
contains the maximum deviation at each point for all the moving line segments that it is a part of.
- classmethod normal_dist(vv, seed, mean, var, length)[source]¶
Fill with normally (Gaussian) distributed values.
- Parameters:
New in version 5.1.8.
License: Geosoft End-User License
Note:
GXVV
is set to input length (except for -1) See RAND for a short discription of the random number generator used.
- classmethod offset_circles(vv_xi, vv_yi, offset, radius, vv_xo, vv_yo)[source]¶
Get non-overlapping offset location for circular symbols.
- Parameters:
New in version 5.0.7.
License: Geosoft End-User License
Note: Often on maps plotted symbols and text overlap each other. This routine accepts of
GXVV
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!).
- classmethod offset_correct(vv_xi, vv_yi, dist, heading, v_vxo, v_vyo)[source]¶
Correct locations based on heading and fixed offset.
- Parameters:
vv_xi (GXVV) – Input X
vv_yi (GXVV) – Input Y
dist (float) – Offset distance
heading (int) – VVU_OFFSET constants
v_vxo (GXVV) – Output X
v_vyo (GXVV) – Output Y
New in version 5.0.8.
License: Geosoft End-User License
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:
Determine average distance between each point = D
Smoothing interval = MAX(2*D, Offset distance) = I
Thin input points to be at least the smoothing interval I apart from each other.
Smoothly re-interpolate the thinned points at five times the original average distance D.
For each input point, calculate the bearing using the nearest points on the smoothed curve
- classmethod offset_correct2(vv_xi, vv_yi, dist, azimuth, vv_xo, vv_yo)[source]¶
Same as
offset_correct
, but for an arbitrary offset angle.- Parameters:
New in version 5.1.3.
License: Geosoft End-User License
- classmethod offset_correct3(vv_xi, vv_yi, dist, azimuth, interval, vv_xo, vv_yo)[source]¶
Same as
offset_correct2
, but specify smoothing interval.- Parameters:
New in version 5.1.4.
License: Geosoft End-User License
Note: See the algorithm note #2 above for the default smoothing interval.
- classmethod offset_correct_xyz(vv_xi, vv_yi, vv_zi, x_off, y_off, z_off, interval, v_vxo, v_vyo, v_vzo)[source]¶
Correct locations based on heading and fixed offset.
- Parameters:
vv_xi (GXVV) – Input X
vv_yi (GXVV) – Input Y
vv_zi (GXVV) – Input Z
x_off (float) – Offset along-track (+ve forward)
y_off (float) – Offset across-track (+ve to the right)
z_off (float) – Vertical Offset (+ve up)
interval (float) – Sampling interval -
rDUMMY
for defaultv_vxo (GXVV) – Output X
v_vyo (GXVV) – Output Y
v_vzo (GXVV) – Output Z
New in version 9.0.
License: Geosoft End-User License
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:
Determine average distance between each point = D
Default smoothing interval = MAX(2*D, Offset distance) = I
Thin input points to be at least the smoothing interval I apart from each other.
Smoothly re-interpolate the thinned points at five times the original average distance D.
For each input point, calculate the bearing using the nearest points on the smoothed curve
- classmethod offset_rectangles(vv_xi, vv_yi, offset, size_x, size_y, vv_xo, vv_yo)[source]¶
Get non-overlapping offset location for rectangular symbols.
- Parameters:
New in version 5.0.7.
License: Geosoft End-User License
Note: Often on maps plotted symbols and text overlap each other. This routine accepts of
GXVV
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!).
- classmethod pick_peak(vv_i, vv_o, pr_tol, width)[source]¶
Find peaks in a
GXVV
- method one.- Parameters:
New in version 5.0.
License: Geosoft End-User License
Note: Peaks are the maximum point within a sequence of positive values in the input
GXVV
. The width is the number of points in the positive sequence.A
GXVV
may have to be pre-filtered before finding the peak values:Use
bp_filt
to smooth the data as required. Usefilter
to apply a Laplace filter “-0.5,1.0,-0.5” to make curvature data.
- classmethod pick_peak2(vv_i, vv_o, pr_base_lvl, pr_ampl)[source]¶
Find peaks in a
GXVV
- method two.- Parameters:
New in version 5.0.
License: Geosoft End-User License
Note: Peaks are the maximum point within a sequence of values in the input
GXVV
. Maximum points must be above the base level and have a local amplitude greater than the minimum amplitude specified.A
GXVV
may have to be pre-filtered before finding the peak values.
- classmethod pick_peak3(vv_i, vv_x, vv_y, pr_base_lvl, pr_ampl, v_vind, v_vamp, v_vwid, v_vhawid)[source]¶
Find peaks in a
GXVV
- method two, returning width and half-amplitude widths.- Parameters:
New in version 6.2.
License: Geosoft End-User License
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.
- classmethod poly_fill(vv_d, order, vv_c)[source]¶
Fill a
GXVV
with values from an n’th order polynomial, integral x.- Parameters:
New in version 5.0.6.
License: Geosoft End-User License
Note: The output
GXVV
length must be set as desired before calling.The X scale is unitless (1 per element), i.e. 0,1,2,3,…
See also
- classmethod poly_fill2(vv_x, vv_d, order, vv_c)[source]¶
Fill a
GXVV
with values from an n’th order polynomial, specified X- Parameters:
New in version 5.0.6.
License: Geosoft End-User License
Note: The output
GXVV
length must be set as desired before calling. The X scale is defined by a XGXVV
(see Trend_VV for unitless X).
- classmethod polygon_mask(vv_x, vv_y, vv_m, pply, mask)[source]¶
Mask a
GXVV
using XY data and a polygon.- Parameters:
New in version 6.2.
License: Geosoft End-User License
Note: The VVs have to be the same length
- classmethod prune(vv_p, vv_r, o)[source]¶
Prune values from a
GXVV
based on referenceGXVV
- Parameters:
o (int) – VVU_PRUNE constants
New in version 5.0.
License: Geosoft End-User License
Note: Pruning will shorten the
GXVV
by removing values that are either dummy or non-dummy in the referenceGXVV
- classmethod qc(vv_i, vv_d, v_vf, nominal, max_tol, all_tol, dist, qc)[source]¶
Quality control on deviation of data from norm in a
GXVV
- Parameters:
vv_i (GXVV) – Input
GXVV
on which to apply quality control Required inGS_DOUBLE
orGS_FLOAT
vv_d (GXVV) – Distance
GXVV
(NULL if criterion #2 does not apply). InGS_DOUBLE
orGS_FLOAT
v_vf (GXVV) – Output flag
GXVV
with result 0,1,2,3,-1,-2,-3. Required inGS_BYTE
nominal (float) – Nominal reading (required, must not be
GS_R8DM
)max_tol (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.0all_tol (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.0dist (float) – The specified distance.
GS_R8DM
if criterion #2 does not apply. Otherwise, must be positive value excluding 0.0qc (int) – QC_CRITERION constants
New in version 5.0.
License: Geosoft End-User License
Note: This function tests data in input
GXVV
against two separate criteria. Each element of the outputGXVV
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
- classmethod qc2(vv_i, vv_d, v_vf, vv_drape, max_tol, all_tol, dist, qc)[source]¶
Quality control on deviation of data from norm in a
GXVV
- Parameters:
vv_i (GXVV) – Input
GXVV
on which to apply quality control Required inGS_DOUBLE
orGS_FLOAT
vv_d (GXVV) – Distance
GXVV
(NULL if criterion #2 does not apply). InGS_DOUBLE
orGS_FLOAT
v_vf (GXVV) – Output flag
GXVV
with result 0,1,2,3,-1,-2,-3. Required inGS_BYTE
vv_drape (GXVV) – Drape elevation
GXVV
which is used instead of a constant nominal terrain clearance Required inGS_DOUBLE
orGS_FLOAT
max_tol (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.0all_tol (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.0dist (float) – The specified distance.
GS_R8DM
if criterion #2 does not apply. Otherwise, must be positive value excluding 0.0qc (int) – QC_CRITERION constants
New in version 2022.2.
License: Geosoft End-User License
Note: This function tests data in input
GXVV
against two separate criteria. Each element of the outputGXVV
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
- classmethod qc_fill_gaps(vvx, vvy, vvf, vvd, dist)[source]¶
Calculate fill in line segments
- Parameters:
vvx (GXVV) – Input/output X
GXVV
on which to operate Required inGS_DOUBLE
orGS_FLOAT
vvy (GXVV) – Input/output Y
GXVV
on which to operate InGS_DOUBLE
orGS_FLOAT
vvd (GXVV) – Input Gap
GXVV
to use for locating the fill inline segments InGS_DOUBLE
orGS_FLOAT
dist (float) – Min segment length (required)
- Returns:
1 if error, 0 if successful
- Return type:
int
New in version 6.3.
License: Geosoft End-User License
Note: The X & Y VVs are returned as the calculated fill in line segments.
- classmethod range_vector_mag(vv1, vv2, min, max)[source]¶
Find the range of hypotenuse values of two VVs.
- Parameters:
New in version 5.0.
License: Geosoft End-User License
Note: For each value in the VVs, finds sqrt(dV1*dV1 + dV2*dV2) and returns the min and max values.
- classmethod regress(vv_x, vv_y, slp, intercept)[source]¶
Calculate linear regression through data
- Parameters:
New in version 5.0.
License: Geosoft End-User License
- classmethod rel_var_dup(data_vv, sample_vv, rel_var, num_dup)[source]¶
Estimate relative variance of duplicate sample pairs from a database.
- Parameters:
New in version 5.0.
License: Geosoft End-User License
Note: Created for duplicate sample handling in
GXCHIMERA
. On input, a numeric or textGXVV
containing data values, and a sample typeGXVV
. 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.
- classmethod remove_dummy(vv)[source]¶
Remove dummy values from a
GXVV
New in version 5.0.
License: Geosoft Open License
- classmethod remove_dummy2(vv1, vv2)[source]¶
Remove dummy values from 2 VVs.
New in version 5.0.8.
License: Geosoft End-User License
Note: Removes all indices where either
GXVV
has a dummy, or is not defined (due to length differences).
- classmethod remove_dummy3(vv1, vv2, vv3)[source]¶
Remove dummy values from 3 VVs.
New in version 5.0.8.
License: Geosoft End-User License
Note: Removes all indices where any
GXVV
has a dummy, or is not defined (due to length differences).
- classmethod remove_dummy4(vv1, vv2, vv3, vv4)[source]¶
Remove dummy values from 4 VVs.
- Parameters:
New in version 6.2.
License: Geosoft End-User License
Note: Removes all indices where any
GXVV
has a dummy, or is not defined (due to length differences).
- classmethod remove_dup(data_vv, sample_vv, output)[source]¶
Remove/average duplicate sample pairs from a database.
- Parameters:
output (int) – VV_DUP constants
New in version 5.0.
License: Geosoft End-User License
Note: Created for duplicate sample handling in
GXCHIMERA
. On input, a numeric or textGXVV
containing data values, and a sample typeGXVV
. 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 dataGXVV
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.
- classmethod remove_xy_dup(xvv, yvv, zvv, xy_dup)[source]¶
Remove/average duplicate samples with the same (X, Y).
- Parameters:
New in version 5.0.
License: Geosoft End-User License
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 constants. The returned VVs are shortened to the new length, without duplicates. The Z
GXVV
can be set to NULL on input, in which case it is ignored.
- classmethod remove_xy_dup_index(xvv, yvv, index_vv)[source]¶
Remove duplicate samples with the same (X, Y) and update index.
New in version 7.2.
License: Geosoft End-User License
Note: Searches for duplicated (X, Y) locations and removes the duplicates (can be more than just a pair). The Index
GXVV
is updated accordingly .i.e if (X,Y) location of Index[0] == Index[1] Index[1] is removed.
- classmethod rolling_stats(vv_i, vv_o, stat, window, shrink)[source]¶
Calculate a statistic in a rolling window.
- Parameters:
stat (int) – ST_INFO constants
window (int) – Window size (>0, increased to nearest odd value)
shrink (int) – Shrink window at ends (1:Yes, 0:No)
New in version 5.1.
License: Geosoft End-User License
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.
- classmethod search_replace(vv, val, rpl)[source]¶
Search and replace numeric values in a
GXVV
.- Parameters:
val (float) – Value to replace
rpl (float) – Replacement
New in version 5.0.
License: Geosoft End-User License
Note: Search comparison is made on double comparison of the data.
See also
SearchReplaceText_VV
- classmethod search_replace_text(vv, format, decimal, val, rpl, mode)[source]¶
Search and replace text values in a
GXVV
- Parameters:
format (int) – String format for numeric
GXVV
decimal (int) – Decimals for formating numeric
GXVV
val (str) – Formatted string to replace
rpl (str) – Replacement
mode (int) – VVU_SRCHREPL_CASE constants
New in version 5.0.
License: Geosoft End-User License
Note: Search comparison is made on string comparison of the data.
See also
SearchReplace_VV
- classmethod search_replace_text_ex(vv, format, decimal, val, rpl, mode, items)[source]¶
Search and replace text values in a
GXVV
, count items changed.- Parameters:
format (int) – String format for numeric
GXVV
decimal (int) – Decimals for formating numeric
GXVV
val (str) – Formatted string to replace
rpl (str) – Replacement
mode (int) – VVU_SRCHREPL_CASE constants
items (int_ref) – Number of items replaced (returned)
New in version 6.0.1.
License: Geosoft End-User License
Note: Search comparison is made on a string comparison of the data.
See also
SearchReplaceText_VV
- classmethod search_text(vv, text, case_sensitive, match, start, dir)[source]¶
Search for a text value in a
GXVV
- Parameters:
text (str) – Text to match
case_sensitive (int) – VVU_CASE constants
match (int) – VVU_MATCH constants
start (int) – Index to begin search (-1 for full
GXVV
)dir (int) – 1: forward search, -1: backward search
- Returns:
Index of first matching text, -1 if not found.
- Return type:
int
New in version 5.0.8.
License: Geosoft End-User License
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
GXVV
is searched. UseVVU_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
- classmethod spline(vv_x, vv_y, vv_o, length, start, incr, gap, ext, type)[source]¶
Spline a Y
GXVV
onto an XGXVV
.- Parameters:
vv_x (GXVV) – X (no dummies)
vv_y (GXVV) – Y to be splined (no dummies)
vv_o (GXVV) – Y output
length (int) – Output Length
start (float) – Starting Location
incr (float) – Separation Distance
gap (float) – Maximum gap to interpolate across
ext (int) – Number of elements to extend
type (int) – VVU_SPL constants
New in version 5.0.
License: Geosoft End-User License
- classmethod spline2(vv_x, vv_y, vv_x2, vv_o, type)[source]¶
Spline a Y
GXVV
onto an XGXVV
. Uses specified values of X in X2- Parameters:
vv_x (GXVV) – X (no dummies)
vv_y (GXVV) – Y to be splined (no dummies)
vv_x2 (GXVV) – X2 (no dummies)
vv_o (GXVV) – Y output
type (int) – VVU_SPL constants
New in version 5.1.3.
License: Geosoft End-User License
- classmethod tokenize_to_values(vv, str_val)[source]¶
Tokenize a string based on any characters.
- Parameters:
- Returns:
Number of tokens (length of
GXVV
)- Return type:
int
New in version 9.0.
License: Geosoft Open License
Note: Parses a series of space, tab or comma-delimited values to a
GXVV
.
- classmethod translate(vv, base, mult)[source]¶
Translate values in a
GXVV
- Parameters:
base (float) – Base
mult (float) – Scale
New in version 5.0.
License: Geosoft Open License
- classmethod trend(vv_d, order, vv_c)[source]¶
Calculate an n’th order best-fit polynomial, integral x.
- Parameters:
New in version 5.0.6.
License: Geosoft End-User License
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
GXVV
length is set to the number of coefficients (order + 1)See also
- classmethod trend2(vv_x, vv_d, order, vv_c)[source]¶
Calculate an n’th order best-fit polynomial, specified X
- Parameters:
New in version 5.0.6.
License: Geosoft End-User License
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
GXVV
(see Trend_VV for unitless X).The polynomial
GXVV
length is set to the number of coefficients (order + 1)See also
- classmethod uniform_dist(vv, seed, min, max, length)[source]¶
Fill with uniformly distributed values.
- Parameters:
New in version 5.1.8.
License: Geosoft End-User License
Note:
GXVV
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
TEM_ARRAY constants¶
Array Type
VV_DUP constants¶
Duplicate handling mode
VV_XYDUP constants¶
Sample handling
VVU_CASE constants¶
String case handling
VVU_CLIP constants¶
Type of clipping
VVU_DUMMYREPEAT constants¶
How to deal with repeats
VVU_INTERP constants¶
Interpolation method to use
VVU_INTERP_EDGE constants¶
Interpolation method to use on edges
VVU_LINE constants¶
Line Types
VVU_MASK constants¶
Type of clipping
VVU_MATCH constants¶
Matching style
VVU_MODE constants¶
Statistic to select
VVU_OFFSET constants¶
Heading
VVU_PRUNE constants¶
Prune options
VVU_SPL constants¶
Spline types
VVU_SRCHREPL_CASE constants¶
Search and Replace handling of string case