GXDBREAD class

class geosoft.gxapi.GXDBREAD
The DBREAD class is used to open and read from databases. Very large lines
  are split into blocks and served up sequentially to prevent the over-use of virtual memory when channels are read into VVs or VAs.
  Individual data blocks are limited by default to 1 MB (which is user-alterable). Single lines smaller than the block size
  are served up whole, one block per line.
add_channel((int)arg1) → int:
Add a data channel to the DBREAD object.
Parameters:arg1 (int) – Channel handle (does not need to be locked, but can be.)
Returns:Channel index. Use for getting the correct VV or VA object.
Return type:int

New in version 8.5.0.

static create((GXDB)arg1, (GXLST)arg2) → GXDBREAD:
Create a DBREAD object
Add channels using the geosoft.gxapi.GXDBREAD.add_channel()() method.channel.
Parameters:
Returns:

DBREAD object

Return type:

geosoft.gxapi.GXDBREAD

New in version 8.5.0.

static create_xy((GXDB)arg1, (GXLST)arg2) → GXDBREAD:
Create a DBREAD object for a XY-located data. Add channels using the
                            geosoft.gxapi.GXDBREAD.add_channel()() method.
Parameters:
Returns:

DBREAD object

Return type:

geosoft.gxapi.GXDBREAD

New in version 8.5.0.

static create_xyz((GXDB)arg1, (GXLST)arg2) → GXDBREAD:
Create a DBREAD object for a XYZ-located data.
Add channels using the geosoft.gxapi.GXDBREAD.add_channel()() method.channel
Parameters:
Returns:

DBREAD object

Return type:

geosoft.gxapi.GXDBREAD

New in version 8.5.0.

get_chan_array_size((int)arg1) → int:
Get the number of columns of data in a channel.
Parameters:arg1 (int) – Index of channel to access.
Returns:The number of columns (array size) for a channel
Return type:int

New in version 8.5.0.

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 geosoft.gxapi.GXDBREAD.get_vv() or geosoft.gxapi.GXDBREAD.get_va() to access data
for a channel.
get_next_block((int_ref)arg1, (int_ref)arg2, (int_ref)arg3) → int:
Get the next block of data.
Parameters:
  • arg1 (geosoft.gxapi.int_ref) – (returned) The index into the input selected line list of the line whose data is contained in the current block
  • arg2 (geosoft.gxapi.int_ref) – (returned) The block index (0 to NBlocks-1) for the current line of data.
  • arg3 (geosoft.gxapi.int_ref) – (returned) The number of blocks that the current line is split into.
Returns:

Returns the current block index, or -1 if at end of file (no new data returned).

Return type:

int

New in version 8.5.0.

Note:

The next block of data is read and copied into the channel VV and/or VA objects, accessed using
the geosoft.gxapi.GXDBREAD.get_vv() and geosoft.gxapi.GXDBREAD.get_va() functions.
get_number_of_blocks_to_process() → int:
Get the number of blocks to be served up.
Returns:The number of blocks to process in the selected lines.
Return type:int

New in version 8.5.0.

Note:

The selected lines are scanned. All lines where the served up data is less than the maximum block size for
all channels are served as a single block. Any lines where any channel's data exceeds the maximum block size are split up into blocks.
The value returned can be used as the progress message maximum iteration value.
get_v_vx() → GXVV:
Get the X channel VV handle.
Returns:VV handle
Return type:geosoft.gxapi.GXVV

New in version 8.5.0.

Note:

Only available for the CreateXY or CreateXYZ methods.
The VV is filled anew for each block served up.
get_v_vy() → GXVV:
Get the Y channel VV handle.
Returns:VV handle
Return type:geosoft.gxapi.GXVV

New in version 8.5.0.

Note:

Only available for the CreateXY or CreateXYZ methods.
The VV is filled anew for each block served up.
get_v_vz() → GXVV:
Get the Z channel VV handle.
Returns:VV handle
Return type:geosoft.gxapi.GXVV

New in version 8.5.0.

Note:

Only available for the CreateXY or CreateXYZ methods.
The VV is filled anew for each block served up.
If the Z channel is an array channel, the returned VV is the "base" VV of the VA and contains all items sequentially.
get_va((int)arg1) → GXVA:
Get the VA handle for an array channel.
Parameters:arg1 (int) – Index of channel to access.
Returns:VA handle
Return type:geosoft.gxapi.GXVA

New in version 8.5.0.

Note:

Call only for array (multi-column) channels. You can call the geosoft.gxapi.GXDBREAD.get_chan_array_size()
function to find the number fo columns in a given channel, or you can call geosoft.gxapi.GXVA.col() on the returned VA handle.
The VA is filled anew for each block served up.
get_vv((int)arg1) → GXVV:
Get the VV handle for a channel.
Parameters:arg1 (int) – Index of channel to access.
Returns:VV handle
Return type:geosoft.gxapi.GXVV

New in version 8.5.0.

Note:

Call only for single-column (regular) channels. You can call the geosoft.gxapi.GXDBREAD.get_chan_array_size()
                      function to find the number fo columns in a given channel.
                 The VV is filled anew for each block served up.
is_null() → bool

Check if the instance of geosoft.gxapi.GXDBREAD is null (undefined)

Returns:True if this is a null instance of geosoft.gxapi.GXDBREAD, False otherwise.
Return type:bool`
static null() → GXDBREAD

A null (undefined) instance of geosoft.gxapi.GXDBREAD

Returns:A null geosoft.gxapi.GXDBREAD
Return type:geosoft.gxapi.GXDBREAD