geosoft.gxpy.va submodule

Geosoft vector arrays (vector of array elements)

Classes:
GXva vector of array elements

VA and VV classes are related based on a key called a fiducial, which has a start value and increment between values. The refid() method can be used to resample vector data to the same fiducial so that vector-to-vector operations can be performed.

Note

Regression tests provide usage examples: va tests

class GXva(array=None, width=None, dtype=None, fid=(0.0, 1.0), unit_of_measure='')

Bases: object

VA class wrapper.

Parameters:
  • array – 2D numpy array, None for an empty VA
  • dtype – numpy data type, default np.float
  • width – array width, default is determined from array.
  • fid – fid tuple (start,increment), default (0.0, 1.0)
  • unit_of_measure – the unit of measurement for the data

Maximum number of elements must be less that 2^31 - 1

Changed in version 9.3: added unit_of_measure

Changed in version 9.2: allow construction directly from numpy array

New in version 9.1.

dimensions

VA dimensions (length, width)

New in version 9.2.

dtype

numpy data type

New in version 9.1.

fid

fid tuple (start,increment), can be set

New in version 9.1.

get_data(dtype=None, start=0, n=None, start_col=0, n_col=None)

Return a numpy array of data from a va.

Parameters:
  • start – index of first value, must be >=0
  • n – number of values wanted
  • start_col – index of the first column wanted
  • n_col – number of columns
  • dtype – numpy data type wanted

New in version 9.1.

gxtype

GX data type

New in version 9.1.

gxva

The geosoft.gxapi.GXVA instance handle.

..versionadded:: 9.3

length

number of elements in the VA, can be set.

New in version 9.1.

Changed in version 9.3: can be set

np

Numpy array of VA data, in the data type of the VA. Use get_data() to get a numpy array in another dtype. Array will be 2-dimensional.

New in version 9.2.

refid(fid, length)

Resample VA to a new fiducial and length

Parameters:
  • fid – (start,incr)
  • length – length

New in version 9.1.

set_data(npdata, fid=(0.0, 1.0))

Copy numpy data into a VA.

Parameters:
  • npdata – numpy data array (must be 2D)
  • fid – fid tuple (start,increment), default (0.0,1.0)

Maximum number of elements must be less that 2^31 - 1

New in version 9.1.

unit_of_measure

data unit of measurement

width

width of each row(element) in the VA

New in version 9.1.

exception VAException

Bases: Exception

Exceptions from geosoft.gxpy.va.

New in version 9.1.