GXDB class¶
- class GXDB(handle=0)[source]¶
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 blobsNote:
The following defines are not used by any methods but are used by GX’s:
- add_associated_load(group, chan)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
Load a
GXLST
object with array (GXVA
) channel symbols.- Parameters:
lst (GXLST) – List to Populate (construct with CreateSymbLST_DB)
New in version 5.0.
License: Geosoft Open License
- array_size_lst(columns, lst)[source]¶
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 (construct with CreateSymbLST_DB)
New in version 8.2.
License: Geosoft Open License
- associate(group, chan)[source]¶
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)[source]¶
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)[source]¶
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()[source]¶
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)[source]¶
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.See also
- classmethod can_open_read_only(file, user, password)[source]¶
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.See also
- chan_lst(lst)[source]¶
Load a
GXLST
with database channels.- Parameters:
lst (GXLST) – List to Populate (construct with CreateSymbLST_DB)
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 theGXLST
(0), and the handle, an integer value written as a string, is placed in the value part of theGXLST
(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()[source]¶
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()[source]¶
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)[source]¶
Place a list of channels for a given class in a
GXVV
.- Parameters:
- 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 inGXCHIMERA
.
- class_chan_lst(lst, cl)[source]¶
Load a
GXLST
with channels in a particular class.- Parameters:
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)[source]¶
Load a
GXLST
with group lines in a particular class.- Parameters:
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()[source]¶
This method forces all changes to the database to be saved.
New in version 5.0.
License: Geosoft Open License
- compact()[source]¶
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)[source]¶
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:
- 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)[source]¶
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()[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
Create a new Symbol.
- Parameters:
name (str) – Symbol Name
symb (int) – DB_SYMB_TYPE constants
owner (int) – DB_OWN constants
category (int) – DB_CATEGORY_USER constants, DB_CATEGORY_LINE constants, DB_CATEGORY_CHAN constants, DB_CATEGORY_BLOB constants
- 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 aGXBF
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 theGXBF
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)[source]¶
Create a new Symbol.
- Parameters:
name (str) – Symbol Name
symb (int) – DB_SYMB_TYPE constants
owner (int) – DB_OWN constants
category (int) – DB_CATEGORY_USER constants, DB_CATEGORY_LINE constants, DB_CATEGORY_CHAN constants, DB_CATEGORY_BLOB constants
extra (int) – Extra info, which depends on DB_SYMB_TYPE constants
DB_SYMB_CHAN
- element width for aGXVA
channel ignores for all other DB_SYMB_TYPE constants types
- 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.
- classmethod create_symb_lst()[source]¶
Create a
GXLST
object large enough to contain channel names and symbols numbers.- Return type:
New in version 9.8.
License: Geosoft Open License
- csv_chan_lst(lst, channels)[source]¶
Load a
GXLST
with channels in a comma-separated list.- Parameters:
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()[source]¶
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)[source]¶
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()[source]¶
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_name)[source]¶
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_name (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_name)[source]¶
New Symbol by duplicating an existing symbol, LOCKED
- Parameters:
symb (int) – Symbol Handle to duplicate
new_name (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_across(dbo, symb)[source]¶
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_name)[source]¶
New Symbol by duplicating an existing symbol, NO LOCK.
- Parameters:
symb (int) – Symbol Handle to duplicate
new_name (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
- easy_maker_symb(symb, name, groups)[source]¶
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)[source]¶
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)[source]¶
This method checks to see if the specified symbol exists in the database.
- Parameters:
symb (str) – Name of Symbol
type (int) – DB_SYMB_TYPE constants
- 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)[source]¶
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 theGXVA
element number in square brackets as part of theGXVA
channel name (e.g. “EM[3]” will treat the fourth column of theGXVA
channel as aGXVV
).See notes for
find_symb
. Introduced in v5.1.3. The newfind_chan
searches using the exact channel name.
- find_symb(symb, type)[source]¶
Get handle to the specified symbol.
- Parameters:
symb (str) – Name of symbol
type (int) – DB_SYMB_TYPE constants
- 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 theGXVA
element number in square brackets as part of theGXVA
channel name (e.g. “EM[3]” will treat the fourth column of theGXVA
channel as aGXVV
).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()[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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
orDB_LOCK_READWRITE
- get_chan_decimal(chan)[source]¶
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
orDB_LOCK_READWRITE
- get_chan_double(line, chan, ind)[source]¶
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)[source]¶
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
orDB_LOCK_READWRITE
- get_chan_int(line, chan, ind)[source]¶
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)[source]¶
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
orDB_LOCK_READWRITE
- get_chan_name(chan, name)[source]¶
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
orDB_LOCK_READWRITE
- get_chan_order_lst(lst)[source]¶
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, callset_chan_order_lst
after.New in version 5.0.8.
License: Geosoft Open License
- get_chan_protect(chan)[source]¶
This method gets a channel’s read-only protection status.
- Parameters:
chan (int) – Channel handle
- Returns:
- Return type:
int
New in version 6.0.1.
License: Geosoft Open License
Note: The channel must be locked
DB_LOCK_READONLY
orDB_LOCK_READWRITE
- get_chan_str(line, chan, ind, str_val)[source]¶
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)[source]¶
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
orDB_LOCK_READWRITE
- get_chan_unit(chan, unit)[source]¶
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
orDB_LOCK_READWRITE
- get_chan_va(line, chan, va)[source]¶
Place the contents of a channel in a
GXVA
.New in version 5.0.
License: Geosoft Open License
See also
GXVA
class.
- get_chan_vv(line, chan, vv)[source]¶
Place the contents of a channel in a
GXVV
.New in version 5.0.
License: Geosoft Open License
Note: If a
GXVA
channel is specified, then element [0] of thisGXVA
channel is used to populated theGXVV
.See also
GXVV
class.
- get_chan_vv_expanded(line, chan, vv)[source]¶
Read a channel into a
GXVV
. If the channel is aGXVA
channel it is treaded as aGXVV
channel with multiple values per fid and the FID expation is set to the array size.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)[source]¶
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
orDB_LOCK_READWRITE
- get_channel_length(line, chan)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
Set the Class name for a group line.
- Parameters:
symb (int) – Group line -
DB_LOCK_READWRITE
orDB_LOCK_READONLY
cl (str_ref) – Returned class name - max size =
DB_GROUP_CLASS_SIZE
- 1
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)[source]¶
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)[source]¶
Get georeference information in an
GXIPJ
.New in version 5.0.
License: Geosoft Open License
Note: If the channel does not have an
GXIPJ
, theGXIPJ
that is returned will have an unknown projection.
- get_itr(ch, itr)[source]¶
Get
GXITR
for a channel.New in version 5.0.
License: Geosoft Open License
Note: If a channel does not have an
GXITR
,get_itr
will not change the passedGXITR
. Channel must be locked for READONLY or READWRITE.
- get_line_map_fid(line, start, end)[source]¶
This method gets a line map clip fiducial.
- Parameters:
New in version 5.1.1.
License: Geosoft Open License
Note: The channel must be locked
DB_LOCK_READONLY
orDB_LOCK_READWRITE
- get_line_selection(line)[source]¶
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)[source]¶
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_modification_count()[source]¶
Gets the modification count from the database.
- Return type:
int
New in version 2023.0.
License: Geosoft Open License
Note: A running count of the times a database has been modified between commits. Useful, for instance to be able to discard changes made by a GX on a database that are required for the operation of the GX but which the user does not want to persist, and to avoid the Save changes question when you go to change the database. So if the count is 0 when you start, it is safe to call Discard_DB on exit without worrying about throwing away changes made previously.
- get_name(name, psz_name)[source]¶
Gets a name from the database.
- Parameters:
name (int) – DB_NAME constants
psz_name (str_ref) – Name returned
New in version 5.0.
License: Geosoft Open License
- get_reg_symb(symb, reg)[source]¶
Get a
GXREG
object from a symbol- Parameters:
New in version 5.0.
License: Geosoft Open License
- get_reg_symb_setting(symb, name, setting)[source]¶
Get a
GXREG
string setting from a symbol reg- Parameters:
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 theGXREG
directly.
- get_reg_symb_setting_double(symb, name)[source]¶
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 theGXREG
directly.
- get_reg_symb_setting_int(symb, name)[source]¶
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 theGXREG
directly.
- get_select()[source]¶
Gets the Line Selections.
- Returns:
Selections Object.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- get_symb_lock(symb)[source]¶
Determines if a symbol is locked
- Parameters:
symb (int) – Symbol to Lock
- Returns:
- Return type:
int
New in version 6.3.
License: Geosoft Open License
- get_symb_name(symb, name)[source]¶
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
orDB_LOCK_READWRITE
- get_va_base_coordinate_info(ch, domain, base, vv, units)[source]¶
Set the array channel base coordinate type, offset and values.
- Parameters:
ch (int) – Channel (Locked
DB_LOCK_READONLY
)domain (int_ref) – DB_ARRAY_BASETYPE constants
base (float_ref) – Optional offset or base frequency
vv (GXVV) – Values (one per array channel column) (REAL)
units (str_ref) – Units
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)[source]¶
Place the contents of a specific part of a channel in a
GXVV
.- Parameters:
New in version 5.1.1.
License: Geosoft Open License
Note: If a
GXVA
channel is specified, then element [0] of thisGXVA
channel is used to populated theGXVV
.See also
GXVV
class.
- get_va_prof_color_file(ch, file)[source]¶
Get colors for a
GXVA
channel when displayed in the profile window.- Parameters:
ch (int) – Channel (Locked
DB_LOCK_READWRITE
)file (str_ref) – Zone file name, “” to clear.
New in version 5.1.5.
License: Geosoft Open License
Note: See
set_va_prof_color_file
.
- get_va_prof_sect_option(ch, option)[source]¶
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)[source]¶
Get base and range for
GXVA
channel cell display.- Parameters:
ch (int) – Channel (Locked
DB_LOCK_READWRITE
)base (float_ref) – Base value (rDummy for none)
range (float_ref) – Range value (rDummy for none)
New in version 5.1.5.
License: Geosoft Open License
Note: See
set_va_scaling
.
- get_va_sect_color_file(ch, file)[source]¶
Get colors for a
GXVA
channel when displayed section in the profile window.- Parameters:
ch (int) – Channel (Locked
DB_LOCK_READWRITE
)file (str_ref) – Zone file name
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)[source]¶
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)[source]¶
Gets current X, Y or Z channel name
- Parameters:
chan_symb (int) – DB_CHAN_SYMBOL constants
chan (str_ref) – Returned name
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)[source]¶
Searches for current X, Y or Z channel symbol
- Parameters:
chan (int) – DB_CHAN_SYMBOL constants
- Returns:
x - Symbol Handle
NULLSYMB
- Symbol not foundsearches 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)[source]¶
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)[source]¶
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
, theGXITR
colors are used to display channel values in the spreadsheet.If a channel does not have an
GXITR
,get_itr
will not change the passedGXITR
.
- is_associated(group, chan)[source]¶
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)[source]¶
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)[source]¶
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()[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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()[source]¶
Check if this is a null (undefined) instance
- Returns:
True if this is a null (undefined) instance, False otherwise.
- Return type:
bool
- is_wholeplot()[source]¶
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)[source]¶
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
orDB_LOCK_READWRITE
This function simply returns a value set using the
set_line_bearing
function. It returnsrDUMMY
for line categories other thanDB_CATEGORY_LINE_FLIGHT
.To calculate the line azimuth based on the first and last non-dummy locations, use the
GXDU.direction
function.See also
- line_category(line)[source]¶
This method returns the category (group, line) of a line.
- Parameters:
line (int) – Line handle to look at
- Returns:
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Note: The channel must be locked
DB_LOCK_READONLY
orDB_LOCK_READWRITE
- line_date(line)[source]¶
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
orDB_LOCK_READWRITE
- line_flight(line)[source]¶
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
orDB_LOCK_READWRITE
- line_label(line, label, format)[source]¶
Create a line label
- Parameters:
line (int) – Line symbol
label (str_ref) – String in which to place label
format (int) – DB_LINE_LABEL_FORMAT constants
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)[source]¶
Load a
GXLST
with database lines.- Parameters:
lst (GXLST) – List to Populate (construct with CreateSymbLST_DB)
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 theGXLST
(0), and the handle, an integer value written as a string, is placed in the value part of theGXLST
(1). TheGXLST
is cleared first, and the items are sorted in logical line order.
- line_number(line)[source]¶
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 line must be locked
DB_LOCK_READONLY
orDB_LOCK_READWRITE
- line_number2(line, line_number)[source]¶
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 line must be locked
DB_LOCK_READONLY
orDB_LOCK_READWRITE
- line_type(line)[source]¶
This method returns the type of a line.
- Parameters:
line (int) – Line handle to look at
- Returns:
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Note: The line must be locked
DB_LOCK_READONLY
orDB_LOCK_READWRITE
- line_version(line)[source]¶
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 line must be locked
DB_LOCK_READONLY
orDB_LOCK_READWRITE
- lines_max()[source]¶
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)[source]¶
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)[source]¶
Locks a symbol for READONLY or READWRITE.
- Parameters:
symb (int) – Symbol to Lock
lock (int) – DB_LOCK constants
wait (int) – DB_WAIT constants
New in version 5.0.
License: Geosoft Open License
- maker_symb(symb, prog, name, groups)[source]¶
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)[source]¶
Load a
GXLST
with mask channels.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 ifGXCHIMERA
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)[source]¶
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
- non_string_and_non_array_chan_lst(lst)[source]¶
Load a
GXLST
with non-string and non-array database channels.- Parameters:
lst (GXLST) – List to Populate (construct with CreateSymbLST_DB)
New in version 9.9.
License: Geosoft Open License
Note: Like
chan_lst
, but does not include array channels, virtual channels or string channels.
- normal_chan_lst(lst)[source]¶
Load a
GXLST
with non-array database channels.- Parameters:
lst (GXLST) – List to Populate (construct with CreateSymbLST_DB)
New in version 8.2.
License: Geosoft Open License
Note: Like
chan_lst
, but does not include array channels or virtual channels.
- classmethod open(file, user, password)[source]¶
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:
New in version 5.0.
License: Geosoft Open License
See also
- classmethod open_read_only(file, user, password)[source]¶
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:
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 withopen
or locked in the application withGXEDB.lock
.See also
- put_chan_va(line, chan, va)[source]¶
Place the contents of a
GXVA
in a channel.New in version 5.0.
License: Geosoft Open License
See also
GXVA
class.
- put_chan_vv(line, chan, vv)[source]¶
Place the contents of a
GXVV
in a channel.New in version 5.0.
License: Geosoft Open License
Note: If a
GXVA
channel is specified, then element [0] of thisGXVA
channel will be populated with theGXVV
.There is a limit of 2000 elements for non-licensed users.
See also
GXVV
class.
- put_va_chan_vv(line, chan, vv, offset, items)[source]¶
Place the contents of a
GXVV
at a specific part of a channel.- Parameters:
New in version 5.1.1.
License: Geosoft Open License
Note: If a
GXVA
channel is specified, then element [0] of thisGXVA
channel will be populated with theGXVV
.See also
GXVV
class.
- read_blob_bf(symb, bf)[source]¶
Read a blob from a database into a file.
- Parameters:
symb (int) – Blob (
DB_SYMB_BLOB
) to read intoGXBF
from databasebf (GXBF) – File to read blob from
New in version 5.0.
License: Geosoft Open License
- rename_line(line, al_num, type, ver)[source]¶
Change the name for a line.
- Parameters:
line (int) – Line handle of line to modify (READWRITE
al_num (str) – Line number (alphanumeric)
type (int) – Line type
ver (int) – Line version
New in version 9.9.
License: Geosoft Open License
Note: The line must be locked :const:`DB_LOCK_READWRITE’ Sets/resets the name of an existing line directly from line type, number, and version. The line number can be any combination of letters and numbers, i.e. XU324, 98765, A, 23NGV etc. Returns an error if the renamed line already exists.
- classmethod repair(file)[source]¶
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)[source]¶
Saves current selections to a file.
- Parameters:
file (str) – File Name
New in version 5.0.
License: Geosoft Open License
- select(select, mode)[source]¶
Select/deselect lines based on selection string
- Parameters:
select (str) – Selection
mode (int) – DB_LINE_SELECT constants
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)[source]¶
Load a
GXLST
with the selected lines.- Parameters:
lst (GXLST) – List to Populate (construct with CreateSymbLST_DB)
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 theGXLST
(0), and the handle, an integer value written as a string, is placed in the value part of theGXLST
(1).Symbols are automatically sorted in logical line order.
- set_all_chan_protect(prot)[source]¶
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
orDB_CHAN_UNPROTECTED
This method does its own channel locking/unlocking. Channels already lockDB_LOCK_READONLY
are ignored.
- set_chan_class(chan, cl)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
This method sets a channel’s display format.
- Parameters:
chan (int) – Channel handle
format (int) – DB_CHAN_FORMAT constants
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
This method sets the channel display order for a database. The list to modify will be stored in an
GXLST
object. Callget_chan_order_lst
to populate theGXLST
.New in version 5.0.8.
License: Geosoft Open License
- set_chan_protect(chan, prot)[source]¶
This method sets a channel’s read-only protection status.
- Parameters:
chan (int) – Channel handle
prot (int) – DB_CHAN_PROTECTION constants
New in version 5.0.
License: Geosoft Open License
Note: Value to set must be either
DB_CHAN_PROTECTED
orDB_CHAN_UNPROTECTED
The channel must be lockedDB_LOCK_READWRITE
- set_chan_str(line, chan, ind, str_val)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
Set the Class name for a group line.
- Parameters:
symb (int) – Group line -
DB_LOCK_READWRITE
cl (str) –
DB_GROUP_CLASS_SIZE
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)[source]¶
Set an
GXIPJ
object into a pair of (X, Y) channels- Parameters:
ch1 (int) – X channel
ch2 (int) – Y channel
New in version 5.0.
License: Geosoft Open License
- set_itr(ch, itr)[source]¶
Set
GXITR
for a channel.New in version 5.0.
License: Geosoft Open License
Note: Use
ITR_NULL
to clear the channelGXITR
. Channel must be locked for READONLY or READWRITE.
- set_line_bearing(line, bearing)[source]¶
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 thanDB_CATEGORY_LINE_FLIGHT
.See also
- set_line_date(line, date)[source]¶
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)[source]¶
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)[source]¶
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 torMAX
. for no data, set Start and End Fids torDUMMY
.
- classmethod set_line_name(num, type, ver, name)[source]¶
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
ordelete_symb
for an operation on a line. See also SetLineName2_DB.
- classmethod set_line_name2(al_num, type, ver, name)[source]¶
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
ordelete_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)[source]¶
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)[source]¶
Set the selection status for a line.
- Parameters:
line (int) – Handle of line to select/deselect
mode (int) – DB_LINE_SELECT constants
New in version 9.0.
License: Geosoft Open License
- set_line_type(line, type)[source]¶
This method sets a line’s type.
- Parameters:
line (int) – Line handle
type (int) – DB_LINE_TYPE constants
New in version 5.0.
License: Geosoft Open License
Note: The channel must be locked
DB_LOCK_READWRITE
- set_line_ver(line, ver)[source]¶
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)[source]¶
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)[source]¶
Set a
GXREG
object into a symbol- Parameters:
New in version 5.0.
License: Geosoft Open License
- set_reg_symb_setting(symb, name, setting)[source]¶
Set a
GXREG
string setting in a symbol reg- Parameters:
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 theGXREG
directly.
- set_select(sel)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
Set colors for a
GXVA
channel when displayed section in the profile window.- Parameters:
ch (int) – Channel (Locked
DB_LOCK_READWRITE
)file (str) – Zone file name
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)[source]¶
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)[source]¶
Sets current X, Y or Z channel name
- Parameters:
chan_symb (int) – DB_CHAN_SYMBOL constants
chan (str) – Channel name
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)[source]¶
Load a
GXLST
with string-type 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 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)[source]¶
Place a list of symbols in a
GXVV
.- Parameters:
symb (int) – DB_SYMB_TYPE constants
- Returns:
Number of symbols.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- symb_lst(lst, type)[source]¶
Populate a
GXLST
with database symbols.- Parameters:
lst (GXLST) – List to Populate (construct with CreateSymbLST_DB)
type (int) – DB_SYMB_TYPE constants
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 theGXLST
(0), and the handle, an integer value written as a string, is placed in the value part of theGXLST
(1).Line symbols are automatically sorted in logical line order.
NOTE: The
GXLST
is NOT cleared before being filled. If you want to clear theGXLST
and get sorted values, use thechan_lst
andline_lst
functions.See also
- sync()[source]¶
Syncronize the Metadata from this database to the XML
New in version 7.0.
License: Geosoft Open License
- un_lock_all_symb()[source]¶
UnLocks all symbols.
New in version 5.1.1.
License: Geosoft Open License
- un_lock_symb(symb)[source]¶
UnLocks a symbol.
- Parameters:
symb (int) – Symbol to Lock
New in version 5.0.
License: Geosoft Open License
- users_max()[source]¶
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)[source]¶
This method checks to see if the specified symbol is a valid symbol in the database.
- Parameters:
symb (int) – Symbol to check
type (int) – DB_SYMB_TYPE constants
- 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)[source]¶
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)[source]¶
Copy a windowed version of data in a channel into a new channel
- Parameters:
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 inputGXVV
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. TheGXVV
length must be the same as the number of columns.
- write_blob_bf(symb, bf)[source]¶
Write a blob from a file into a database.
- Parameters:
symb (int) – Blob (
DB_SYMB_BLOB
) to write into database from filebf (GXBF) – File to write blob into
New in version 5.0.
License: Geosoft Open License
DB_ACTIVITY_BLOB constants¶
Activity Blob
DB_CATEGORY_BLOB constants¶
Blob Categories
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_LINE constants¶
Line Categories
- DB_CATEGORY_LINE_NORMAL¶
Same as
DB_CATEGORY_LINE_FLIGHT
- gxapi.DB_CATEGORY_LINE_NORMAL = 100¶
DB_CATEGORY_USER constants¶
User Categories
DB_CHAN_FORMAT constants¶
Channel formats
DB_CHAN_PROTECTION constants¶
Channel Read-only Protection Status
DB_CHAN_SYMBOL constants¶
Channel symbol for special channels
DB_COMP constants¶
Supported compression levels
DB_COORDPAIR constants¶
Used to indicate the matching coordinate pair of a channel.
DB_GROUP_CLASS_SIZE constants¶
Class name max size
DB_INFO constants¶
Integer Database Information
DB_LINE_LABEL_FORMAT constants¶
Line Label Formats
DB_LINE_SELECT constants¶
Select modes
DB_LINE_TYPE constants¶
Line types
DB_LOCK constants¶
Lock Modes
DB_NAME constants¶
Get Database file names
DB_OWN constants¶
Symbol Ownership
DB_SYMB_TYPE constants¶
Symbol types
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_ARRAY_BASETYPE constants¶
Array channel base coordinate type
NULLSYMB constants¶
Database Null