GXDB class

class GXDB(handle=0)

GXDB class.

The GXDB class is used to create, open and work with databases and database symbols. Database symbols are objects inside databases, such as lines, channels and blobs

Note:

The following defines are not used by any methods but are used by GX’s:

DB_ACTIVITY_BLOB

add_associated_load(group, chan)

Add this channel to the auto-load feature of the group.

Parameters:
  • group (int) – Line
  • chan (int) – Channel

New in version 5.0.

License: Geosoft Open License

Note: If the channel is not yet associated, it is first associated. If the channel is already in the associated-load list, this does nothing.

As of v6.0, the load-status of channels is no longer stored in the database, but in the project, so this function is equivalent to calling associate.

add_comment(comment, str_val, indent)

Add a comment with a string to the activity log of the database.

Parameters:
  • comment (str) – Comment
  • str_val (str) – String
  • indent (int) – Indent comment one tab? (TRUE or FALSE)

New in version 5.0.8.

License: Geosoft Open License

Note: The comment is written in the form:

Comment: String2

and is followed by a carriage return. The activity log is created automatically if it does not exist.

add_double_comment(comment, val, indent)

Add a comment with a float value to the activity log of the database.

Parameters:
  • comment (str) – Comment
  • val (float) – Value
  • indent (bool) – Indent comment one tab?

New in version 5.0.8.

License: Geosoft Open License

Note: The comment is written in the form:

Comment: Value

and if followed by a carriage return. The activity log is created automatically if it does not exist.

See Notes in add_comment.

add_int_comment(comment, val, indent)

Add a comment with an integer to the activity log of the database.

Parameters:
  • comment (str) – Comment
  • val (int) – Value
  • indent (bool) – Indent comment one tab?

New in version 5.0.8.

License: Geosoft Open License

Note: The comment is written in the form:

Comment: Value

and is followed by a carriage return. The activity log is created automatically if it does not exist.

See Notes in add_comment.

add_time_comment(comment, indent)

Add a comment with the date and time to the activity log of the database.

Parameters:
  • comment (str) – Comment
  • indent (bool) – Indent comment one tab?

New in version 5.0.8.

License: Geosoft Open License

Note: The comment is written in the form:

Comment: 2001/12/31 23:59:59

and is followed by a carriage return. The activity log is created automatically if it does not exist.

See Notes in add_comment.

array_lst(lst)

Load a GXLST object with array (GXVA) channel symbols.

Parameters:lst (GXLST) – List to Populate

New in version 5.0.

License: Geosoft Open License

array_size_lst(columns, lst)

Load a GXLST object with array (GXVA) channel symbols with a particular number of columns.

Parameters:
  • columns (int) – Number of columns in array ( > 1 )
  • lst (GXLST) – List to Populate

New in version 8.2.

License: Geosoft Open License

associate(group, chan)

Associate a channel with a group.

Parameters:
  • group (int) – Group line
  • chan (int) – Channel

New in version 5.0.

License: Geosoft Open License

Note: If it is already associated, or if the group has no defined group class, does nothing.

As of v6.3, if a group line has no class defined, then ALL channels are assumed to be associated with it. This means that you need to associate a new channel with a group only in those cases where the group class is defined.

If this function is used on a group with a group class, then the channel is added to class’s association list, and the channel will be recognized as being associated with all groups of that class.

associate_all(group)

Associate all channels with a group.

Parameters:group (int) – Group line

New in version 5.0.

License: Geosoft Open License

Note: As of v6.3, if a group line has no class defined, then ALL channels are already assumed to be associated with it, and this function does nothing.

associate_class(chan, cl)

Associate a channel with all groups of a specific class.

Parameters:
  • chan (int) – Channel
  • cl (str) – Class name of groups to associate the channel with. (Must be defined).

New in version 5.1.1.

License: Geosoft Open License

Note: As of v6.3, if a group line has no class defined, then ALL channels are automatically assumed to be associated with it.

blobs_max()

Gets Maximum Number of Blobs in the Database

Returns:Maximum Number of Blobs in the Database
Return type:int

New in version 5.1.1.

License: Geosoft Open License

classmethod can_open(file, user, password)

This method checks whether it is possible to open a database.

Parameters:
  • file (str) – Name of the Database File to Open
  • user (str) – Name of the user (“SUPER” normally)
  • password (str) – Password of the user (“” normally)
Return type:

bool

New in version 6.1.

License: Geosoft Open License

Note: This method is useful to determine if another session already locked a database. By using this method before an open a GX may handle errors like this more gracefully.

classmethod can_open_read_only(file, user, password)

This method checks whether it is possible to open a database in read-only mode.

Parameters:
  • file (str) – Name of the Database File to Open
  • user (str) – Name of the user (“SUPER” normally)
  • password (str) – Password of the user (“” normally)
Return type:

bool

New in version 6.4.2.

License: Geosoft Open License

Note: This method is useful to determine if another session already locked a database. By using this method before an open_read_only a GX may handle errors like this more gracefully.

chan_lst(lst)

Load a GXLST with database channels.

Parameters:lst (GXLST) – List to Populate

New in version 6.3.

License: Geosoft Open License

