GXDBREAD class

class GXDBREAD(handle=0)

GXDBREAD class.

The GXDBREAD 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(chan)

Add a data channel to the GXDBREAD object.

Parameters:chan (int) – Channel handle (does not need to be locked, but can be.)
Returns:Channel index. Use for getting the correct GXVV or GXVA object.
Return type:int

New in version 8.5.

License: Geosoft Open License

classmethod create(db, line_lst)

Create a GXDBREAD object Add channels using the add_channel method.channel.

Parameters:
  • db (GXDB) – Database input
  • line_lst (GXLST) – List of lines to process NAME = line name, VALUE = line symbol
Returns:

GXDBREAD object

Return type:

GXDBREAD

New in version 8.5.

License: Geosoft Open License

classmethod create_xy(db, line_lst)

Create a GXDBREAD object for a XY-located data. Add channels using the add_channel method.

Parameters:
  • db (GXDB) – Database input
  • line_lst (GXLST) – List of lines to process NAME = line name, VALUE = line symbol
Returns:

GXDBREAD object

Return type:

GXDBREAD

New in version 8.5.

License: Geosoft Open License

classmethod create_xyz(db, line_lst)

Create a GXDBREAD object for a XYZ-located data. Add channels using the add_channel method.

Parameters:
  • db (GXDB) – Database input
  • line_lst (GXLST) – List of lines to process NAME = line name, VALUE = line symbol
Returns:

GXDBREAD object

Return type:

GXDBREAD

New in version 8.5.

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 8.5.

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 or get_va to access data for a channel.

get_next_block(line, block, n_blocks)

Get the next block of data.

Parameters:
  • line (int_ref) – (returned) The index into the input selected line list of the line whose data is contained in the current block
  • block (int_ref) – (returned) The block index (0 to NBlocks-1) for the current line of data.
  • n_blocks (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.

License: Geosoft Open License

Note: The next block of data is read and copied into the channel GXVV and/or GXVA objects, accessed using the get_vv and get_va functions.

get_number_of_blocks_to_process()

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.

License: Geosoft Open License

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

Get the X channel GXVV handle.

Returns:GXVV handle
Return type:GXVV

New in version 8.5.

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 handle
Return type:GXVV

New in version 8.5.

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 handle
Return type:GXVV

New in version 8.5.

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 returned GXVV is the “base” GXVV of the GXVA 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 handle
Return type:GXVA

New in version 8.5.

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 call GXVA.col on the returned GXVA handle. The GXVA 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 handle
Return type:GXVV

New in version 8.5.

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. The GXVV 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 GXDBREAD

Returns:A null GXDBREAD
Return type:GXDBREAD