GXDBWRITE class¶
-
class
GXDBWRITE
(handle=0)¶ GXDBWRITE class.
The
GXDBWRITE
class is used to open and write to databases. Large blocks of data are split into blocks and served up sequentially to prevent the over-use of virtual memory when VVs or VAs are being written to channels. Individual data blocks are limited by default to 1 MB (which is user-alterable). Data less than the block size are served up whole, one block per line.-
add_block
(line)¶ Add the current block of data.
Parameters: line (int) – Line New in version 9.0.
License: Geosoft Open License
Note: First, set up the data for each channel by copying values into the individual channel VVs and VAs.
-
add_channel
(chan)¶ Add a data channel to the
GXDBWRITE
object.Parameters: chan (int) – Channel handle (does not need to be locked, but can be.) Returns: Channel index. Use for getting the correct GXVV
orGXVA
object.Return type: int New in version 9.0.
License: Geosoft Open License
-
commit
()¶ Commit remaining data to the database.
New in version 9.0.
License: Geosoft Open License
-
classmethod
create
(db)¶ Create a
GXDBWRITE
object Add channels using theadd_channel
method.channel.Parameters: db (GXDB) – Database input Returns: GXDBWRITE
objectReturn type: GXDBWRITE New in version 9.0.
License: Geosoft Open License
-
classmethod
create_xy
(db)¶ Create a
GXDBWRITE
object for a XY-located data. Add channels using theadd_channel
method.Parameters: db (GXDB) – Database input Returns: GXDBWRITE
objectReturn type: GXDBWRITE New in version 9.0.
License: Geosoft Open License
-
classmethod
create_xyz
(db)¶ Create a
GXDBWRITE
object for a XYZ-located data. Add channels using theadd_channel
method.channelParameters: db (GXDB) – Database input Returns: GXDBWRITE
objectReturn type: GXDBWRITE New in version 9.0.
License: Geosoft Open License
-
get_chan_array_size
(chan)¶ Get the number of columns of data in a channel.
Parameters: chan (int) – Index of channel to access. Returns: The number of columns (array size) for a channel Return type: int New in version 9.0.
License: Geosoft Open License
Note: Regular channels have one column of data. Array channels have more than one column of data. This function should be called to determine whether to use
get_vv
orget_va
to access data for a channel.
-
get_db
()¶ Get the output
GXDB
handle from theGXDBWRITE
object.Returns: GXDB
handleReturn type: GXDB New in version 9.0.
License: Geosoft Open License
-
get_v_vx
()¶ Get the X channel
GXVV
handle.Returns: GXVV
handleReturn type: GXVV New in version 9.0.
License: Geosoft Open License
Note: Only available for the CreateXY or CreateXYZ methods. The
GXVV
is filled anew for each block served up.
-
get_v_vy
()¶ Get the Y channel
GXVV
handle.Returns: GXVV
handleReturn type: GXVV New in version 9.0.
License: Geosoft Open License
Note: Only available for the CreateXY or CreateXYZ methods. The
GXVV
is filled anew for each block served up.
-
get_v_vz
()¶ Get the Z channel
GXVV
handle.Returns: GXVV
handleReturn type: GXVV New in version 9.0.
License: Geosoft Open License
Note: Only available for the CreateXY or CreateXYZ methods. The
GXVV
is filled anew for each block served up. If the Z channel is an array channel, the returnedGXVV
is the “base”GXVV
of theGXVA
and contains all items sequentially.
-
get_va
(chan)¶ Get the
GXVA
handle for an array channel.Parameters: chan (int) – Index of channel to access. Returns: GXVA
handleReturn type: GXVA New in version 9.0.
License: Geosoft Open License
Note: Call only for array (multi-column) channels. You can call the
get_chan_array_size
function to find the number fo columns in a given channel, or you can callGXVA.col
on the returnedGXVA
handle. TheGXVA
is filled anew for each block served up.
-
get_vv
(chan)¶ Get the
GXVV
handle for a channel.Parameters: chan (int) – Index of channel to access. Returns: GXVV
handleReturn type: GXVV New in version 9.0.
License: Geosoft Open License
Note: Call only for single-column (regular) channels. You can call the
get_chan_array_size
function to find the number fo columns in a given channel. TheGXVV
is filled anew for each block served up.
-
is_null
()¶ Check if this is a null (undefined) instance
Returns: True if this is a null (undefined) instance, False otherwise. Return type: bool
-
classmethod
null
()¶ A null (undefined) instance of
GXDBWRITE
Returns: A null GXDBWRITE
Return type: GXDBWRITE
-
test_func
(ra)¶ Temporary test function.
Parameters: ra (GXRA) – GXRA
handle to text file to import.New in version 9.0.
License: Geosoft Open License
Note: Designed to import the “Massive.xyz” file, which has data in the format “X Y Z Data”.
-