Note: Populates a GXLST with channel symbols. The name is put into the “Name” part of the GXLST (0), and the handle, an integer value written as a string, is placed in the value part of the GXLST (1). Array channels are included, as well as virtual channels (array channel single columns loaded in the database like “Chan[1]”.

The GXLST is cleared first, and the items are sorted by name.

chans_max()

Gets Maximum Number of Channels in the Database

Returns:Maximum Number of Channels in the Database
Return type:int

New in version 5.1.1.

License: Geosoft Open License

check()

Does an integrity check of the data in the database to ensure it is valid.

Returns:0 - Ok 1 - Invalid Blocks in the Database
Return type:int

New in version 6.0.1.

License: Geosoft Open License

class_chan_list(vv, cl)

Place a list of channels for a given class in a GXVV.

Parameters:
  • vv (GXVV) – GXVV to populate, must be type INT.
  • cl (str) – Class name to match (“” for all)
Returns:

Number of symbols.

Return type:

int

New in version 5.0.5.

License: Geosoft Open License

Note: This method generates a list of symbols in the database and places their handles into a GXVV. The list is not sorted. Only channels with the given class name are included, e.g. use “ASSAY” for assay channels used in GXCHIMERA.

class_chan_lst(lst, cl)

Load a GXLST with channels in a particular class.

Parameters:
  • lst (GXLST) – GXLST object to populate
  • cl (str) – CLASS name for the channel (“” for all)

New in version 5.0.3.

License: Geosoft Open License

Note: The Name of the symbol is placed in the item name and the item value is set to the symbol handle. Only channels with the given class name are included, e.g. use “ASSAY” for assay channels in GXCHIMERA.

The GXLST is cleared first, and the items are sorted by name.

class_group_lst(lst, cl)

Load a GXLST with group lines in a particular class.

Parameters:
  • lst (GXLST) – GXLST object to populate
  • cl (str) – CLASS name for the group (“” for all)

New in version 5.0.8.

License: Geosoft Open License

Note: The Name of the symbol is placed in the item name and the item value is set to the symbol handle. Only group lines with the given class name are included, e.g. use “TARGETS” for UX-Detect Target groups.

The GXLST is cleared first, and the items are sorted by name.

commit()

This method forces all changes to the database to be saved.

New in version 5.0.

License: Geosoft Open License

compact()

Removes any extra space from the database. This will reduce the database to its smallest size.

New in version 5.1.1.

License: Geosoft Open License

coord_pair(chan, pair)

Get the matching coordinate pair of a channel.

Parameters:
  • chan (str) – Channel name
  • pair (str_ref) – String in which to place paired channel name
Returns:

DB_COORDPAIR constants

Return type:

int

New in version 5.0.

License: Geosoft Open License

Note: If the channel does not have a matching coordinate pair, or of the channel does not exist, the returned string will be empty.

copy_data(line, i_chan, o_chan)

This method copies the data from one channel to another on on the specified line. The data is converted if such conversion in neccessary.

Parameters:
  • line (int) – Line
  • i_chan (int) – Channel to Copy Data From
  • o_chan (int) – Channel to Copy Data To

New in version 5.0.

License: Geosoft Open License

Note: All the data in the destination channel is destroyed along with the fiducial start and increment.

count_sel_lines()

This method counts the number of selected lines in the database.

Returns:x - Number of selected lines in the database
Return type:int

New in version 5.0.

License: Geosoft Open License

classmethod create(file, lines, chans, blobs, users, cache, super, password)

This method makes a brand new database of the specified size. The database is opened in ReadWrite Mode.

Parameters:
  • file (str) – Name of the Database File to Create
  • lines (int) – Max Lines in the Database (200)
  • chans (int) – Max Channels in the Database (50)
  • blobs (int) – Max Blobs in the Database (Channels+Lines+20)
  • users (int) – Max Users in the Database (10)
  • cache (int) – Number of Erase Caches (100)
  • super (str) – Name of the Super User “SUPER”
  • password (str) – Password of the Super User “”

New in version 5.0.

License: Geosoft Open License

classmethod create_comp(file, lines, chans, blobs, users, cache, super, password, page, level)

This method makes a brand new database of the specified size. The database is opened in ReadWrite Mode. Also allows you to set paging size and the Compression Level.

Parameters:
  • file (str) – Name of the Database File to Create
  • lines (int) – Max Lines in the Database (200)
  • chans (int) – Max Channels in the Database (50)
  • blobs (int) – Max Blobs in the Database (Channels+Lines+20)
  • users (int) – Max Users in the Database (10)
  • cache (int) – Number of Erase Caches (100)
  • super (str) – Name of the Super User “SUPER”
  • password (str) – Password of the Super User “”
  • page (int) – Page Size Must be (64,128,256,512,1024,2048,4096) normally 1024
  • level (int) – DB_COMP constants

New in version 5.0.

License: Geosoft Open License

create_dup(file)

This method makes a brand new database identical to the input Database in-size. The database is opened in ReadWrite Mode.

Parameters:file (str) – Name of the Database File to Create

New in version 5.0.

License: Geosoft Open License

create_dup_comp(file, level)

This method makes a brand new database identical to the input Database in-size except it changes the compression. The database is opened in ReadWrite Mode.

Parameters:
  • file (str) – Name of the Database File to Create
  • level (int) – DB_COMP constants

New in version 5.0.

License: Geosoft Open License

classmethod create_ex(file, lines, chans, blobs, users, cache, super, password, page)

This method makes a brand new database of the specified size. The database is opened in ReadWrite Mode. Also allows you to set paging size.

Parameters:
  • file (str) – Name of the Database File to Create
  • lines (int) – Max Lines in the Database (200)
  • chans (int) – Max Channels in the Database (50)
  • blobs (int) – Max Blobs in the Database (Channels+Lines+20)
  • users (int) – Max Users in the Database (10)
  • cache (int) – Number of Erase Caches (100)
  • super (str) – Name of the Super User “SUPER”
  • password (str) – Password of the Super User “”
  • page (int) – Page Size Must be (64,128,256,512,1024,2048,4096) normally 1024

New in version 5.0.

License: Geosoft Open License

create_symb(name, symb, owner, category)

Create a new Symbol.

Parameters:
Returns:

DB_SYMB Object

Return type:

int

New in version 5.0.

License: Geosoft Open License

Note: If symbol already exits, and it is the same type simply returns a handle to the existing symbol.

This method simple calls create_symb_ex with the extra info set to 1.

STRING-type channels: To create a string-type channel, enter a negative number for the channel category below. For instance, “-32” will create a string channel with 32 characters per item.

BLOBS: Blobs (Binary Large Objects) can be used for storing miscellaneous data which does not fit well into any of the other various storage objects, such as a GXREG. Generally, one or more objects is serialized to a GXBF object, which is then written to the blob using the sWriteBlobBF_DB() function. Retrieval is done in the reverse order, using sWriteBlobBF_DB() first, then extracting the objects from the GXBF object. To avoid namespace problems, Geosoft reserves the following name prefixes:

OE. (Core functions) GS. (Applications) CS. (Custom Solutions applications)

Programmers should avoid using the above prefixes as the starting letters of their blob names to avoid any possible conflicts.

create_symb_ex(name, symb, owner, category, extra)

Create a new Symbol.

Parameters:
Returns:

DB_SYMB handle.

Return type:

int

New in version 5.0.

License: Geosoft Open License

Note: If symbol already exits it is returned.

STRING-type channels: To create a string-type channel, enter a negative number for the channel category below. For instance, “-32” will create a string channel with 32 characters per item.

Symbol name for DB_CATEGORY_LINE_FLIGHT must conform to the following line naming syntax:

[type][number.version:flight]

Type can be: L - normal line B - base line T - tie line R - trend line S - test line P - special line

Examples: L100, T100.1:16

Note the “Flight” is any whole number that may be useful to differentiate processing tasks.

The ability to create a GXVA channel is not available in the free interface and requires a Montaj license.

csv_chan_lst(lst, channels)

Load a GXLST with channels in a comma-separated list.

Parameters:
  • lst (GXLST) – GXLST object to populate
  • channels (str) – Comma-separated list of channels

New in version 6.2.

License: Geosoft Open License

Note: The Name of the symbol is placed in the item name and the item value is set to the symbol handle. Only channels in the list which are present in the database are included.

The GXLST is cleared first.

del_line0()

Delete Empty Line 0.

New in version 7.0.

License: Geosoft Open License

Note: A new database is created with a single, empty line L0, but many processes create databases then create their own lines, so the empty line L0 may remain after the process finishes. This function will delete a line L0 a) If it exists and is empty b) It is not the only line in the database.

See also

GXEDB.del_line0 - deletes an empty line 0 from the currently edited database.

delete_symb(symb)

This method destroys a symbol in the database and all the data associated with it. The symbol’s lock is automatically removed.

Parameters:symb (int) – Symbol to Delete (must be READWRITE locked)

New in version 5.0.

License: Geosoft Open License

discard()

This method discards all changes made to the database since the last commit or opening.

New in version 5.0.

License: Geosoft Open License

dup_line_symb(symb, new)

Duplicate a line symbol from a group or line symbol. The new name must not already exist in the database.

Parameters:
  • symb (int) – Symbol Handle to duplicate
  • new (str) – Name of the New Symbol
Returns:

New Symbol Handle

Return type:

int

New in version 5.0.

License: Geosoft Open License

dup_symb(symb, new)

New Symbol by duplicating an existing symbol, LOCKED

Parameters:
  • symb (int) – Symbol Handle to duplicate
  • new (str) – Name of the New Symbol
Returns:

New Symbol Handle

Return type:

int

New in version 5.0.

License: Geosoft Open License

Note: The symbol will be locked READWRITE. The new name must not already exist in the database.

See also

dup_symb_no_lock

dup_symb_across(dbo, symb)

Create a new Symbol by duplicating an existing symbol. exactly the same type but in output database. The symbol must not already exist in the output database.

Parameters:
  • dbo (GXDB) – Database output
  • symb (int) – Symbol Handle to duplicate
Returns:

New Symbol Handle

Return type:

int

New in version 5.0.

License: Geosoft Open License

dup_symb_no_lock(symb, new)

New Symbol by duplicating an existing symbol, NO LOCK.

Parameters:
  • symb (int) – Symbol Handle to duplicate
  • new (str) – Name of the New Symbol
Returns:

New Symbol Handle

Return type:

int

New in version 5.0.

License: Geosoft Open License

Note: The symbol will be NOT be locked. The new name must not already exist in the database.

See also

dup_symb

easy_maker_symb(symb, name, groups)

Adds a Maker to the database symbol based on current GX

Parameters:
  • symb (int) – Symbol to create maker for
  • name (str) – Maker name, used in menu prompt
  • groups (str) – INI groups (terminate each with a ”;”)

New in version 5.0.

License: Geosoft Open License

exist_chan(chan)

See if the specified channel exists in the database.

Parameters:chan (str) – Name of Channel
Returns:0 - Symbol does not exist in the database 1 - Symbol Exists
Return type:int

New in version 5.1.3.

License: Geosoft Open License

Note: See notes for exist_symb. Introduced in v5.1.3. exist_chan searches using the exact channel name.

exist_symb(symb, type)

This method checks to see if the specified symbol exists in the database.

Parameters:
Returns:

0 - Symbol does not exist in the database 1 - Symbol Exists

Return type:

int

New in version 5.0.

License: Geosoft Open License

Note: For backward compatibility with GXs not employing the GetXYZChan_DB function, the following behaviour has been introduced as of v5.1.3: (also true for “Y”).

exist_symb) is now equivalent to:

GetXYZChan_DB(hDB, DB_CHAN_X, sXCh); exist_symb);

In other words, the current X or Y is searched for, not necessarily the literal “X” or “Y”. This ensures that newer databases, which might have “Easting” and “Northing” (or other similar names) instead of “X” and “Y” will still work with older GXs expecting “X” and “Y”.

The new exist_chan searches using the exact channel name.

find_chan(chan)

Get handle to the specified channel.

Parameters:chan (str) – Name of channel
Returns:Channel Handle, NULLSYMB if not defined
Return type:int

New in version 5.1.3.

License: Geosoft Open License

Note: To work with a specific column from a GXVA channel, specify the GXVA element number in square brackets as part of the GXVA channel name (e.g. “EM[3]” will treat the fourth column of the GXVA channel as a GXVV).

See notes for find_symb. Introduced in v5.1.3. The new find_chan searches using the exact channel name.

find_symb(symb, type)

Get handle to the specified symbol.

Parameters:
Returns:

Symbol Handle, NULLSYMB if not defined

Return type:

int

New in version 5.0.

License: Geosoft Open License

Note: To work with a specific column from a GXVA channel, specify the GXVA element number in square brackets as part of the GXVA channel name (e.g. “EM[3]” will treat the fourth column of the GXVA channel as a GXVV).

For backward compatibility with GXs not employing the get_xyz_chan_symb function, the following behaviour has been introduced as of v5.1.3: (also true for “Y”).

find_symb) is now equivalent to:

