GXVA class¶
- class GXVA(handle=0)[source]¶
GXVA class.
The
GXVAclass is the 2-Dimensional analogue to theGXVVclass. When displayed in a database,GXVAobjects are displayed graphically as profiles, one to a cell, and can also be displayed one column of data at a time by specifying an index; e.g. CH[0]. AGXVAobject is declared with a fixed number of columns, which cannot be altered. The number of rows, however can be changed, in the same way that the length of aGXVVcan be changed. Data can be added or extracted using VVs, either by row or column.A
GXVAis used to store an array of data in which each element may have multiple elements. For example, 256-channel radiometric data can be stored in aGXVAthat is 256 elements wide.- add_elevations_vv_to_depths(vv, negative_depths)[source]¶
Add one
GXVVvalue to each row of theGXVA, output true elevation.- Parameters:
New in version 7.2.
License: Geosoft End-User License
Note: Adds each value in an input elevation
GXVVto all the values at the same fid in a depthsGXVA. Includes an option for negative depths down (e.g. a relative level).
- append(v_aa)[source]¶
Appends VAs
New in version 5.1.3.
License: Geosoft Open License
Note: If the VAs have different numbers of columns, the smaller number is used in the copy operation.
- average(vv, rc)[source]¶
Average elements in a
GXVAby row or column- Parameters:
rc (int) – VA_AVERAGE constants
New in version 5.0.
License: Geosoft Open License
Note: The output
GXVVwill be dimensioned by the number of rows or columns in the inputGXVVdepending on the VA_AVERAGE constants setting.Dummies are not included in the average.
- check_for_repeating(vv_t, subtract_vv, vv_sub, tol)[source]¶
Window a
GXVAto aGXVVbased on fractional frame- Parameters:
vv_t (GXVV) – Items to test for repeats (length equal to the number of columns in the
GXVA)subtract_vv (int) – If set to 1, subtract single values in the following
GXVVfrom every array row item before testing (e.g. an elevation value)vv_sub (GXVV) – Values to subtract from each row before doing the comparison test (length equal to the length of the
GXVA). Can be VV_NULL (-1) if above subtraction parameter is zerotol (float) – Comparison tolerance - set to zero or dummy for exact match
- Returns:
1 if rows repeat, 0 if not.
- Return type:
int
New in version 8.2.
License: Geosoft End-User License
Note: Returns 1 if all rows contain values which match the input values. Optionally, row values can be offset by amounts specified with a secondary
GXVV. This function was designed to detect “depth” array channels, including those which might have been offset with topography on each row. An absolute tolerance can be specified to ignore numerical noise.
- check_for_repeating2(vv_t, subtract_vv, vv_sub, tol, bad_row, bad_col)[source]¶
Window a
GXVAto aGXVVbased on fractional frame- Parameters:
vv_t (GXVV) – Items to test for repeats (length equal to the number of columns in the
GXVA)subtract_vv (int) – If set to 1, subtract single values in the following
GXVVfrom every array row item before testing (e.g. an elevation value)vv_sub (GXVV) – Values to subtract from each row before doing the comparison test (length equal to the length of the
GXVA). Can be VV_NULL (-1) if above subtraction parameter is zerotol (float) – Comparison tolerance - set to zero or dummy for exact match
bad_row (int_ref) – Row index of first mismatch
bad_col (int_ref) – Column index of first mismatch
- Returns:
1 if rows repeat, 0 if not.
- Return type:
int
New in version 8.2.
License: Geosoft End-User License
Note: Returns 1 if all rows contain values which match the input values. Optionally, row values can be offset by amounts specified with a secondary
GXVV. This function was designed to detect “depth” array channels, including those which might have been offset with topography on each row. An absolute tolerance can be specified to ignore numerical noise. This version returns the row and column index of first mismatch.
- col()[source]¶
Return number of columns in
GXVA- Returns:
Columns in
GXVA- Return type:
int
New in version 5.0.
License: Geosoft Open License
Note:
lenreturns the number of rows.
- copy(v_as)[source]¶
Copy one
GXVAto another.- Parameters:
v_as (GXVA) – source
New in version 5.0.
License: Geosoft Open License
- copy2(d_row, d_col, v_as, s_row, s_col, rows, cols)[source]¶
Copy part of a vector into part of another vector.
- Parameters:
New in version 5.0.
License: Geosoft Open License
Note: 1. Unlike
copydestinationGXVAis not reallocated, nor are the dimensions changed. The caller must make any desired changes.2. All
GXVAtypes are supported and will be converted using Convert_GS if necessary.
- classmethod create(type, rows, cols)[source]¶
Create a
GXVA.- Parameters:
type (int) – GEO_VAR constants
rows (int) – Maximum number of rows in the
GXVA, >= 0cols (int) – Number of columns in the
GXVA, > 0
- Returns:
GXVAObject- Return type:
New in version 5.0.
License: Geosoft Open License
- classmethod create_ext(type, rows, cols)[source]¶
Create a
GXVA, using one of the GS_TYPES constants special data types.- Parameters:
type (int) – GS_TYPES constants
rows (int) – Maximum number of rows in the
GXVA, >= 0cols (int) – Number of columns in the
GXVA, > 0
- Returns:
GXVA, aborts if creation fails- Return type:
New in version 5.0.
License: Geosoft Open License
Note: See
GXVV.create
- classmethod create_vv(vv, rows, columns)[source]¶
Create a
GXVAusing the data in aGXVV.- Parameters:
- Returns:
GXVA, aborts if creation fails- Return type:
New in version 7.2.1.
License: Geosoft Open License
Note: See
GXVV.create
- get_array(start_row, start_col, rows, cols, data, gs_type)[source]¶
Get an array of data from a
GXVA.- Parameters:
start_row (int) – Starting Row
start_col (int) – Starting Column
rows (int) – # rows
cols (int) – # cols
data (bytearray) – Data buffer to copy
GXVAdata intogs_type (int) – GS_TYPES constants
New in version 5.0.
License: Geosoft Open License
- get_double(row, col)[source]¶
Get a real element from a
GXVA.- Parameters:
row (int) – Row
col (int) – Column
- Returns:
Element wanted,
rDUMMY,iDUMMYor blank string if the value is dummy or outside of the range of data.- Return type:
float
New in version 5.0.
License: Geosoft Open License
Note: Type conversions are performed if necessary. Dummy values are converted to “*” string.
- get_fid_incr()[source]¶
Gets the Fiducial increment from a
GXVA- Returns:
Fiducial increment of the
GXVA.- Return type:
float
New in version 5.0.
License: Geosoft Open License
- get_fid_start()[source]¶
Gets the Fiducial start from a
GXVA- Returns:
Fiducial start of the
GXVA.- Return type:
float
New in version 5.0.
License: Geosoft Open License
- get_full_vv()[source]¶
Get the full
GXVVfrom theGXVA.New in version 5.0.
License: Geosoft Open License
Note: No data is copied, this is the handle to the data
GXVVin theGXVA. The fid start/increment of theGXVAis passed to theGXVVat the time of the call. If a newGXVAis read, you must call GetFull_VV_VA to get the new fid in theGXVV.
- get_int(row, col)[source]¶
Get an integer element from a
GXVA.- Parameters:
row (int) – Row
col (int) – Column
- Returns:
Element wanted,
rDUMMY,iDUMMYor blank string if the value is dummy or outside of the range of data.- Return type:
int
New in version 5.0.
License: Geosoft Open License
Note: Type conversions are performed if necessary. Dummy values are converted to “*” string.
- get_string(row, col, str_val)[source]¶
Get a string element from a
GXVA.- Parameters:
row (int) – Row
col (int) – Column
str_val (str_ref) – String in which to place element
New in version 5.0.
License: Geosoft Open License
Note: Returns element wanted,
rDUMMY,iDUMMYor blank string if the value is dummy or outside of the range of data.Type conversions are performed if necessary. Dummy values are converted to “*” string.
- get_vv(no, row_col, vv)[source]¶
Get a row or column of data as a
GXVVfrom an array.- Parameters:
no (int) – Row or Column # (0 is first)
row_col (int) – VA_OBJECT constants
New in version 5.0.
License: Geosoft Open License
- classmethod index_order(vv, va)[source]¶
Reorder a
GXVAbased on an indexGXVVNew in version 5.1.
License: Geosoft Open License
Note: Given a row index
GXVV(of type INT), this method reorders aGXVA. Please make sure that the index holds valid information.
- 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
- len()[source]¶
Return length (number of rows) in a
GXVA.- Returns:
Length of
GXVA- Return type:
int
New in version 5.0.
License: Geosoft Open License
Note:
colreturns the number of columns.
- lookup_index(vvi, var)[source]¶
Lookup a
GXVAfrom anotherGXVAusing an indexGXVV.- Parameters:
New in version 6.4.2.
License: Geosoft End-User License
Note: Fractional values in the
GXVVwill interpolate between the value at the whole integer value and the next whole integer, dummy if outside theGXVA.
- range(startRow, startCol, rows, columns, min, max)[source]¶
Computes the minimum and maximum range of the data, in doubles, in a vector while ignoring dummies, for a range of columns and rows.
- Parameters:
New in version 9.6.
License: Geosoft Open License
- range_columns(startRow, startCol, rows, columns, minimums, maximums)[source]¶
Computes the minimum and maximum range of the data for individual columns, in doubles, for a range of columns and rows.
- Parameters:
startRow (int) – Starting row (0 to nRows-1)
startCol (int) – Starting column (0 to nColumns-1
rows (int) – Number of rows (-1 for all from start)
columns (int) – Number of columns (-1 for all from start)
minimums (GXVV) – Minimum values returned:
VVobject - GS_REALmaximums (GXVV) – Maximum values returned:
VVobject - GS_REAL
New in version 9.6.
License: Geosoft Open License
- range_double(min, max)[source]¶
Computes the minimum and maximum range of the data, in doubles, in a vector while ignoring dummies.
New in version 5.0.
License: Geosoft Open License
- re_fid(start, incr, length)[source]¶
Re-sample a
GXVAto a new fid start/icrement- Parameters:
start (float) – New fid start
incr (float) – New fid increment
length (int) – New length
New in version 5.0.
License: Geosoft Open License
- reverse()[source]¶
Reverses the order of the rows in a
GXVA.New in version 5.1.5.
License: Geosoft Open License
- set_array(start_row, start_col, rows, cols, data, gs_type)[source]¶
Set a range of data in an array
- Parameters:
start_row (int) – Starting Row
start_col (int) – Starting Column
rows (int) – # rows
cols (int) – # cols
data (bytearray) – Data buffer to copy into
GXVAgs_type (int) – GS_TYPES constants
New in version 5.0.
License: Geosoft Open License
- set_double(row, col, value)[source]¶
Set a real element in a
GXVA.- Parameters:
row (int) – Row
col (int) – Column
value (float) – Value to set
New in version 5.0.
License: Geosoft Open License
Note: Element being set cannot be < 0. If the element is > current
GXVAlength, theGXVAlength is increased.
- set_fid_incr(incr)[source]¶
Sets the Fiducial increment of a
GXVA- Parameters:
incr (float) – New increment
New in version 5.0.
License: Geosoft Open License
- set_fid_start(start)[source]¶
Sets the Fiducial start of a
GXVA- Parameters:
start (float) – New start
New in version 5.0.
License: Geosoft Open License
- set_int(row, col, value)[source]¶
Set an integer element in a
GXVA.- Parameters:
row (int) – Row
col (int) – Column
value (int) – Value to set
New in version 5.0.
License: Geosoft Open License
Note: Element being set cannot be < 0. If the element is > current
GXVAlength, theGXVAlength is increased.
- set_int_n(start, n, value)[source]¶
Set N rows of integer elements in a
GXVA.- Parameters:
start (int) – Start row index (>= 0)
n (int) – # of rows to set (-1 sets all rows to end)
value (int) – Value to set
New in version 2023.2.
License: Geosoft Open License
Note: Element row starting index being set cannot be < 0. If the element row index is >= current
GXVAlength, theGXVAlength is increased.
- set_ln(rows)[source]¶
Set the length (number of rows) of the
GXVA- Parameters:
rows (int) – Length
New in version 5.0.
License: Geosoft Open License
Note: The number of columns in a
GXVAis fixed, and cannot be altered once theGXVAis created.
- set_string(row, col, value)[source]¶
Set a string element in a
GXVA.- Parameters:
row (int) – Row
col (int) – Column
value (str) – String to set
New in version 5.0.
License: Geosoft Open License
Note: Element being set cannot be < 0. If the element is > current
GXVAlength, theGXVAlength is increased.
- set_vv(no, row_col, vv)[source]¶
Set a row or column of data in an array from a
GXVV.- Parameters:
no (int) – Row or Column # (0 is first)
row_col (int) – VA_OBJECT constants
New in version 5.0.
License: Geosoft Open License
- trans(base, mult)[source]¶
Translate (
GXVA+ base ) * mult- Parameters:
base (float) – Base value
mult (float) – Mult value
New in version 7.2.
License: Geosoft End-User License
Note: Supports all
GXVAtypes using an internal doubleGXVV.
- window(start, count, vv)[source]¶
Window a
GXVAto aGXVVbased in intergral frame- Parameters:
New in version 5.0.
License: Geosoft Open License
Note: The defined window must be within the
GXVAelement dimensions. The windowed result will be the simple sum of all values in the window. If any values are dummy, the result will be dummy.
- window2(start, end, vv)[source]¶
Window a
GXVAto aGXVVbased on fractional frame- Parameters:
New in version 5.0.
License: Geosoft Open License
Note: The defined window must be within the
GXVAelement dimensions. The windowed result will be the simple sum of all values in the window. If any values are dummy, the result will be dummy.
VA_AVERAGE constants¶
GXVA Object to average
VA_OBJECT constants¶
GXVA Object to select