GXVA class

class GXVA(handle=0)

GXVA class.

The GXVA class is the 2-Dimensional analogue to the GXVV class. When displayed in a database, GXVA objects 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]. A GXVA object 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 a GXVV can be changed. Data can be added or extracted using VVs, either by row or column.

A GXVA is 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 a GXVA that is 256 elements wide.

add_elevations_vv_to_depths(vv, negative_depths)

Add one GXVV value to each row of the GXVA, output true elevation.

Parameters:
  • vv (GXVV) – Elevations to add
  • negative_depths (int) – Use negative GXVA depths (0:No, 1:Yes)?

New in version 7.2.

License: Geosoft End-User License

Note: Adds each value in an input elevation GXVV to all the values at the same fid in a depths GXVA. Includes an option for negative depths down (e.g. a relative level).

append(v_aa)

Appends VAs

Parameters:v_aa (GXVA) – GXVA to append

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)

Average elements in a GXVA by row or column

Parameters:

New in version 5.0.

License: Geosoft Open License

Note: The output GXVV will be dimensioned by the number of rows or columns in the input GXVV depending on the VA_AVERAGE constants setting.

Dummies are not included in the average.

check_for_repeating(vv_t, subtract_vv, vv_sub, tol)

Window a GXVA to a GXVV based 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 GXVV from 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 zero
  • tol (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)

Window a GXVA to a GXVV based 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 GXVV from 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 zero
  • tol (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()

Return number of columns in GXVA

Returns:Columns in GXVA
Return type:int

New in version 5.0.

License: Geosoft Open License

Note: len returns the number of rows.

copy(v_as)

Copy one GXVA to 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)

Copy part of a vector into part of another vector.

Parameters:
  • d_row (int) – Destination start row
  • d_col (int) – Destination start column
  • v_as (GXVA) – Source GXVA (can be the same as Destination)
  • s_row (int) – Source start row
  • s_col (int) – Source start column
  • rows (int) – Number of rows
  • cols (int) – Number of columns

New in version 5.0.

License: Geosoft Open License

Note: 1. Unlike copy destination GXVA is not reallocated, nor are the dimensions changed. The caller must make any desired changes.

2. All GXVA types are supported and will be converted using Convert_GS if necessary.

classmethod create(type, rows, cols)

Create a GXVA.

Parameters:
  • type (int) – GEO_VAR constants
  • rows (int) – Maximum number of rows in the GXVA, >= 0
  • cols (int) – Number of columns in the GXVA, > 0
Returns:

GXVA Object

Return type:

GXVA

New in version 5.0.

License: Geosoft Open License

classmethod create_ext(type, rows, cols)

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, >= 0
  • cols (int) – Number of columns in the GXVA, > 0
Returns:

GXVA, aborts if creation fails

Return type:

GXVA

New in version 5.0.

License: Geosoft Open License

Note: See GXVV.create

classmethod create_vv(vv, rows, columns)

Create a GXVA using the data in a GXVV.

Parameters:
  • vv (GXVV) – GXVV with the data
  • rows (int) – # of rows
  • columns (int) – # of columns
Returns:

GXVA, aborts if creation fails

Return type:

GXVA

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)

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 GXVA data into
  • gs_type (int) – GS_TYPES constants

New in version 5.0.

License: Geosoft Open License

get_double(row, col)

Get a real element from a GXVA.

Parameters:
  • row (int) – Row
  • col (int) – Column
Returns:

Element wanted, rDUMMY, iDUMMY or 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()

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()

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()

Get the full GXVV from the GXVA.

Returns:GXVV Object
Return type:GXVV

New in version 5.0.

License: Geosoft Open License

Note: No data is copied, this is the handle to the data GXVV in the GXVA. The fid start/increment of the GXVA is passed to the GXVV at the time of the call. If a new GXVA is read, you must call GetFull_VV_VA to get the new fid in the GXVV.

get_int(row, col)

Get an integer element from a GXVA.

Parameters:
  • row (int) – Row
  • col (int) – Column
Returns:

Element wanted, rDUMMY, iDUMMY or 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)

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, iDUMMY or 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)

Get a row or column of data as a GXVV from an array.

Parameters:

New in version 5.0.

License: Geosoft Open License

classmethod index_order(vv, va)

Reorder a GXVA based on an index GXVV

Parameters:

New in version 5.1.

License: Geosoft Open License

Note: Given a row index GXVV (of type INT), this method reorders a GXVA. Please make sure that the index holds valid information.

is_null()

Check if this is a null (undefined) instance

Returns:True if this is a null (undefined) instance, False otherwise.
Return type:bool
len()

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: col returns the number of columns.

lookup_index(vvi, var)

Lookup a GXVA from another GXVA using an index GXVV.

Parameters:

New in version 6.4.2.

License: Geosoft End-User License

Note: Fractional values in the GXVV will interpolate between the value at the whole integer value and the next whole integer, dummy if outside the GXVA.

classmethod null()

A null (undefined) instance of GXVA

Returns:A null GXVA
Return type:GXVA
range_double(min, max)

Computes the minimum and maximum range of the data, in doubles, in a vector while ignoring dummies.

Parameters:
  • min (float_ref) – Minimum value - returned
  • max (float_ref) – Maximum value - returned

New in version 5.0.

License: Geosoft Open License

re_fid(start, incr, length)

Re-sample a GXVA to 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()

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)

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 GXVA
  • gs_type (int) – GS_TYPES constants

New in version 5.0.

License: Geosoft Open License

set_double(row, col, value)

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 GXVA length, the GXVA length is increased.

set_fid_incr(incr)

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)

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)

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 GXVA length, the GXVA length is increased.

set_ln(rows)

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 GXVA is fixed, and cannot be altered once the GXVA is created.

set_string(row, col, value)

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 GXVA length, the GXVA length is increased.

set_vv(no, row_col, vv)

Set a row or column of data in an array from a GXVV.

Parameters:

New in version 5.0.

License: Geosoft Open License

trans(base, mult)

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 GXVA types using an internal double GXVV.

window(start, count, vv)

Window a GXVA to a GXVV based in intergral frame

Parameters:
  • start (int) – First element in the window
  • count (int) – Number of elements in the window
  • vv (GXVV) – GXVV in which to place results

New in version 5.0.

License: Geosoft Open License

Note: The defined window must be within the GXVA element 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)

Window a GXVA to a GXVV based on fractional frame

Parameters:
  • start (float) – Start point (from 0.0)
  • end (float) – End point (< GXVA elements - 1.0)
  • vv (GXVV) – GXVV in which to place results

New in version 5.0.

License: Geosoft Open License

Note: The defined window must be within the GXVA element 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_AVERAGE_ROWS

Average the Rows

gxapi.VA_AVERAGE_ROWS = 0
VA_AVERAGE_COLUMNS

Average the Columns

gxapi.VA_AVERAGE_COLUMNS = 1

VA_OBJECT constants

GXVA Object to select

VA_ROW

Row

gxapi.VA_ROW = 0
VA_COL

Column

gxapi.VA_COL = 1