get_xyz_chan_symb);

In other words, the current X or Y is searched for, not necessarily the literal “X” or “Y”. This ensures that newer databases, which might have “Easting” and “Northing” (or other similar names) instead of “X” and “Y” will still work with older GXs expecting “X” and “Y”.

The new find_chan searches using the exact channel name.

first_sel_line()

This method will return a handle to the first selected line in the database.

Returns:Line Handle (use iIsLineValid method to see if valid)
Return type:int

New in version 5.0.

License: Geosoft Open License

format_chan(chan, val, str_val)

Format a real value based on a channel format.

Parameters:
  • chan (int) – Channel handle
  • val (float) – Value to format
  • str_val (str_ref) – String

New in version 5.0.

License: Geosoft Open License

Note: If the passed string is too short, the result will be “**”.

classmethod gen_valid_chan_symb(str_in, str_out)

Generate a valid channel name from a name candidate

Parameters:
  • str_in (str) – Input string
  • str_out (str_ref) – Outout string

New in version 5.0.

License: Geosoft Open License

classmethod gen_valid_line_symb(str_in, str_out)

Generate a valid line symb name string from given string.

Parameters:
  • str_in (str) – Input string
  • str_out (str_ref) – Outout string

New in version 6.4.

License: Geosoft Open License

Note: The returned name is either the same size as the input or shorter. Escapes, leading and trailing spaces are removed, then all illegal characters are replaced with an underscore.

get_chan_array_size(chan)

This method Gets a channel’s array size for a given channel handle.

Parameters:chan (int) – Channel handle
Returns:Channel type
Return type:int

New in version 6.0.1.

License: Geosoft Open License

get_chan_class(chan, cl)

This method gets a channel’s label

Parameters:
  • chan (int) – Channel handle
  • cl (str_ref) – Returned class into

New in version 5.1.8.

License: Geosoft Open License

Note: The channel label is stored in the “CLASS” parameter of the channel reg. If no class is defined, then an empty string is returned. The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

get_chan_decimal(chan)

This method gets a channel’s number of digits displayed to the right of the decimal point.

Parameters:chan (int) – Channel handle
Returns:Number of digits displayed to right of decimal
Return type:int

New in version 6.0.1.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

get_chan_double(line, chan, ind)

Get individual elements in a channel.

Parameters:
  • line (int) – Line
  • chan (int) – Channel
  • ind (int) – Index
Returns:

Value, or dummy if out of range. For settings, terminates if error.

Return type:

float

New in version 5.0.

License: Geosoft Open License

Note: These methods are slow and should only be used when performance is not an issue.

get_chan_format(chan)

This method Gets a channel’s display format for a given channel handle.

Parameters:chan (int) – Channel handle
Returns:Channel display format
Return type:int

New in version 6.0.1.

License: Geosoft Open License

Note: The returned format is one of the DB_CHAN_FORMAT constants. The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

get_chan_int(line, chan, ind)

Get individual elements in a channel.

Parameters:
  • line (int) – Line
  • chan (int) – Channel
  • ind (int) – Index
Returns:

Value, or dummy if out of range. For settings, terminates if error.

Return type:

int

New in version 5.0.

License: Geosoft Open License

Note: These methods are slow and should only be used when performance is not an issue.

get_chan_label(chan, label)

This method gets a channel’s label

Parameters:
  • chan (int) – Channel handle
  • label (str_ref) – Returned label into

New in version 5.0.

License: Geosoft Open License

Note: The channel label is stored in the “LABEL” parameter of the channel reg. If the setting is empty, the channel name is returned. The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

get_chan_name(chan, name)

This method Gets a channel’s name for a given channel handle.

Parameters:
  • chan (int) – Channel handle
  • name (str_ref) – String to place name into

New in version 5.0.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

get_chan_order_lst(lst)

This method gets the channel display order for a database. The list will be stored in an GXLST object. In order to modify this displayed channels list, call set_chan_order_lst after.

Parameters:lst (GXLST) – GXLST object to populate

New in version 5.0.8.

License: Geosoft Open License

get_chan_protect(chan)

This method gets a channel’s read-only protection status.

Parameters:chan (int) – Channel handle
Returns:DB_CHAN_PROTECTION constants
Return type:int

New in version 6.0.1.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

get_chan_str(line, chan, ind, str_val)

Get individual elements in a channel.

Parameters:
  • line (int) – Line
  • chan (int) – Channel
  • ind (int) – Index
  • str_val (str_ref) – String

New in version 5.0.

License: Geosoft Open License

Note: These methods are slow and should only be used when performance is not an issue.

get_chan_type(chan)

This method Gets a channel’s type for a given channel handle.

Parameters:chan (int) – Channel handle
Returns:Channel type
Return type:int

New in version 6.0.1.

License: Geosoft Open License

Note: The type returned is one of the DB_CATEGORY_CHAN constants. Use the GS_SIMPLE_TYPE() macro to convert to INT,REAL or string types. The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

get_chan_unit(chan, unit)

This method Gets a channel’s unit

Parameters:
  • chan (int) – Channel handle
  • unit (str_ref) – String to place unit into

New in version 5.0.

License: Geosoft Open License

Note: The unit label is stored in the “UNITS” parameter of the channel reg. The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

get_chan_va(line, chan, va)

Place the contents of a channel in a GXVA.

Parameters:
  • line (int) – Line
  • chan (int) – Channel
  • va (GXVA) – GXVA in which to place the data

New in version 5.0.

License: Geosoft Open License

See also

GXVA class.

get_chan_vv(line, chan, vv)

Place the contents of a channel in a GXVV.

Parameters:
  • line (int) – Line
  • chan (int) – Channel
  • vv (GXVV) – GXVV in which to place the data

New in version 5.0.

License: Geosoft Open License

Note: If a GXVA channel is specified, then element [0] of this GXVA channel is used to populated the GXVV.

See also

GXVV class.

get_chan_vv_expanded(line, chan, vv)

Read a channel into a GXVV. If the channel is a GXVA channel it is treaded as a GXVV channel with multiple values per fid and the FID expation is set to the array size.

Parameters:
  • line (int) – Line
  • chan (int) – Channel
  • vv (GXVV) – GXVV in which to place the data

New in version 6.4.

License: Geosoft Open License

Note: This method is to be used in conjunction with the GXVV.re_fid_vv method that will honor the FID Expansion setting.

See also

GXVV class.

get_chan_width(chan)

This method gets a channel’s display width for a given channel handle.

Parameters:chan (int) – Channel handle
Returns:Channel display width
Return type:int

New in version 6.0.1.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

get_channel_length(line, chan)

Returns the # of elements in a channel.

Parameters:
  • line (int) – Line (read or write locked)
  • chan (int) – Channel (read or write locked)
Returns:

# of elements

Return type:

int

New in version 8.1.

License: Geosoft Open License

Note: Returns the actual number of data items (rows) in a channel. For GXVA channels no correction is necessary for the number of columns.

get_col_va(chan)

Returns the # of columns in a GXVA channel.

Parameters:chan (int) – Channel (read locked)
Returns:# of columns 0 if error
Return type:int

New in version 5.0.

License: Geosoft Open License

Note: If the channel is GXVV, this function returns 1.

get_fid_incr(line, chan)

This method returns the fiducial increment value of a specified Channel.

Parameters:
  • line (int) – Line (read or write locked)
  • chan (int) – Channel (read locked)
Returns:

Fiducial Start.

Return type:

float

New in version 5.0.

License: Geosoft Open License

get_fid_start(line, chan)

This method returns the fiducial start value of a specified Channel.

Parameters:
  • line (int) – Line (read or write locked)
  • chan (int) – Channel (read locked)
Returns:

Fiducial Start.

Return type:

float

New in version 5.0.

License: Geosoft Open License

get_group_class(symb, cl)

Set the Class name for a group line.

Parameters:

New in version 5.0.8.

License: Geosoft Open License

Note: This method fails if the line is not a group line. Group classes are used to identify group lines used for special purposes, e.g.: “COLLAR” for the Wholeplot collar table, or “TARGETS” for the UX-Detect Targets list.

See also

line_category - to see if a line is a group line.

get_info(item)

Get information about the database.

Parameters:item (int) – DB_INFO constants
Returns:x - Return Value
Return type:int

New in version 7.0.

License: Geosoft Open License

get_ipj(ch, ipj)

Get georeference information in an GXIPJ.

Parameters:
  • ch (int) – Symbol
  • ipj (GXIPJ) – GXIPJ to fill in

New in version 5.0.

License: Geosoft Open License

Note: If the channel does not have an GXIPJ, the GXIPJ that is returned will have an unknown projection.

get_itr(ch, itr)

Get GXITR for a channel.

Parameters:
  • ch (int) – Channel
  • itr (GXITR) – GXITR to fill in

New in version 5.0.

License: Geosoft Open License

Note: If a channel does not have an GXITR, get_itr will not change the passed GXITR. Channel must be locked for READONLY or READWRITE.

get_line_map_fid(line, start, end)

This method gets a line map clip fiducial.

