geosoft.gxpy.vv submodule¶
Geosoft vector.
Classes: |
|
---|
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.
See also
Note
Regression tests provide usage examples: vv tests
-
class
GXvv
(array=None, dtype=None, fid=(0.0, 1.0), unit_of_measure='')¶ Bases:
object
VV class wrapper.
Parameters: - array – array-like, None to create an empty VV
- dtype – numpy data type. For unicode strings ‘U#’, where # is a string length. If not specified the type is taken from first element in array, of if no array the default is ‘float’.
- fid – (start, increment) fiducial
- unit_of_measure – unit of measure for the contained data.
Properties: vv
geosoft.gxapi.GXvv
instancefid
(start, increment) fiduciallength
number of elements in the VVgxtype
GX data typedtype
numpy data typeNew in version 9.1.
Changed in version 9.2: support construction directly from arrays
Changed in version 9.3: added unit_of_measure
-
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)¶ Return vv data in a numpy array
Parameters: - start – index of first value, must be >=0
- n – number of values wanted
- dtype – numpy data type wanted
Returns: (data, (fid_start, fid_incr))
New in version 9.1.
-
gxtype
¶ GX data type
New in version 9.1.
-
gxvv
¶ geosoft.gxapi.GXVV
instance
-
is_int
¶ True if a base integer type
-
length
¶ number of elements in the VV, can be set
New in version 9.1.
Changed in version 9.3: can be set
-
list
()¶ Return the content of the VV as a list.
New in version 9.2.
-
np
¶ Numpy array of VV data, in the data type of the VV. Use
get_data()
to get a numpy array in another dtype.Note that changing the data in the numpy array does NOT change the data in the VV. Use
set_data
to change data in the VV.New in version 9.2.
-
refid
(fid, length)¶ Resample VV to a new fiducial and length
Parameters: - fid – (start,incr)
- length – length
New in version 9.1.
-
set_data
(data, fid=None)¶ Set vv data from an array. If the array is float type numpy.nan are
Parameters: - data – data array, must be dimension 1
- fid – fid tuple (start,increment), default does not change
New in version 9.1.
Changed in version 9.3: default fid leaves fid unchanged
-
unit_of_measure
¶ data unit of measurement
-
exception
VVException
¶ Bases:
Exception
Exceptions from
geosoft.gxpy.vv
.New in version 9.1.