Parameters:
  • line (int) – Line handle to look at
  • start (float_ref) – Start Fid
  • end (float_ref) – End Fid

New in version 5.1.1.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

get_line_selection(line)

Get the selection status for a line.

Parameters:line (int) – Line handle
Returns:One of DB_LINE_SELECT constants
Return type:int

New in version 9.0.

License: Geosoft Open License

get_meta(meta)

Get the metadata of a database.

Parameters:meta (GXMETA) – Meta object to fill with database’s meta

New in version 5.1.5.

License: Geosoft Open License

get_name(name, psz_name)

Gets a name from the database.

Parameters:

New in version 5.0.

License: Geosoft Open License

get_reg_symb(symb, reg)

Get a GXREG object from a symbol

Parameters:

New in version 5.0.

License: Geosoft Open License

get_reg_symb_setting(symb, name, setting)

Get a GXREG string setting from a symbol reg

Parameters:
  • symb (int) – Symbol, NULLSYMB for the database GXREG
  • name (str) – GXREG entry name
  • setting (str_ref) – Returned setting

New in version 5.0.

License: Geosoft Open License

Note: The symbol GXREG is used to store a variety of attribute about the symbol. Following a conventionally used entries:

UNITS - channel units CLASS - symbol class name (i.e. “Assay”) _PJ_ipj - projection blob name _PJ_x - projection coordinate pair _PJ_y _PJ_name - projection GXF-style info _PJ_ellipsoid _PJ_projection _PJ_units _PJ_datum_transform

This is a convenient but low-performance way to get/set GXREG settings. If performance is an issue, and more than one setting is to be Get and or Set, use the GXREG directly.

get_reg_symb_setting_double(symb, name)

Get a real-valued GXREG setting from a symbol reg

Parameters:
Returns:

The setting, or rDUMMY if not found or not convertable.

Return type:

float

New in version 6.2.

License: Geosoft Open License

Note: Same as get_reg_symb_setting, but converts the setting automatically to a real value.

This is a convenient but low-performance way to get/set GXREG settings. If performance is an issue, and more than one setting is to be Get and or Set, use the GXREG directly.

get_reg_symb_setting_int(symb, name)

Get an integer-valued GXREG setting from a symbol reg

Parameters:
Returns:

The setting, or iDUMMY if not found or not convertable.

Return type:

int

New in version 6.2.

License: Geosoft Open License

Note: Same as get_reg_symb_setting, but converts the setting automatically to an integer value.

This is a convenient but low-performance way to get/set GXREG settings. If performance is an issue, and more than one setting is to be Get and or Set, use the GXREG directly.

get_select()

Gets the Line Selections.

Returns:Selections Object.
Return type:int

New in version 5.0.

License: Geosoft Open License

get_symb_lock(symb)

Determines if a symbol is locked

Parameters:symb (int) – Symbol to Lock
Returns:DB_LOCK constants
Return type:int

New in version 6.3.

License: Geosoft Open License

get_symb_name(symb, name)

This method gets a symbol’s name

Parameters:
  • symb (int) – Symbol handle
  • name (str_ref) – String to place name into

New in version 6.1.

License: Geosoft Open License

Note: See GetChanName_DB for more information The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

get_va_base_coordinate_info(ch, domain, base, vv, units)

Set the array channel base coordinate type, offset and values.

Parameters:

New in version 8.2.

License: Geosoft Open License

Note: See set_va_base_coordinate_info.

get_va_chan_vv(line, chan, vv, offset, items)

Place the contents of a specific part of a channel in a GXVV.

Parameters:
  • line (int) – Line
  • chan (int) – Channel
  • vv (GXVV) – GXVV in which to place the data
  • offset (int) – Offset
  • items (int) – Number to Write

New in version 5.1.1.

License: Geosoft Open License

Note: If a GXVA channel is specified, then element [0] of this GXVA channel is used to populated the GXVV.

See also

GXVV class.

get_va_prof_color_file(ch, file)

Get colors for a GXVA channel when displayed in the profile window.

Parameters:

New in version 5.1.5.

License: Geosoft Open License

Note: See set_va_prof_color_file.

get_va_prof_sect_option(ch, option)

Get the display options of GXVA channels

Parameters:
  • ch (int) – Channel (Locked DB_LOCK_READWRITE)
  • option (str_ref) – Option “Profile”, “Section” or “Section and Profile”

New in version 5.1.6.

License: Geosoft Open License

get_va_scaling(ch, base, range)

Get base and range for GXVA channel cell display.

Parameters:

New in version 5.1.5.

License: Geosoft Open License

Note: See set_va_scaling.

get_va_sect_color_file(ch, file)

Get colors for a GXVA channel when displayed section in the profile window.

Parameters:

New in version 5.1.6.

License: Geosoft Open License

Note: Fails in the channel is not an array channel

get_va_windows(ch, min_w, max_w)

Get the range of windows displayed for a GXVA channel.

Parameters:
  • ch (int) – Channel (Locked DB_LOCK_READWRITE)
  • min_w (int_ref) – First window (0 to N-2, iDummy for default)
  • max_w (int_ref) – Last window (1 to N-1, iDummy for default)

New in version 5.1.5.

License: Geosoft Open License

Note: See set_va_windows.

get_xyz_chan(chan_symb, chan)

Gets current X, Y or Z channel name

Parameters:

New in version 5.1.3.

License: Geosoft Open License

Note: searches for the “current” X, Y or Z channel. If none is defined, then returns “X”, “Y” or “Z”.

get_xyz_chan_symb(chan)

Searches for current X, Y or Z channel symbol

Parameters:chan (int) – DB_CHAN_SYMBOL constants
Returns:x - Symbol Handle NULLSYMB - Symbol not found

searches for the “current” X, Y or Z channel. If none is defined, then looks for “X”, “Y” or “Z” channel If the channel is defined, but not present, returns NULLSYMB.

Return type:int

New in version 5.1.3.

License: Geosoft Open License

classmethod grow(file, lines, chans, blobs, users, cache)

Enlarges the database.

Parameters:
  • file (str) – Name of the Database File to Create
  • lines (int) – Max Lines in the Database (200)
  • chans (int) – Max Channels in the Database (50)
  • blobs (int) – Max Blobs in the Database (Channels+Lines+20)
  • users (int) – Max Users in the Database (10)
  • cache (int) – Number of Erase Caches (100)

New in version 5.1.1.

License: Geosoft Open License

have_itr(ch)

Returns TRUE if channel has an GXITR.

Parameters:ch (int) – Channel
Return type:int

New in version 5.0.

License: Geosoft Open License

Note: If a channel has an GXITR, the GXITR colors are used to display channel values in the spreadsheet.

If a channel does not have an GXITR, get_itr will not change the passed GXITR.

is_associated(group, chan)

Check to see if a channel is associated with group.

Parameters:
  • group (int) – Line
  • chan (int) – Channel
Returns:

0 if not a group line, or if the channel is not associated.

As of v6.3, if a group line has no class defined, then ALL channels are automatically assumed to be associated with it.

Return type:

int

New in version 5.1.3.

License: Geosoft Open License

classmethod is_chan_name(chan)

Is this a valid channel name?

Parameters:chan (str) – Name to test
Returns:1 if it is a valid channel name 0 if it is not a valid channel name
Return type:int

New in version 7.2.

License: Geosoft Open License

Note: Channel names must only contain alpha-numeric characters or the underscore character “_”, and the first letter must be a letter or an underscore.

is_chan_valid(chan)

This method checks to see if the channel handle is a valid channel.

Parameters:chan (int) – Channel handle to check
Returns:0 - Not a valid channel 1 - Valid
Return type:int

New in version 5.1.1.

License: Geosoft Open License

is_empty()

See if a database contains only empty lines.

Returns:1 if the database contains only empty lines.
Return type:int

New in version 6.1.

License: Geosoft Open License

Note: This function does not check for other information or blobs, it merely looks at all lines in the database to see if they are empty. If all are empty, it returns 1.

is_line_empty(symb)

See if a specific line in the database is empty.

Parameters:symb (int) – Line symbol
Returns:1 if the database contains only empty lines.
Return type:int

New in version 6.1.

License: Geosoft Open License

classmethod is_line_name(line)

Is this a valid line name.

Parameters:line (str) – Name to test
Returns:1 if it is a valid line name 0 if it is not a valid line name
Return type:int

New in version 5.0.

License: Geosoft Open License

is_line_valid(line)

This method checks to see if the line handle returned by the Line methods is a valid line.

Parameters:line (int) – Line handle to check
Returns:0 - Not a valid line 1 - Valid
Return type:int

New in version 5.0.

License: Geosoft Open License

is_null()

Check if this is a null (undefined) instance

Returns:True if this is a null (undefined) instance, False otherwise.
Return type:bool
is_wholeplot()

Is this a Wholeplot database?

Returns:1 if it is a Wholeplot database 0 if it is not.
Return type:int

New in version 5.0.

License: Geosoft Open License

Note: Currently checks to see if the DH_COLLAR line exists.

line_bearing(line)

This method returns the bearing of a line.

Parameters:line (int) – Line handle to look at
Returns:Bearing value, rDUMMY if not set.
Return type:float

New in version 5.1.1.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

This function simply returns a value set using the set_line_bearing function. It returns rDUMMY for line categories other than DB_CATEGORY_LINE_FLIGHT.

To calculate the line azimuth based on the first and last non-dummy locations, use the GXDU.direction function.

line_category(line)

This method returns the category (group, line) of a line.

Parameters:line (int) – Line handle to look at
Returns:DB_CATEGORY_LINE constants or iDUMMY.
Return type:int

New in version 5.0.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

line_date(line)

This method returns the date of a line.

Parameters:line (int) – Line handle to look at
Returns:Date value.
Return type:float

New in version 5.0.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

line_flight(line)

This method returns the flight number of a line.

Parameters:line (int) – Line handle to look at
Returns:Line Flight Number.
Return type:int

New in version 5.0.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

line_label(line, label, format)

Create a line label

Parameters:

New in version 5.0.

License: Geosoft Open License

Note: Label formats.

example full format is “L1023.4 13” type “L” number “1023” version “4” flight “13”

formats can be added to get combined format

Use LINK format to create a database link label.

line_lst(lst)

Load a GXLST with database lines.

Parameters:lst (GXLST) – List to Populate

New in version 6.3.

License: Geosoft Open License

Note: Populates a GXLST with channel symbols. The name is put into the “Name” part of the GXLST (0), and the handle, an integer value written as a string, is placed in the value part of the GXLST (1). The GXLST is cleared first, and the items are sorted in logical line order.

line_number(line)

This method returns the number of a line.

Parameters:line (int) – Line handle to look at
Returns:Line Number.
Return type:int

New in version 5.0.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

line_number2(line, line_number)

Returns the string form of the line number (can be alphanumeric)

Parameters:
  • line (int) – Line handle to look at
  • line_number (str_ref) – Line number

New in version 5.0.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

line_type(line)

This method returns the type of a line.

Parameters:line (int) – Line handle to look at
Returns:DB_LINE_TYPE constants
Return type:int

New in version 5.0.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

line_version(line)

This method returns the version number of a line.

Parameters:line (int) – Line handle to look at
Returns:Line Number.
Return type:int

New in version 5.0.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READONLY or DB_LOCK_READWRITE

lines_max()

Gets Maximum number of lines in the database

Returns:Maximum number of lines in the database
Return type:int

New in version 5.1.1.

License: Geosoft Open License

load_select(file)

Load selections to from a file.

Parameters:file (str) – File Name

New in version 5.0.

License: Geosoft Open License

lock_symb(symb, lock, wait)

Locks a symbol for READONLY or READWRITE.

Parameters:

New in version 5.0.

License: Geosoft Open License

maker_symb(symb, prog, name, groups)

Adds a Maker to the database symbol

Parameters:
  • symb (int) – Symbol to create maker for
  • prog (str) – Name of program
  • name (str) – Maker name, used in menu prompt
  • groups (str) – INI groups (terminate each with a ”;”)

New in version 5.0.

License: Geosoft Open License

mask_chan_lst(lst)

Load a GXLST with mask channels.

Parameters:lst (GXLST) – GXLST object to populate

New in version 5.1.5.

License: Geosoft Open License

Note: Loads a GXLST with all channels with CLASS “MASK”, as well as all channels containing the string “MASK”, as long as the CLASS for these channels is not set to something other than “” or “MASK”.

This function is a duplicate of the GXCHIMERA.mask_chan_lst function, and can be used if GXCHIMERA is not installed.

The GXLST is cleared first, and the items are sorted by name. “None” is added at the end, with a handle value of “-1”.

next_sel_line(prev)

This method will advance to the next selected line based on the currently selected line handle.

Parameters:prev (int) – Previous Line
Returns:Line Handle (use iIsLineValid method to see if valid).
Return type:int

New in version 5.0.

License: Geosoft Open License

normal_chan_lst(lst)

Load a GXLST with non-array database channels.

Parameters:lst (GXLST) – List to Populate

New in version 8.2.

License: Geosoft Open License

Note: Like chan_lst, but does not include array channels or virtual channels.

classmethod null()

A null (undefined) instance of GXDB

Returns:A null GXDB
Return type:GXDB
classmethod open(file, user, password)

This method opens a database.

Parameters:
  • file (str) – Name of the Database File to Open
  • user (str) – Name of the user (“SUPER” normally)
  • password (str) – Password of the user (“” normally)
Returns:

GXDB Object

Return type:

GXDB

New in version 5.0.

License: Geosoft Open License

classmethod open_read_only(file, user, password)

This method opens a database.

Parameters:
  • file (str) – Name of the Database File to Open
  • user (str) – Name of the user (“SUPER” normally)
  • password (str) – Password of the user (“” normally)
Returns:

GXDB Object

Return type:

GXDB

New in version 6.4.2.

License: Geosoft Open License

Note: This method is useful to open multiple reader instances on the same database. This call will fail if a GXDB has already been opened with open or locked in the application with GXEDB.lock.

put_chan_va(line, chan, va)

Place the contents of a GXVA in a channel.

Parameters:
  • line (int) – Line
  • chan (int) – Channel
  • va (GXVA) – GXVA from which to get the data

New in version 5.0.

License: Geosoft Open License

See also

GXVA class.

put_chan_vv(line, chan, vv)

Place the contents of a GXVV in a channel.

Parameters:
  • line (int) – Line
  • chan (int) – Channel
  • vv (GXVV) – GXVV from which to get the data

New in version 5.0.

License: Geosoft Open License

Note: If a GXVA channel is specified, then element [0] of this GXVA channel will be populated with the GXVV.

There is a limit of 2000 elements for non-licensed users.

See also

GXVV class.

put_va_chan_vv(line, chan, vv, offset, items)

Place the contents of a GXVV at a specific part of a channel.

Parameters:
  • line (int) – Line
  • chan (int) – Channel
  • vv (GXVV) – GXVV from which to get the data
  • offset (int) – Offset
  • items (int) – Number to Write

New in version 5.1.1.

License: Geosoft Open License

Note: If a GXVA channel is specified, then element [0] of this GXVA channel will be populated with the GXVV.

See also

GXVV class.

read_blob_bf(symb, bf)

Read a blob from a database into a file.

Parameters:
  • symb (int) – Blob (DB_SYMB_BLOB) to read into GXBF from database
  • bf (GXBF) – File to read blob from

New in version 5.0.

License: Geosoft Open License

classmethod repair(file)

Cleans the database by removing invalid blocks

Parameters:file (str) – Name of the Database File to Create

New in version 5.1.1.

License: Geosoft Open License

save_select(file)

Saves current selections to a file.

Parameters:file (str) – File Name

New in version 5.0.

License: Geosoft Open License

select(select, mode)

Select/deselect lines based on selection string

Parameters:

New in version 5.0.

License: Geosoft Open License

Note: Selections/deselections are cumulative. If lines had already been selected, then any further selection/deselection will affect that set of selections.

E.g. “L99:800” is the string to select all normal lines from 99 to 800. If select is called again to select “L1000”, then lines 99 to 800 and 1000 would all be selected.

Use a “T” prefix for Tie lines. Use an “F” prefix to specify lines of a specific flight. E.g. “F10” would select all lines of flight 10. Use an empty string (“”) to select/deselect ALL lines.

selected_line_lst(lst)

Load a GXLST with the selected lines.

Parameters:lst (GXLST) – List to Populate

New in version 5.1.2.

License: Geosoft Open License

Note: This method populates a GXLST object with all of the symbols of the selected lines in the database. The name is put into the “Name” part of the GXLST (0), and the handle, an integer value written as a string, is placed in the value part of the GXLST (1).

Symbols are automatically sorted in logical line order.

set_all_chan_protect(prot)

This method sets all the channels’ read-only protection status.

Parameters:prot (int) – DB_CHAN_PROTECTION constants

New in version 7.0.

License: Geosoft Open License

Note: Value to set must be either DB_CHAN_PROTECTED or DB_CHAN_UNPROTECTED This method does its own channel locking/unlocking. Channels already lock DB_LOCK_READONLY are ignored.

set_chan_class(chan, cl)

Set a channel class

Parameters:
  • chan (int) – Channel handle
  • cl (str) – Class

New in version 5.1.8.

License: Geosoft Open License

Note: The channel class is stored in the “CLASS” parameter of the channel reg. The channel must be locked DB_LOCK_READWRITE

set_chan_decimal(chan, dec)

This method sets a channel’s number of digits displayed to the right of the decimal point.

Parameters:
  • chan (int) – Channel handle
  • dec (int) – Number of digits to display right of the decimal

New in version 5.0.

License: Geosoft Open License

Note: The number of display digits must be from 0 to 50. The channel must be locked DB_LOCK_READWRITE

set_chan_double(line, chan, ind, val)

Set individual elements in a channel.

Parameters:
  • line (int) – Line
  • chan (int) – Channel
  • ind (int) – Index
  • val (float) – Value

New in version 5.0.

License: Geosoft Open License

Note: These methods are slow and should only be used when performance is not an issue.

set_chan_format(chan, format)

This method sets a channel’s display format.

Parameters:

New in version 5.0.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READWRITE

set_chan_int(line, chan, ind, val)

Set individual elements in a channel.

Parameters:
  • line (int) – Line
  • chan (int) – Channel
  • ind (int) – Index
  • val (int) – Value

New in version 5.0.

License: Geosoft Open License

Note: These methods are slow and should only be used when performance is not an issue.

set_chan_label(chan, label)

Set a channel label

Parameters:
  • chan (int) – Channel handle
  • label (str) – Label

New in version 5.0.

License: Geosoft Open License

Note: The channel label is stored in the “LABEL” parameter of the channel reg. The channel must be locked DB_LOCK_READWRITE

set_chan_name(chan, name)

This method sets a channel’s name.

Parameters:
  • chan (int) – Channel handle
  • name (str) – String to set channel name to

New in version 5.0.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READWRITE

set_chan_order_lst(lst)

This method sets the channel display order for a database. The list to modify will be stored in an GXLST object. Call get_chan_order_lst to populate the GXLST.

Parameters:lst (GXLST) – GXLST object to modify

New in version 5.0.8.

License: Geosoft Open License

set_chan_protect(chan, prot)

This method sets a channel’s read-only protection status.

Parameters:

New in version 5.0.

License: Geosoft Open License

Note: Value to set must be either DB_CHAN_PROTECTED or DB_CHAN_UNPROTECTED The channel must be locked DB_LOCK_READWRITE

set_chan_str(line, chan, ind, str_val)

Set individual elements in a channel.

Parameters:
  • line (int) – Line
  • chan (int) – Channel
  • ind (int) – Index
  • str_val (str) – String

New in version 5.0.

License: Geosoft Open License

Note: These methods are slow and should only be used when performance is not an issue.

set_chan_unit(chan, unit)

This method sets a channel’s unit for a given channel handle.

Parameters:
  • chan (int) – Channel handle
  • unit (str) – String to put channel unit

New in version 5.0.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READWRITE

set_chan_width(chan, width)

This method sets a channel’s display width

Parameters:
  • chan (int) – Channel handle
  • width (int) – Display width

New in version 5.0.

License: Geosoft Open License

Note: The number of display digits must be from 0 to 50. The channel must be locked DB_LOCK_READWRITE

set_fid(line, chan, start, incr)

This method allows the user to set the fiducial start and increment of a channel. The Increment should never be 0.

Parameters:
  • line (int) – Line (read or write locked)
  • chan (int) – Channel to set fiducial (write locked)
  • start (float) – Start Fiducial Value
  • incr (float) – Increment Fiducial Value

New in version 5.0.

License: Geosoft Open License

set_group_class(symb, cl)

Set the Class name for a group line.

Parameters:

New in version 5.0.8.

License: Geosoft Open License

Note: This method fails if the line is not a group line. Group classes are used to identify group lines used for special purposes. All group lines with the same class share the same list of associated channels.

As of v6.3, if a group line has no class defined, then ALL channels are assumed to be associated with it. This means that a group class should only be defined when you wish to associate a subset of the available channels to group line.

See also

line_category - to see if a line is a group line. associate - Associate a channel with a group.

set_ipj(ch1, ch2, ipj)

Set a GXREG object into a symbol

Parameters:
  • ch1 (int) – X channel
  • ch2 (int) – Y channel

New in version 5.0.

License: Geosoft Open License

set_itr(ch, itr)

Set GXITR for a channel.

Parameters:
  • ch (int) – Channel
  • itr (GXITR) – GXITR to fill in

New in version 5.0.

License: Geosoft Open License

Note: Use ITR_NULL to clear the channel GXITR. Channel must be locked for READONLY or READWRITE.

set_line_bearing(line, bearing)

Sets a line’s bearing.

Parameters:
  • line (int) – Line handle
  • bearing (float) – Value to set bearing to

New in version 5.1.1.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READWRITE

This function simply sets a value in the line’s metadata that is retrieved using the line_bearing function. It terminates for line categories other than DB_CATEGORY_LINE_FLIGHT.

set_line_date(line, date)

This method sets a line’s date.

Parameters:
  • line (int) – Line handle
  • date (float) – Value to set date to

New in version 5.0.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READWRITE

set_line_flight(line, fl)

This method sets a line’s flight.

Parameters:
  • line (int) – Line handle
  • fl (int) – Value to set line flight to

New in version 5.0.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READWRITE

set_line_map_fid(line, start, end)

This method changes a line map clip fiducial.

Parameters:
  • line (int) – Line handle to look at
  • start (float) – Start Fid
  • end (float) – End Fid

New in version 5.0.

License: Geosoft Open License

Note: for full range, set Start Fid to rMIN and End Fid to rMAX. for no data, set Start and End Fids to rDUMMY.

classmethod set_line_name(num, type, ver, name)

This method sets up a line name given the line’s number, type, and version.

Parameters:
  • num (int) – Line number
  • type (int) – Line type
  • ver (int) – Line version
  • name (str_ref) – String to set line name to

New in version 5.0.

License: Geosoft Open License

Note: This MUST be called to generate a line name when calls are made to exist_symb, create_symb or delete_symb for an operation on a line. See also SetLineName2_DB.

classmethod set_line_name2(al_num, type, ver, name)

Like SetLineName_DB, but can use alphanumeric for line number

Parameters:
  • al_num (str) – Line number (alphanumeric)
  • type (int) – Line type
  • ver (int) – Line version
  • name (str_ref) – String to set line name to

New in version 5.0.

License: Geosoft Open License

Note: This MUST be called to generate a line name when calls are made to exist_symb, create_symb or delete_symb for an operation on a line. The line number can be any combination of letters and numbers, i.e. XU324, 98765, A, 23NGV etc.

set_line_num(line, num)

This method sets a line’s number.

Parameters:
  • line (int) – Line handle
  • num (int) – Value to set line number to

New in version 5.0.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READWRITE

set_line_selection(line, mode)

Set the selection status for a line.

Parameters:

New in version 9.0.

License: Geosoft Open License

set_line_type(line, type)

This method sets a line’s type.

Parameters:

New in version 5.0.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READWRITE

set_line_ver(line, ver)

This method sets a line’s version.

Parameters:
  • line (int) – Line handle
  • ver (int) – Value to set line version to

New in version 5.0.

License: Geosoft Open License

Note: The channel must be locked DB_LOCK_READWRITE

set_meta(meta)

Set the metadata of a database.

Parameters:meta (GXMETA) – Meta object to add to database’s meta

New in version 5.1.5.

License: Geosoft Open License

set_reg_symb(symb, reg)

Set a GXREG object into a symbol

Parameters:

New in version 5.0.

License: Geosoft Open License

set_reg_symb_setting(symb, name, setting)

Set a GXREG string setting in a symbol reg

Parameters:
  • symb (int) – Symbol, NULLSYMB for the database GXREG
  • name (str) – GXREG entry name
  • setting (str) – Setting

New in version 5.0.

License: Geosoft Open License

Note: The symbol GXREG is used to store a variety of attribute about the symbol. Following a conventionally used entries:

UNITS - channel units CLASS - symbol class name (i.e. “Assay”) _PJ_ipj - projection blob name _PJ_x - projection coordinate pair _PJ_y _PJ_name - projection GXF-style info _PJ_ellipsoid _PJ_projection _PJ_units _PJ_datum_transform

This is a convenient but low-performance way to get/set GXREG settings. If performance is an issue, and more than one setting is to be Get and or Set, use the GXREG directly.

set_select(sel)

Sets the Line Selections.

Parameters:sel (int) – Selections

New in version 5.0.

License: Geosoft Open License

Note: This method also destroys the DB_SELECT object.

set_va_base_coordinate_info(ch, domain, base, vv, units, allow_changes)

Set the array channel base coordinate type, offset and values.

Parameters:
  • ch (int) – Channel (Locked DB_LOCK_READWRITE)
  • domain (int) – DB_ARRAY_BASETYPE constants
  • base (float) – Optional offset or base frequency
  • vv (GXVV) – Values (one per array channel column) (REAL)
  • units (str) – Units
  • allow_changes (bool) – Allow changes to existing values?

New in version 8.2.

License: Geosoft Open License

Note: See get_va_base_coordinate_info.

set_va_prof_color_file(ch, file)

Set colors for a GXVA channel when displayed in the profile window.

Parameters:
  • ch (int) – Channel (Locked DB_LOCK_READWRITE)
  • file (str) – Zone file name, “” to clear.

New in version 5.1.5.

License: Geosoft Open License

Note: Fails in the channel is not an array channel, if the file does not exist, or if it is not a valid color zone file.

The individual columns in the array channel are displayed using the input zone file colors. A linear GXITR from 0 to 1 is created on the color zones to map to individual channel indices (expressed as a fraction as shown below).

For instance, for a file with 8 colors the ranges are as follows:

Color Range Color 1 0 > value >= 0.125 Color 2 0.125 > value >= 0.25 Color 3 0.25 > value >= 0.375 Color 4 0.375 > value >= 0.5 Color 5 0.5 > value >= 0.625 Color 6 0.625 > value >= 0.75 Color 7 0.75 > value >= 0.875 Color 8 0.875 > value >= 1.0

When an array channel is displayed, the index of each element (column) is mapped into the corresponding range above using the following formula:

value = (column index) / (# of columns - 1)

For an array with 8 columns, you get the following values:

Column Value Color 0 0 1 1 0.14 2 2 0.28 3 3 0.43 4 4 0.57 5 5 0.71 6 6 0.86 7 7 1.0 8

The color file search path is: Local directory, then oasismontajtbl.

set_va_prof_sect_option(ch, option)

Set the display options of GXVA channels

Parameters:
  • ch (int) – Channel (Locked DB_LOCK_READWRITE)
  • option (str) – Option “Profile”, “Section” or “Section and Profile”

New in version 5.1.6.

License: Geosoft Open License

set_va_scaling(ch, base, range)

Set base and range for GXVA channel cell display.

Parameters:
  • ch (int) – Channel (Locked DB_LOCK_READWRITE)
  • base (float) – Base value (rDummy for none)
  • range (float) – Range value (rDummy for none)

New in version 5.1.5.

License: Geosoft Open License

Note: By default, GXVA profiles autoscale to fit in the database cell. This lets the user set a single base and range for all cells. If either input is a dummy, both are set as dummies, and autoscaling is used.

set_va_sect_color_file(ch, file)

Set colors for a GXVA channel when displayed section in the profile window.

Parameters:

New in version 5.1.6.

License: Geosoft Open License

Note: Fails in the channel is not an array channel, if the file does not exist, or if it is not a valid color zone file.

set_va_windows(ch, min_w, max_w)

Set the range of windows to display for a GXVA channel.

Parameters:
  • ch (int) – Channel (Locked DB_LOCK_READWRITE)
  • min_w (int) – First window (0 to N-1, iDummy for default)
  • max_w (int) – Last window (0 to N-1, iDummy for default)

New in version 5.1.5.

License: Geosoft Open License

Note: Use to display a subset of the GXVA channel windows in the GDB. Windows index from 0.

set_xyz_chan(chan_symb, chan)

Sets current X, Y or Z channel name

Parameters:

New in version 5.1.3.

License: Geosoft Open License

Note: If the value specified is “”, the internally stored value is cleared, and GetXYZChan_DB will return “X”, “Y” or “Z”

This can be used, for instance, to make “Easting” and “Northing” the current X and Y channels, and have GXs using the get_xyz_chan_symb function to load “X” and “Y” work as desired.

string_chan_lst(lst)

Load a GXLST with string-type channels.

Parameters:lst (GXLST) – GXLST object to populate

New in version 6.2.

License: Geosoft Open License

Note: The Name of the symbol is placed in the item name and the item value is set to the symbol handle. Only channels with the string-type data (sChanType_DB < 0) are included.

The GXLST is cleared first, and the items are sorted by name.

symb_list(vv, symb)

Place a list of symbols in a GXVV.

Parameters:
Returns:

Number of symbols.

Return type:

int

New in version 5.0.

License: Geosoft Open License

symb_lst(lst, type)

Populate a GXLST with database symbols.

Parameters:

New in version 5.0.

License: Geosoft Open License

Note: Populates a GXLST with channel, line, blob or user symbols. The name is put into the “Name” part of the GXLST (0), and the handle, an integer value written as a string, is placed in the value part of the GXLST (1).

Line symbols are automatically sorted in logical line order.

NOTE: The GXLST is NOT cleared before being filled. If you want to clear the GXLST and get sorted values, use the chan_lst and line_lst functions.

sync()

Syncronize the Metadata from this database to the XML

New in version 7.0.

License: Geosoft Open License

un_lock_all_symb()

UnLocks all symbols.

New in version 5.1.1.

License: Geosoft Open License

un_lock_symb(symb)

UnLocks a symbol.

Parameters:symb (int) – Symbol to Lock

New in version 5.0.

License: Geosoft Open License

users_max()

Gets Maximum number of Users

Returns:Maximum number of Users
Return type:int

New in version 5.1.1.

License: Geosoft Open License

valid_symb(symb, type)

This method checks to see if the specified symbol is a valid symbol in the database.

Parameters:
Returns:

0 - Invalid symbol 1 - Symbol is valid

Return type:

int

New in version 9.1.

License: Geosoft Open License

window_va_ch(line, i_ch, o_ch, col_s, col_e)

Copy a window of data in a channel into a new channel

Parameters:
  • line (int) – Line symbol
  • i_ch (int) – Original channel
  • o_ch (int) – Output channel
  • col_s (int) – Start column number to copy, 0 is first column
  • col_e (int) – End column number to copy

New in version 5.0.

License: Geosoft Open License

Note: This function normally used for GXVA channels. A copy of the original channel will be made if start and end column numbers to copy are dummies. All the columns including start and end columns will be copied

window_va_ch2(line, i_ch, o_ch, gvv)

Copy a windowed version of data in a channel into a new channel

Parameters:
  • line (int) – Line symbol
  • i_ch (int) – Original channel
  • o_ch (int) – Output channel
  • gvv (GXVV) – GXVV containing 0/1 values for each channel.

New in version 5.0.1.

License: Geosoft Open License

Note: Similar to window_va_ch, but the input and output channels must contain the same number of columns. The input GXVV tells which columns to copy over; 0 values indicate that the output column is to be dummied, and non-zero values indicate the column is to be copied. The GXVV length must be the same as the number of columns.

write_blob_bf(symb, bf)

Write a blob from a file into a database.

Parameters:
  • symb (int) – Blob (DB_SYMB_BLOB) to write into database from file
  • bf (GXBF) – File to write blob into

New in version 5.0.

License: Geosoft Open License

DB_ACTIVITY_BLOB constants

Activity Blob

DB_ACTIVITY_BLOB

Db activity blob

gxapi.DB_ACTIVITY_BLOB = 'OE.DB_ACTIVITY_LOG'

DB_CATEGORY_BLOB constants

Blob Categories

DB_CATEGORY_BLOB_NORMAL

Normal

gxapi.DB_CATEGORY_BLOB_NORMAL = 0

DB_CATEGORY_CHAN constants

Channel Categories For STRING type channels, use negative integers to specify channel width. For example, use -10 to define a string channel with up to 10 characters. Use the GS_SIMPLE_TYPE() macro to convert to INT,REAL or string.

DB_CATEGORY_CHAN_BYTE

Byte

gxapi.DB_CATEGORY_CHAN_BYTE = 0
DB_CATEGORY_CHAN_USHORT

Ushort

gxapi.DB_CATEGORY_CHAN_USHORT = 1
DB_CATEGORY_CHAN_SHORT

Short

gxapi.DB_CATEGORY_CHAN_SHORT = 2
DB_CATEGORY_CHAN_LONG

Long

gxapi.DB_CATEGORY_CHAN_LONG = 3
DB_CATEGORY_CHAN_FLOAT

Float

gxapi.DB_CATEGORY_CHAN_FLOAT = 4
DB_CATEGORY_CHAN_DOUBLE

Double

gxapi.DB_CATEGORY_CHAN_DOUBLE = 5
DB_CATEGORY_CHAN_UBYTE

Ubyte

gxapi.DB_CATEGORY_CHAN_UBYTE = 6
DB_CATEGORY_CHAN_ULONG

Ulong

gxapi.DB_CATEGORY_CHAN_ULONG = 7
DB_CATEGORY_CHAN_LONG64

Long64

gxapi.DB_CATEGORY_CHAN_LONG64 = 8
DB_CATEGORY_CHAN_ULONG64

Ulong64

gxapi.DB_CATEGORY_CHAN_ULONG64 = 9

DB_CATEGORY_LINE constants

Line Categories

DB_CATEGORY_LINE_FLIGHT

Flight

gxapi.DB_CATEGORY_LINE_FLIGHT = 100
DB_CATEGORY_LINE_GROUP

Group

gxapi.DB_CATEGORY_LINE_GROUP = 200
DB_CATEGORY_LINE_NORMAL

Same as DB_CATEGORY_LINE_FLIGHT

gxapi.DB_CATEGORY_LINE_NORMAL = 100

DB_CATEGORY_USER constants

User Categories

DB_CATEGORY_USER_NORMAL

Normal

gxapi.DB_CATEGORY_USER_NORMAL = 0

DB_CHAN_FORMAT constants

Channel formats

DB_CHAN_FORMAT_NORMAL

Normal

gxapi.DB_CHAN_FORMAT_NORMAL = 0
DB_CHAN_FORMAT_EXP

Exp

gxapi.DB_CHAN_FORMAT_EXP = 1
DB_CHAN_FORMAT_TIME

Time

gxapi.DB_CHAN_FORMAT_TIME = 2
DB_CHAN_FORMAT_DATE

Date

gxapi.DB_CHAN_FORMAT_DATE = 3
DB_CHAN_FORMAT_GEOGR

Geogr

gxapi.DB_CHAN_FORMAT_GEOGR = 4
DB_CHAN_FORMAT_SIGDIG

Sigdig

gxapi.DB_CHAN_FORMAT_SIGDIG = 5
DB_CHAN_FORMAT_HEX

Hex

gxapi.DB_CHAN_FORMAT_HEX = 6

DB_CHAN_PROTECTION constants

Channel Read-only Protection Status

DB_CHAN_UNPROTECTED

Db chan unprotected

gxapi.DB_CHAN_UNPROTECTED = 0
DB_CHAN_PROTECTED

Db chan protected

gxapi.DB_CHAN_PROTECTED = 1

DB_CHAN_SYMBOL constants

Channel symbol for special channels

DB_CHAN_X

Db chan x

gxapi.DB_CHAN_X = 0
DB_CHAN_Y

Db chan y

gxapi.DB_CHAN_Y = 1
DB_CHAN_Z

Db chan z

gxapi.DB_CHAN_Z = 2

DB_COMP constants

Supported compression levels

DB_COMP_NONE

None

gxapi.DB_COMP_NONE = 0
DB_COMP_SPEED

Speed

gxapi.DB_COMP_SPEED = 1
DB_COMP_SIZE

Size

gxapi.DB_COMP_SIZE = 2

DB_COORDPAIR constants

DB_COORDPAIR_NONE

None

gxapi.DB_COORDPAIR_NONE = 0
DB_COORDPAIR_X

X

gxapi.DB_COORDPAIR_X = 1
DB_COORDPAIR_Y

Y

gxapi.DB_COORDPAIR_Y = 2

DB_GROUP_CLASS_SIZE constants

Class name max size

DB_GROUP_CLASS_SIZE

Db group class size

gxapi.DB_GROUP_CLASS_SIZE = 16

DB_INFO constants

Integer Database Information

DB_INFO_BLOBS_MAX

Maximum Number of Blobs in the Database

gxapi.DB_INFO_BLOBS_MAX = 0
DB_INFO_LINES_MAX

Maximum number of lines in the database

gxapi.DB_INFO_LINES_MAX = 1
DB_INFO_CHANS_MAX

Maximum Number of Channels in the Database

gxapi.DB_INFO_CHANS_MAX = 2
DB_INFO_USERS_MAX

Maximum number of Users

gxapi.DB_INFO_USERS_MAX = 3
DB_INFO_BLOBS_USED

Number of Blobs currently used

gxapi.DB_INFO_BLOBS_USED = 4
DB_INFO_LINES_USED

Number of Lines currently used

gxapi.DB_INFO_LINES_USED = 5
DB_INFO_CHANS_USED

Number of Channels currently used

gxapi.DB_INFO_CHANS_USED = 6
DB_INFO_USERS_USED

Number of Users in the database

gxapi.DB_INFO_USERS_USED = 7
DB_INFO_PAGE_SIZE

Size of the smallest database block in bytes

gxapi.DB_INFO_PAGE_SIZE = 8
DB_INFO_DATA_SIZE

Number of Blocks in Entire Database

gxapi.DB_INFO_DATA_SIZE = 9
DB_INFO_LOST_SIZE

Number of Lost Blocks in the Database

gxapi.DB_INFO_LOST_SIZE = 10
DB_INFO_FREE_SIZE

Number of Free Blocks in the Database

gxapi.DB_INFO_FREE_SIZE = 11
DB_INFO_COMP_LEVEL

Compression Level in use

gxapi.DB_INFO_COMP_LEVEL = 16
DB_INFO_BLOB_SIZE

Number of pages given to blobs

gxapi.DB_INFO_BLOB_SIZE = 19
DB_INFO_FILE_SIZE

Entire Size of File (in kbytes)

gxapi.DB_INFO_FILE_SIZE = 17
DB_INFO_INDEX_SIZE

Size of Index (in kbytes)

gxapi.DB_INFO_INDEX_SIZE = 18
DB_INFO_MAX_BLOCK_SIZE

Naximum number of bytes in a block

gxapi.DB_INFO_MAX_BLOCK_SIZE = 20
DB_INFO_CHANGESLOST

Will changes to this database be lost when this database is closed?

gxapi.DB_INFO_CHANGESLOST = 21

DB_LINE_LABEL_FORMAT constants

Line Label Formats

DB_LINE_LABEL_FORMAT_LINE

Line

gxapi.DB_LINE_LABEL_FORMAT_LINE = 1
DB_LINE_LABEL_FORMAT_VERSION

Version

gxapi.DB_LINE_LABEL_FORMAT_VERSION = 2
DB_LINE_LABEL_FORMAT_TYPE

Type

gxapi.DB_LINE_LABEL_FORMAT_TYPE = 4
DB_LINE_LABEL_FORMAT_FLIGHT

Flight

gxapi.DB_LINE_LABEL_FORMAT_FLIGHT = 8
DB_LINE_LABEL_FORMAT_FULL

Full

gxapi.DB_LINE_LABEL_FORMAT_FULL = 15
DB_LINE_LABEL_FORMAT_DATE

Date

gxapi.DB_LINE_LABEL_FORMAT_DATE = 16

Link

gxapi.DB_LINE_LABEL_FORMAT_LINK = 7

DB_LINE_SELECT constants

Select modes

DB_LINE_SELECT_INCLUDE

Include

gxapi.DB_LINE_SELECT_INCLUDE = 0
DB_LINE_SELECT_EXCLUDE

Exclude

gxapi.DB_LINE_SELECT_EXCLUDE = 1

DB_LINE_TYPE constants

Line types

DB_LINE_TYPE_NORMAL

Normal

gxapi.DB_LINE_TYPE_NORMAL = 0
DB_LINE_TYPE_BASE

Base

gxapi.DB_LINE_TYPE_BASE = 1
DB_LINE_TYPE_TIE

Tie

gxapi.DB_LINE_TYPE_TIE = 2
DB_LINE_TYPE_TEST

Test

gxapi.DB_LINE_TYPE_TEST = 3
DB_LINE_TYPE_TREND

Trend

gxapi.DB_LINE_TYPE_TREND = 4
DB_LINE_TYPE_SPECIAL

Special

gxapi.DB_LINE_TYPE_SPECIAL = 5
DB_LINE_TYPE_RANDOM

Random

gxapi.DB_LINE_TYPE_RANDOM = 6

DB_LOCK constants

Lock Modes

DB_LOCK_NONE

Used only by GetSymbLock_DB

gxapi.DB_LOCK_NONE = -1
DB_LOCK_READONLY

Readonly

gxapi.DB_LOCK_READONLY = 0
DB_LOCK_READWRITE

Readwrite

gxapi.DB_LOCK_READWRITE = 1

DB_NAME constants

Get Database file names

DB_NAME_FILE

File

gxapi.DB_NAME_FILE = 0

DB_OWN constants

Symbol Ownership

DB_OWN_SHARED

Shared

gxapi.DB_OWN_SHARED = 0
DB_OWN_USER

User

gxapi.DB_OWN_USER = 1

DB_SYMB_TYPE constants

Symbol types

DB_SYMB_BLOB

Db symb blob

gxapi.DB_SYMB_BLOB = 0
DB_SYMB_LINE

Db symb line

gxapi.DB_SYMB_LINE = 1
DB_SYMB_CHAN

Db symb chan

gxapi.DB_SYMB_CHAN = 2
DB_SYMB_USER

Db symb user

gxapi.DB_SYMB_USER = 3

DB_SYMB_NAME_SIZE constants

Size of Symbol Names

DB_SYMB_NAME_SIZE

Same STR_DB_SYMBOL

gxapi.DB_SYMB_NAME_SIZE = 64

DB_WAIT constants

Wait Times

DB_WAIT_NONE

None

gxapi.DB_WAIT_NONE = 0
DB_WAIT_INFINITY

Infinity

gxapi.DB_WAIT_INFINITY = -1

DB_ARRAY_BASETYPE constants

DB_ARRAY_BASETYPE_NONE

None

gxapi.DB_ARRAY_BASETYPE_NONE = 0
DB_ARRAY_BASETYPE_TIME_WINDOWS

Time windows

gxapi.DB_ARRAY_BASETYPE_TIME_WINDOWS = 1
DB_ARRAY_BASETYPE_TIMES

Times

gxapi.DB_ARRAY_BASETYPE_TIMES = 2
DB_ARRAY_BASETYPE_FREQUENCIES

Frequencies

gxapi.DB_ARRAY_BASETYPE_FREQUENCIES = 3
DB_ARRAY_BASETYPE_ELEVATIONS

Elevations

gxapi.DB_ARRAY_BASETYPE_ELEVATIONS = 4
DB_ARRAY_BASETYPE_DEPTHS

Depths

gxapi.DB_ARRAY_BASETYPE_DEPTHS = 5
DB_ARRAY_BASETYPE_VELOCITIES

Velocities

gxapi.DB_ARRAY_BASETYPE_VELOCITIES = 6
DB_ARRAY_BASETYPE_DISCRETE_TIME_WINDOWS

Discrete time windows

gxapi.DB_ARRAY_BASETYPE_DISCRETE_TIME_WINDOWS = 7

NULLSYMB constants

Database Null

NULLSYMB

Nullsymb

gxapi.NULLSYMB = -1