GXDU class

class GXDU(handle=0)

GXDU class.

GXDU functions provide a variety of common utilities that can be applied efficiently to the contents of a database. Most GXDU library functions take as their first argument a GXDB object, and apply standard processes to data stored in an OASIS database, including import and export functions.

Note:

The following defines are used by GX functions but are not required for any methods:

DU_LINES constants

classmethod ado_table_names(connect, vv)

Scans a ADO-compliant database and returns the table names in a GXVV

Parameters:
  • connect (str) – Database connection string
  • vv (GXVV) – GXVV to return names in

New in version 5.0.8.

License: Geosoft End-User License

Note: The GXVV must be created to hold strings of length STR_DB_SYMBOL; i.e. use Creat_VV(-STR_DB_SYMBOL, 0), or it will assert.

classmethod an_sig(db, line, i_ch, o_ch)

Calculate the Analytic Signal of a channel.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod append(d_bi, d_bo, ignore)

Append a source database onto a destination database.

Parameters:
  • d_bi (GXDB) – Source Database
  • d_bo (GXDB) – Destination Database
  • ignore (int) – Ignore write protection on channels? (TRUE or FALSE)

New in version 5.0.

License: Geosoft End-User License

Note: If the source database and destination database have channels with the same name, then data is appended onto the end of the channel in lines which have the same number.

If a channel in the destination database is not also in the source database, it is ignored.

classmethod avg_azimuth(db, precision, azimuth)

Returns average azimuth of selected lines.

Parameters:
  • db (GXDB) – Database Object
  • precision (float) – Precision in degrees (1 to 45)
  • azimuth (float_ref) – Azimuth value returned

New in version 5.0.

License: Geosoft End-User License

Note: Direction in degrees azimuth (clockwise relative the +Y direction). The result is in the range -90 < azimuth <= 90. The method handles lines going in opposite directions (they do not average to 0!) The method takes a precision, which is used to generate a series of “test” angles. The dot product of the line directions is taken with each of the test angles, and the absolute values summed. The maximum value occurs at the angle which most closely approximates the trend direction of the lines.

classmethod b_spline(db, line, i_ch, o_ch, sd, rou, tau)

B-spline Interpolate a Channel.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line handle
  • i_ch (int) – Channel to interpolate [DB_LOCK_READONLY]
  • o_ch (int) – Output interpolated channel [DB_LOCK_READWRITE]
  • sd (float) – Data error (Std Dev > 0.0)
  • rou (float) – Roughness (Rou > 0.0)
  • tau (float) – Tension (0.<= Tension <=1.)

New in version 5.0.

License: Geosoft End-User License

See also

trend

classmethod base_data(db, line, in_ch, time_ch, out_ch, tb)

This method corrects an entire database line using a time-based correction table. It is given 2 input channel tokens and 1 output channel token as well as the table object to use.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line Handle to apply correction to
  • in_ch (int) – Input Channel Token [DB_LOCK_READONLY]
  • time_ch (int) – Time Channel Token [DB_LOCK_READONLY]
  • out_ch (int) – Output Channel Token [DB_LOCK_READWRITE]
  • tb (GXTB) – Table Object (a Date/Time/Correction Table)

New in version 5.0.

License: Geosoft End-User License

classmethod base_data_ex(db, line, in_ch, time_ch, out_ch, tb, flag)

This method corrects an entire database line using a time-based correction table. It is given 2 input channel tokens and 1 output channel token as well as the table object to use (table sort flag=1 for sort, =0 for no sort).

Parameters:
  • db (GXDB) – Database
  • line (int) – Line Handle to apply correction to
  • in_ch (int) – Input Channel Token [DB_LOCK_READONLY]
  • time_ch (int) – Time Channel Token [DB_LOCK_READONLY]
  • out_ch (int) – Output Channel Token [DB_LOCK_READWRITE]
  • tb (GXTB) – Table Object (a Date/Time/Correction Table)
  • flag (int) – Table sort flag: 0 - do not sort, 1 - do sort.

New in version 5.1.8.

License: Geosoft End-User License

classmethod bound_line(db, line, x_chan, y_chan, pply)

Set map boundary clip limits.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod bp_filt(db, line, i_ch, o_ch, sw, lw, filt_len)

This method applies a band-pass filter to the specified line/channel and places the output in the output channel.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line handle
  • i_ch (int) – Input channel to filter [DB_LOCK_READONLY]
  • o_ch (int) – Output filtered channel [DB_LOCK_READWRITE]
  • sw (float) – Short wavelength cutoff, 0 for highpass
  • lw (float) – Long wavelength cutoff, 0 for lowpass
  • filt_len (int) – Filter Length, 0 for default length

New in version 5.0.

License: Geosoft End-User License

Note: If the short and long wavelengths are <= 0, the input channel is simply copied to the output channel without filtering.

classmethod break_line(db, line, chan)

Break up a line based on line numbers in a channel.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod break_line2(db, line, chan, reset_fi_ds)

Break up a line based on line numbers in a channel.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line to be broken up [DB_LOCK_READONLY]
  • chan (int) – Channel containing line numbers [DB_LOCK_READONLY]
  • reset_fi_ds (int) – Reset starting fiducials to zero (0: No, 1: Yes)

New in version 8.4.

License: Geosoft End-User License

Note: The same as BreakLine, but with an option to reset each line’s starting fiducial to zero.

classmethod break_line_to_groups(db, line, chan, cl)

Break up a line into group-lines based on a channel.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line to be broken up [DB_LOCK_READONLY]
  • chan (int) – Channel containing line numbers [DB_LOCK_READONLY]
  • cl (str) – Class name for new group lines (can be “”)

New in version 5.1.8.

License: Geosoft End-User License

Note: The original line will be deleted. This is similar to break_line, but the output lines are “group” lines, without the line type letters at the start. (See db.gxh for information of Group Lines). All channels are associated with each group line, and the input class name is assigned to each group. Class names for groups ensure that (for instance) if you add a new channel to one group of a given class, it will get added to all other groups in the same class. If the class name is left empty, then this will NOT be true. (Groups without class names are treated as isolated entities for the purposes of channel loading).

classmethod break_line_to_groups2(db, line, chan, cl, reset_fi_ds)

Break up a line into group-lines based on a channel.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line to be broken up [DB_LOCK_READONLY]
  • chan (int) – Channel containing line numbers [DB_LOCK_READONLY]
  • cl (str) – Class name for new group lines (can be “”)
  • reset_fi_ds (int) – Reset starting fiducials to zero (0: No, 1: Yes)

New in version 8.4.

License: Geosoft End-User License

Note: The same as BreakLineToGroups, but with an option to reset each line’s starting fiducial to zero.

classmethod calculate_draped_survey_altitude(db, line, x_ch, y_ch, img, z_ch, ascent, descent, drape_height, n_hanning, hanning_width, min_curvature)

Calculate a draped flight path, enforcing maximum descent and ascent rates.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line [DB_LOCK_READONLY]
  • x_ch (int) – X Channel [DB_LOCK_READONLY]
  • y_ch (int) – Y Channel [DB_LOCK_READONLY]
  • img (GXIMG) – Topography grid
  • z_ch (int) – Output draped altitude channel [DB_LOCK_READWRITE]
  • ascent (float) – Maximum rate of ascent (%)
  • descent (float) – Maximum rate of descent (%)
  • drape_height (float) – Minimum terrain clearance (drape height)
  • n_hanning (int) – Number of times to apply Hanning Filter
  • hanning_width (float) – Width of Hanning Filter
  • min_curvature (float) – Minimum radius of curvature down slopes and at valley bottoms (rDUMMY to disable)

New in version 8.3.

License: Geosoft End-User License

Note: Calculate a draped flight path, enforcing maximum descent and ascent rates. Additional Inputs are the sample distance along the line and a topography grid.

classmethod calculate_draped_survey_altitude2(db, line, x_ch, y_ch, img, dem_ch, z_ch, ascent, descent, drape_height, min_drape_height, n_hanning, hanning_width, min_curvature)

Calculate a draped flight path, enforcing maximum descent and ascent rates.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line [DB_LOCK_READONLY]
  • x_ch (int) – X Channel [DB_LOCK_READONLY]
  • y_ch (int) – Y Channel [DB_LOCK_READONLY]
  • img (GXIMG) – Topography grid
  • dem_ch (int) – Output DEM channel [DB_LOCK_READWRITE] (can be NULLSYMB if not required)
  • z_ch (int) – Output draped altitude channel [DB_LOCK_READWRITE]
  • ascent (float) – Maximum rate of ascent (%)
  • descent (float) – Maximum rate of descent (%)
  • drape_height (float) – Nominal terrain clearance (drape height)
  • min_drape_height (float) – Minimum terrain clearance (hard minimum drape height)
  • n_hanning (int) – Number of times to apply Hanning Filter
  • hanning_width (float) – Width of Hanning Filter
  • min_curvature (float) – Minimum radius of curvature down slopes and at valley bottoms (rDUMMY to disable)

New in version 8.4.

License: Geosoft End-User License

Note: Calculate a draped flight path, enforcing maximum descent and ascent rates. Set both a nominal and minimum drape height. Additional Inputs are the sample distance along the line and a topography grid.

classmethod closest_point(db, x, y, xp, yp, line, fid)

Return closest data point to input location.

Parameters:
  • x (float) – X location
  • y (float) – Y location
  • xp (float_ref) – Located X location
  • yp (float_ref) – Located Y location
  • line (int_ref) – Line for located point
  • fid (float_ref) – Fiducial of located point

New in version 6.2.

License: Geosoft End-User License

Note: Selected lines are scanned for the (X, Y) location which is closest to the input location. The line and fiducial of the point are returned.

Will register an error if no valid (X, Y) locations are found.

classmethod copy_line(db, i_line, o_line)

Copy a line.

Parameters:

New in version 5.0.

License: Geosoft End-User License

Note: Existing channels in the output line will be replaced by copied channels.

classmethod copy_line_across(idb, i_line, odb, o_line)

Copy a line from one database to another.

Parameters:

New in version 5.0.

License: Geosoft Open License

Note: Existing channels in the output line will be replaced by copied channels.

See also

copy_line_chan_across function

classmethod copy_line_chan_across(idb, i_line, vv_chan, odb, o_line)

Copy a list of channels in a line from one database to another.

Parameters:

New in version 5.0.

License: Geosoft Open License

Note: Existing channels in the output line will be replaced by copied channels.

See also

copy_line_across function

classmethod copy_line_masked(db, i_line, mask, prune, o_line)

Copy a line, prune items based on a mask channel

Parameters:

New in version 5.0.8.

License: Geosoft Open License

Note: The input line’s channel data is ReFidded to the mask channel, and then pruned from the output line data, based on the value of the VVU_PRUNE_XXX variable. For VVU_PRUNE_DUMMY, only those items where the mask channel value is not a dummy are retained, while the complement is retained for VV_PRUNE_VALID.

classmethod create_drillhole_parameter_weight_constraint_database(db, ch, reg, database)

Used for weighting inversion models.

Parameters:
  • db (GXDB) – Database (selected lines used)
  • ch (int) – Property channel handle [DB_LOCK_READONLY]
  • reg (GXREG) – Parameters (see notes)
  • database (str) – Output database

New in version 8.2.

License: Geosoft End-User License

Note: Control parameters are passed in the GXREG (to allow for future expansion without the need to modify the wrappers). The input drillhole database must contain current X, Y and Z channels. Drillhole data should be equally spaced (or nearly so) down the hole. Weights are calculated on a circle perpendicular to the hole at each point.

RADIUS - Maximum radius from drillhole to create weighting points (Default = 100). INCRMENENT - Grid cell size in weighting circle (Default = 10). MINIMUM - the minimum weighting value to apply, at the radius (Default = 0.0001). POWER - Exponential power to use in the weighting function (negative of this is used) (Default = 2).

classmethod dao_table_names(file, type, vv)

Scans a DAO-compliant database and returns the table names in a GXVV

Parameters:
  • file (str) – Database file name
  • type (str) – Database Type
  • vv (GXVV) – GXVV to return names in

New in version 5.0.

License: Geosoft End-User License

Note: The GXVV must be created to hold strings of length STR_DB_SYMBOL; i.e. use Creat_VV(-STR_DB_SYMBOL, 0), or it will assert.

classmethod decimate(db, line, i_ch, o_ch, n)

Copy and decimate a channel

Parameters:
  • db (GXDB) – Database
  • line (int) – Line handle
  • i_ch (int) – Origin Channel [DB_LOCK_READONLY]
  • o_ch (int) – Destination Channel [DB_LOCK_READWRITE]
  • n (int) – Decimation factor

New in version 5.0.

License: Geosoft End-User License

classmethod diff(db, line, i_ch, o_ch, n)

Calculate differences within a channel.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line handle
  • i_ch (int) – Origin Channel [DB_LOCK_READONLY]
  • o_ch (int) – Destination Channel [DB_LOCK_READWRITE]
  • n (int) – Number of differences

New in version 5.0.

License: Geosoft End-User License

Note: Differences with dummies result in dummies. An even number of differences locates data accurately. An odd number of differences locates result 1/2 element lower in the GXVV.

classmethod direct_grid_data_to_voxel(db, x_channel, y_channel, z_channel, data_channel, output_voxel_filename, origin_x, origin_y, origin_z, cell_count_x, cell_count_y, cell_count_z, cell_size_x, cell_size_y, cell_size_z, method)

Create a voxel using direct gridding.

Parameters:
  • db (GXDB) – Database
  • x_channel (int) – X channel [DB_LOCK_READONLY]
  • y_channel (int) – Y channel [DB_LOCK_READONLY]
  • z_channel (int) – Z channel [DB_LOCK_READONLY]
  • data_channel (int) – Data channel [DB_LOCK_READONLY]
  • output_voxel_filename (str) – Output voxel filename
  • origin_x (float) – Voxel origin X
  • origin_y (float) – Voxel origin Y
  • origin_z (float) – Voxel origin Z
  • cell_count_x (int) – Voxel cell count X
  • cell_count_y (int) – Voxel cell count Y
  • cell_count_z (int) – Voxel cell count Z
  • cell_size_x (float) – Voxel cell size X
  • cell_size_y (float) – Voxel cell size Y
  • cell_size_z (float) – Voxel cell size Z
  • method (int) – DU_DIRECTGRID_METHOD constants

New in version 8.4.

License: Geosoft End-User License

Note: The Z and Data channels may be array channels. If they are, the array sizes must match.

classmethod direct_grid_item_counts_to_voxel(db, x_channel, y_channel, z_channel, data_channel, output_voxel_filename, origin_x, origin_y, origin_z, cell_count_x, cell_count_y, cell_count_z, cell_size_x, cell_size_y, cell_size_z, pb_replace_zeroes_with_dummy)

Create a voxel using direct gridding containing the number of data points in each cell.

Parameters:
  • db (GXDB) – Database
  • x_channel (int) – X channel [DB_LOCK_READONLY]
  • y_channel (int) – Y channel [DB_LOCK_READONLY]
  • z_channel (int) – Z channel [DB_LOCK_READONLY]
  • data_channel (int) – Data channel [DB_LOCK_READONLY]
  • output_voxel_filename (str) – Output voxel filename
  • origin_x (float) – Voxel origin X
  • origin_y (float) – Voxel origin Y
  • origin_z (float) – Voxel origin Z
  • cell_count_x (int) – Voxel cell count X
  • cell_count_y (int) – Voxel cell count Y
  • cell_count_z (int) – Voxel cell count Z
  • cell_size_x (float) – Voxel cell size X
  • cell_size_y (float) – Voxel cell size Y
  • cell_size_z (float) – Voxel cell size Z
  • pb_replace_zeroes_with_dummy (bool) – Replace zero values in output with DUMMY?

New in version 8.4.

License: Geosoft End-User License

Note: The Z and Data channels may be array channels. If they are, the array sizes must match.

classmethod direction(db, line, x_ch, y_ch)

Returns the direction of a line.

Parameters:
Returns:

direction in degrees azimuth (clockwise relative the +Y direction). GS_R8DM if the line has no data, or if there is a problem. Problems will register errors.

Return type:

float

New in version 5.0.

License: Geosoft Open License

Note: The direction is calculated from the first and last non-dummy locations in the X and Y reference channels.

classmethod distance(db, line, x_ch, y_ch, o_ch)

Create a distance channel from X and Y.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod distance_3d(db, line, x_ch, y_ch, z_ch, type, o_ch)

Create a distance channel from XY or XYZ with direction options.

Parameters:

New in version 8.1.

License: Geosoft End-User License

classmethod distline(db, line, x_ch, y_ch, dist)

Calculate cummulative distance for a line.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod dup_chan_locks(d_bi, d_bo)

Duplicate all channels protect-info from input GXDB.

Parameters:
  • d_bi (GXDB) – Input Database handle
  • d_bo (GXDB) – Output Database handle.

New in version 5.0.

License: Geosoft Open License

classmethod dup_chans(d_bi, d_bo)

Duplicate all channels from input GXDB.

Parameters:
  • d_bi (GXDB) – Input Database handle
  • d_bo (GXDB) – Output Database handle.

New in version 5.0.

License: Geosoft Open License

classmethod edit_duplicates(db, line, x_ch, y_ch, option, single, fid_num)

Edit duplicate readings at individual location

Parameters:

New in version 5.0.

License: Geosoft End-User License

Note: All the channels must be of the same fid incr/start and length. Protected channels are modified automatically.

classmethod export1(db, format, cur_line, chan_vv, chan, data, dummies, header)

Export to a specific format.

Parameters:
  • db (GXDB) – Database
  • format (int) – DU_EXPORT constants
  • cur_line (str) – Current line
  • chan_vv (GXVV) – List of channels - channel symbols stored as INT
  • chan (int) – DU_CHANNELS constants
  • data (str) – Data file name
  • dummies (int) – Write out dummies?
  • header (int) – Include a header with channel names?

New in version 5.0.

License: Geosoft Open License

Note: For databases with both groups and lines: If both lines and groups are selected, save only the lines. If no lines are selected, (only groups), save the current line if it is (1) a group and (2) selected, else save the first selected group. — Option to filter out data where one of the channels has a dummy in it. Option to allow a header with the channel names.

The DU_CHANNELS_DISPLAYED option can be used to export any selection of channels, listed by the symbols (DB_SYMB) values, cast to int values and stored in a GXVV.

classmethod export2(db, format, cur_line, chan_vv, chan, data, dummies, header, line_names)

Like export1, but include line names as data.

Parameters:
  • db (GXDB) – Database
  • format (int) – DU_EXPORT constants
  • cur_line (str) – Current line
  • chan_vv (GXVV) – List of channels - channel symbols stored as INT
  • chan (int) – DU_CHANNELS constants
  • data (str) – Data file name
  • dummies (int) – Write out dummies?
  • header (int) – Include a header with channel names?
  • line_names (int) – Include line names as data?

New in version 5.1.6.

License: Geosoft Open License

Note: See export1. The line names are printed as the first column of data exported.

classmethod export_amira(db, wa, one_cols_ch, array_ch, time_ch, errors_ch, datatype, units, config, instrument, frequency)

Export to database an AMIRA data file.

Parameters:
  • db (GXDB) – Database
  • wa (GXWA) – AMIRA data file handle
  • one_cols_ch (str) – Single column channel names, supporting comma (,) separated names of multiple channels, maximum 32 channels
  • array_ch (str) – GXVA channel name, required
  • time_ch (str) – Optional Time channel name (must be GXVA channel and same array size as above GXVA channel)
  • errors_ch (str) – Optional Errors channel name (must be GXVA channel and same array size as above GXVA channel)
  • datatype (str) – Mandatory fields: DATATYPE
  • units (str) – UNITS
  • config (str) – CONFIG
  • instrument (str) – INSTRUMENT
  • frequency (str) – FREQUENCY

New in version 5.0.

License: Geosoft Open License

Note: Other defined FIELDS stored in the database (see import_amira function) will be automatically included in the export

classmethod export_aseg(db, cur_line, chan_vv, chan, defn, data)

Export to ASEG-GDF format file(s).

Parameters:
  • db (GXDB) – Database
  • cur_line (str) – Current line
  • chan_vv (GXVV) – Displayed channels
  • chan (int) – DU_CHANNELS constants
  • defn (str) – Header file name
  • data (str) – Data file name

New in version 5.0.

License: Geosoft Open License

Note: At least one of the header file or data file names must be set. (Unset names will get the same file name, but with the extensions .dfn (header) or .dat (data). For databases with both groups and lines: If both lines and groups are selected, save only the lines. If no lines are selected, (only groups), save the current line if it is (1) a group and (2) selected, else save the first selected group. —

classmethod export_aseg_proj(db, cur_line, chan_vv, chan, defn, data, proj, ipj)

Export to ASEG-GDF format file(s) (supports projections).

Parameters:
  • db (GXDB) – Database
  • cur_line (str) – Current line
  • chan_vv (GXVV) – Displayed channels
  • chan (int) – DU_CHANNELS constants
  • defn (str) – Export header file name
  • data (str) – Export data file name
  • proj (str) – Export projection file name
  • ipj (GXIPJ) – Projection handle

New in version 5.0.1.

License: Geosoft Open License

Note: At least one of the header file or data file names must be set. (Unset names will get the same file name, but with the extensions .dfn (header) or .dat (data). For databases with both groups and lines: If both lines and groups are selected, save only the lines. If no lines are selected, (only groups), save the current line if it is (1) a group and (2) selected, else save the first selected group. —

This version supports projections

classmethod export_chan_crc(db, symb, crc, file)

Export a channel as XML and compute a CRC value.

Parameters:
  • db (GXDB) – Database
  • symb (int) – Channel
  • crc (int_ref) – CRC Value returned
  • file (str) – File name to generate with XML

New in version 6.0.

License: Geosoft End-User License

Note: The output file is an XML describing the channel. The CRC is of the channel data ONLY. To compute a CRC of the full channel (include metadata) do a CRC of the generated file.

classmethod export_csv(db, cur_line, chan_vv, chan, data, dummies, header)

Export to a CSV file.

Parameters:
  • db (GXDB) – Database
  • cur_line (str) – Current line
  • chan_vv (GXVV) – Displayed channels
  • chan (int) – DU_CHANNELS constants
  • data (str) – Data file name
  • dummies (int) – Write out dummies?
  • header (int) – Include a header with channel names?

New in version 5.0.

License: Geosoft End-User License

Note: For databases with both groups and lines: If both lines and groups are selected, save only the lines. If no lines are selected, (only groups), save the current line if it is (1) a group and (2) selected, else save the first selected group. — Option to filter out data where one of the channels has a dummy in it. Option to allow a header with the channel names.

classmethod export_database_crc(db, crc, file)

Export a channel as XML and compute a CRC value.

Parameters:
  • db (GXDB) – Database
  • crc (int_ref) – CRC Value returned
  • file (str) – File name to generate with XML

New in version 6.0.

License: Geosoft End-User License

Note: The output file is an XML describing the channel. The CRC is of the channel data ONLY. To compute a CRC of the full channel (include metadata) do a CRC of the generated file.

classmethod export_gbn(db, vv, data)

Export to a GBN data file.

Parameters:
  • db (GXDB) – Database
  • vv (GXVV) – List of channels to export
  • data (str) – Export data file name

New in version 5.0.

License: Geosoft Open License

Note: The iDispChanList_DBE or GXDB.symb_list methods can be used to obtain a list of channels.

classmethod export_geodatabase(db, feature_class_name, cur_line, chan_vv, chan, output, single, data)

Export to a ESRI Geodatabase file.

Parameters:

New in version 8.0.

License: Geosoft End-User License

Note: Similar to export_gbn, with the addition that Groups go to individual tables, and lines go to a single table, or individual tables, based on the value of DU_LINEOUT constants

classmethod export_mdb(db, cur_line, chan_vv, chan, single, data)

Export to a Microsoft Access Database (MDB) file.

Parameters:

New in version 5.0.

License: Geosoft Open License

Note: Similar to export_gbn, with the addition that Groups go to individual tables, and lines go to a single table, or individual tables, based on the value of DU_LINEOUT constants

classmethod export_shp(db, cur_line, chan_vv, chan, single, data, lst)

Export to a shape file or files.

Parameters:
  • db (GXDB) – Database
  • cur_line (str) – Current line
  • chan_vv (GXVV) – Displayed channels
  • chan (int) – DU_CHANNELS constants
  • single (int) – DU_LINEOUT constants
  • data (str) – Export shape file name or base filename (shp assumed if no extension given)
  • lst (GXLST) – GXLST object will be filled with shape files created

New in version 6.1.

License: Geosoft Open License

Note: Similar to export_mdb, with the addition that groups go to indiviual files with group name suffixes, and lines go to a single file, or multiple files with line name suffixes, based on the value of DU_LINEOUT constants.

classmethod export_xyz(db, data, template)

Export XYZdata from a database to an XYZ file.

Parameters:
  • db (GXDB) – Database
  • data (str) – Export data file name
  • template (str) – Export template name

New in version 5.0.

License: Geosoft Open License

Note: 1. The export template can be in the local directory or the GEOSOFT directory. The import data file must include the path if it is not in the local directory.

  1. Both the import template and data file must exist.
  2. Sample Template file

[EXPORT XYZ] EXPORT CHAN {,FORMAT} {,WIDTH} {,DECIMAL} WRITEDUMMY YES CLIPMAP YES MAXPOINTS 1000 INCREMENT .5

4. This can be used to export a group, but the group must be the currently displayed line, and only that group will be exported.

classmethod export_xyz2(db, wa, ra)

Export XYZdata from a database to an XYZ file, using file handles.

Parameters:
  • db (GXDB) – Database
  • wa (GXWA) – Export data file GXWA handle
  • ra (GXRA) – Export template file GXRA handle

New in version 5.0.

License: Geosoft Open License

See also

export_xyz

classmethod fft(db, line, s_ch, r_ch, i_ch)

Apply an GXFFT to space data.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod filter(db, line, i_ch, o_ch, flt)

Apply a convolution filter to a channel.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod gen_lev(db, in_file, out_file, max_dz, m0)

Generate a Level table from an Intersection Table.

Parameters:
  • db (GXDB) – Database
  • in_file (str) – Input Table file Name
  • out_file (str) – Output Table file Name
  • max_dz (float) – Max. gradient
  • m0 (int) – DU_LEVEL constants

New in version 5.0.

License: Geosoft End-User License

classmethod gen_lev_db(db, out_file, max_dz, m0)

Generate a Level table from an Intersection Database

Parameters:
  • db (GXDB) – Input intersection database object
  • out_file (str) – Output Table File Name
  • max_dz (float) – Max. gradient
  • m0 (int) – DU_LEVEL constants

New in version 7.1.

License: Geosoft End-User License

Note: Requires channels with the following names:

ine, TFid, TZ, TDZ Line, LFid, LZ, LDZ Mask

classmethod gen_xyz_temp(xyz, temp)

Generate default XYZ template for a XYZ file.

Parameters:
  • xyz (str) – Xyz file name
  • temp (str) – Template file name to create

New in version 5.0.

License: Geosoft Open License

classmethod get_chan_data_lst(db, chan, mask, lst)

Populate a GXLST with unique items in a channel.

Parameters:
  • db (GXDB) – Database
  • chan (int) – Data Channel
  • mask (int) – Mask Channel (can be NULLSYMB)
  • lst (GXLST) – GXLST object to populate

New in version 6.1.

License: Geosoft End-User License

Note: Items from all selected lines are collected, sorted, and duplicates removed. The output GXLST name and value are set to the item values. Non-string channels are converted internally to string values using Copy_VV, so results may differ from what you may expect given the current channel’s display width and number of decimals. If a mask channel is selected, then only those items where the mask channel is not a dummy are collected.

classmethod get_chan_data_vv(db, chan, mask, vv)

Populate a GXVV with unique items in a channel.

Parameters:
  • db (GXDB) – Database
  • chan (int) – Channel
  • mask (int) – Mask Channel (can be NULLSYMB)
  • vv (GXVV) – GXVV object to populate

New in version 6.1.

License: Geosoft End-User License

Note: Items from all selected lines are collected, sorted, and duplicates removed. The data is collected in the channel’s data type, so normal GXVV.sort rules apply. If the output GXVV and channel type are not the same, then the data is converted using the Copy_VV function, so see that for conversion rules. If a mask channel is selected, then only those items where the mask channel is not a dummy are collected.

classmethod get_existing_feature_classes_in_geodatabase(db, geodatabase, lst, vv)

Searches the geodatabases for an existing Feature class.

Parameters:
  • db (GXDB) – Database
  • geodatabase (str) – File geodatabase
  • lst (GXLST) – Feature class names to verify
  • vv (GXVV) – Output list of existing feature class names
Returns:

0 - Feature class does not exist 1 - Feature class exists

Return type:

int

New in version 8.0.

License: Geosoft End-User License

Note: Searches the geodatabases for an existing Feature class

classmethod get_xyz_num_fields(xyz, num_fields)

Get the number of fields in the XYZ file.

Parameters:
  • xyz (str) – Xyz file name
  • num_fields (int_ref) – Returned number of fields

New in version 9.1.

License: Geosoft Open License

classmethod gradient(dbi, dbo, ix_ch, iy_ch, iz_ch, ig_ch, ox_ch, oy_ch, oz_ch, angle, width)

This method takes 4 channels from input database and duplicats each line twice to output database) (input and Output can be the same channel).

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod grav_drift(db, line, date, time, read, base, clos)

Calculate base loop closure and correct for drift.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod grav_tide(db, line, lat, lon, date, time, gmt, tide)

Calculate earth tide gravity correction.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod grid_load(db, img, xdec, ydec, trim_dum, create_index)

Load grid data to a database.

Parameters:
  • db (GXDB) – Database
  • img (GXIMG) – Grid img
  • xdec (int) – X decimation factor
  • ydec (int) – Y decimation factor
  • trim_dum (int) – 0 trim leading/trailing dummies (default), 1 trim all dummies, 2 leave all dummies
  • create_index (int) – Flag for creating index channel: 0 no (default), 1 yes.

New in version 5.0.

License: Geosoft End-User License

classmethod grid_load_xyz(db, img, ch_x, ch_y, ch_z, ch_data, xdec, ydec, trim_dum, index_ch)

Load grid data to a database using specified channels

Parameters:
  • db (GXDB) – Database
  • img (GXIMG) – Grid img
  • ch_x (int) – X Channel
  • ch_y (int) – Y Channel
  • ch_z (int) – Z Channel
  • ch_data (int) – Data Channel
  • xdec (int) – X decimation factor
  • ydec (int) – Y decimation factor
  • trim_dum (int) – 0 trim leading/trailing dummies (default), 1 trim all dummies, 2 leave all dummies
  • index_ch (int) – Flag for creating index channel: 0 no (default), 1 yes.

New in version 5.0.

License: Geosoft End-User License

classmethod head(db, line, i_ch, o_ch, tb, dir)

Applies a heading correction.

Parameters:
  • db (GXDB) – Database object
  • line (int) – Line Symbol
  • i_ch (int) – Channel to correct [DB_LOCK_READONLY]
  • o_ch (int) – Corrected channel [DB_LOCK_READWRITE]
  • tb (GXTB) – Heading table
  • dir (float) – Line direction

New in version 5.0.

License: Geosoft End-User License

Note: Updates channel with Direction in degrees azimuth (counter-clockwise relative the +Y direction). GS_R8DM if the line has no data, or if there is a problem.

classmethod imp_cb_ply(db, pj, file, x_chan, y_chan)

Import concession boundary polygon file into a database

Parameters:
  • db (GXDB) – Database
  • pj (GXPJ) – Projection Files Object
  • file (str) – Import data file name
  • x_chan (int) – X channel handle
  • y_chan (int) – Y channel handle

New in version 5.0.

License: Geosoft End-User License

Note: The polygon file is provided by Ana Christina in Brazil.

classmethod import_ado(db, connect, table, template, line)

Import an external database table into a group using ADO.

Parameters:
  • db (GXDB) – Database
  • connect (str) – Import database connection string (overrides template value)
  • table (str) – Imported table in database file (overrides template value)
  • template (str) – Import template name
  • line (str) – Oasis montaj line name to create (overrides template value)

New in version 5.0.8.

License: Geosoft Open License

Note: 1. The import template can be in the local directory or the GEOSOFT directory.

2. Only the import template must be specified. The database connection string, the database table and Oasis line name are normally taken from the template file itself, but if these values are provided, they will override those found in the template.

  1. If the line already exists, the data will overwrite the existing data.
classmethod import_all_ado(db, connect, storage)

Import an entire external database using ADO.

Parameters:

New in version 5.0.8.

License: Geosoft Open License

Note: 1. For group storage, the table names are imported “as is”. For line storage, if the table names are valid Geosoft line names, they are used as is. Otherwise, line names will be created with type LINE_NORMAL, starting at L0 and incrementing by 10 (L10, L20 etc.)

  1. If the line exists, the data will overwrite the existing data.
  2. All tables and fields will be imported.

4. If connection string is of type “FILENAME=...” the connection will attempt to resolve it as a file database. (see also ODBCFileConnect_GUI)

classmethod import_all_dao(db, data, type, storage)

Import an entire external database using DAO.

Parameters:
  • db (GXDB) – Database
  • data (str) – Import data file name
  • type (str) – Database type
  • storage (int) – DU_STORAGE constants

New in version 5.0.

License: Geosoft Open License

Note: 1. The file is assumed to be a DAO compliant database.

2. The import data file must include the path if it is not in the local directory.

3. For group storage, the table names are imported “as is”. For line storage, if the table names are valid Geosoft line names, they are used as is. Otherwise, line names will be created with type LINE_NORMAL, starting at L0 and incrementing by 10 (L10, L20 etc.)

  1. If the line exists, the data will overwrite the existing data.
  2. All tables and fields will be imported.
  3. The following are valid type strings for DAO:

MSJET : Microsoft Access ODBC : ODBC source dBASE III dBASE IV dBASE 5 FoxPro 2.0 FoxPro 2.5 FoxPro 2.6 Paradox 3.x Paradox 4.x Paradox 5.x

classmethod import_amira(db, ra, wa)

Import an AMIRA data file.

Parameters:
  • db (GXDB) – Database
  • ra (GXRA) – AMIRA data file handle
  • wa (GXWA) – Log file handle

New in version 5.0.

License: Geosoft Open License

Note: All the constant declarations are stored within the database under TEMCONSTANTS. The format is as follows:

  1. Lines stored in the file beginning with “/” are comments
  2. Each constant occupies a line in the file. It uses the format: CONSTANT=VALUE
classmethod import_aseg(db, template, file, data, flc, chans)

Import an ASEG-GDF data file.

Parameters:
  • db (GXDB) – Database
  • template (str) – Template file name
  • file (str) – Header file name
  • data (str) – Data file name
  • flc (str) – Flight Line Channel name
  • chans (int) – Number of channels to import at one time

New in version 5.0.

License: Geosoft Open License

classmethod import_aseg_proj(db, template, file, data, flc, chans, proj, x_ch, y_ch)

Import an ASEG-GDF data file (supports projections).

Parameters:
  • db (GXDB) – Database
  • template (str) – Template file name
  • file (str) – Header file name
  • data (str) – Data file name
  • flc (str) – Flight Line Channel name
  • chans (int) – Number of channels to import at one time
  • proj (str) – Projection file name
  • x_ch (str) – Channel pair to associate projection
  • y_ch (str) – Channel pair to associate projection

New in version 5.0.1.

License: Geosoft Open License

Note: This version supports projections

classmethod import_bin(db, data, template, line, flight, date)

Import blocked binary or archive ASCII data

Parameters:
  • db (GXDB) – Database
  • data (str) – Import data file name
  • template (str) – Import template name
  • line (str) – Optional Line name (see note 3.)
  • flight (int) – Optional Flight number
  • date (float) – Optional date

New in version 5.0.

License: Geosoft Open License

Note: 1. Binary import templates have extension .I2 by convention. See BINARY.I2 for a description of the template format. Archive import templates have extension .I3 by convention. See ARCHIVE.I3 for a description of the template format.

  1. Both the import template and data file must exist.

3. If a line already exists in the database, a new version is created unless a line name is passed in. In this case, the specified name is used and the imported channels on the previous line will be destroyed.

See also

lab_template

classmethod import_bin2(db, data, template, line, flight, date, wa)

Import blocked binary or archive ASCII data with data error display

Parameters:
  • db (GXDB) – Database
  • data (str) – Import data file name
  • template (str) – Import template name
  • line (str) – Optional Line name (see note 3.)
  • flight (int) – Optional Flight number
  • date (float) – Optional date

New in version 5.1.6.

License: Geosoft Open License

Note: 1. Binary import templates have extension .I2 by convention. See BINARY.I2 for a description of the template format. Archive import templates have extension .I3 by convention. See ARCHIVE.I3 for a description of the template format.

  1. Both the import template and data file must exist.

3. If a line already exists in the database, a new version is created unless a line name is passed in. In this case, the specified name is used and the imported channels on the previous line will be destroyed.

See also

lab_template

classmethod import_bin3(db, data, template, line, flight, date, wa)

Same as import_bin2, but returns the name of the imported line.

Parameters:
  • db (GXDB) – Database
  • data (str) – Import data file name
  • template (str) – Import template name
  • line (str_ref) – Optional Line name (on return, the actual line)
  • flight (int) – Optional Flight number
  • date (float) – Optional date

New in version 6.1.

License: Geosoft Open License

Note: See import_bin2. Because the name of the created line is not necessarily the value passed in (and the value passed in can be blank), this version returns the name of the line to which the data is actually imported.

See also

import_bin2

classmethod import_bin4(db, mode, data, template, line, flight, date, wa)

Same as import_bin2 but with an import mode

Parameters:
  • db (GXDB) – Database
  • mode (int) – DU_IMPORT constants
  • data (str) – Import data file name
  • template (str) – Import template name
  • line (str) – Optional Line name (see note 3.)
  • flight (int) – Optional Flight number
  • date (float) – Optional date

New in version 9.1.

License: Geosoft Open License

Note: Same as import_bin2 but with an import mode

See also

import_bin2

classmethod import_daarc500_serial(db, line, file, channel, type)

Import Serial data from the RMS Instruments DAARC500.

Parameters:

New in version 7.2.

License: Geosoft Open License

Note: Imports data stored in a serial channel recorded by the RMS Instruments DAARC500 instrument, and outputs the data to a line in the database. The channels created depend on the input data type

classmethod import_daarc500_serial_gps(db, line, file, channel)

Import Serial GPS data from the RMS Instruments DAARC500.

Parameters:
  • db (GXDB) – Database object
  • line (int) – Output line (DB_LOCK_READWRITE)
  • file (str) – Name of file to import
  • channel (int) – Channel to import, 1-8

New in version 7.2.

License: Geosoft Open License

Note: Imports GPS data stored in a serial channel recorded by the RMS Instruments DAARC500 instrument, and outputs the data to a line in the database. Makes the following channels:

Fid, UTC_Time, Latitude, Longitude, Altitude, GPS_Quality, NumSat (Number of satellites), GPS_HDOP (Horizontal Dilution of Position), Undulation, GPS_DiffAge (Age of differential channel).

classmethod import_dao(db, data, type, table, template, line)

Import an external database table into a group using DAO.

Parameters:
  • db (GXDB) – Database
  • data (str) – Import database file name (overrides template value)
  • type (str) – Import data file type (overrides template value)
  • table (str) – Imported table in database file (overrides template value)
  • template (str) – Import template name
  • line (str) – Oasis Montaj line name to create (overrides template value)

New in version 5.0.

License: Geosoft Open License

Note: 1. The import template can be in the local directory or the GEOSOFT directory. The import data file must include the path if it is not in the local directory.

2. Only the import template must be specified. The database file name, file type, the database table and Oasis line name are normally taken from the template file itself, but if these values are provided, they will override those found in the template.

  1. If the line already exists, the data will overwrite the existing data.
classmethod import_esri(db, connect, template, line)

Import an ArcGIS Geodatabase table or feature class into a GDB group

Parameters:
  • db (GXDB) – Database
  • connect (str) – Import database connection string (e.g. “d:Personaltest.mdb|Table” or “d:Filetest.gdb|FeatureClass, overrides template value)
  • template (str) – Import template name
  • line (str) – Oasis montaj line name to create (overrides template value)

New in version 7.1.

License: Geosoft Open License

Note: 1. The import template can be in the local directory or the GEOSOFT directory.

2. Only the import template must be specified. The Geodatabase connection string and Oasis line name are normally taken from the template file itself, but if these values are provided, they will override those found in the template.

  1. If the line already exists, the data will overwrite the existing data.
classmethod import_gbn(db, file)

Import GBN data file.

Parameters:
  • db (GXDB) – Database
  • file (str) – File name of the GBN file to import

New in version 5.0.

License: Geosoft Open License

classmethod import_io_gas(db, data_csv, template)

Import data columns from an ioGAS data file.

Parameters:
  • db (GXDB) – Database
  • data_csv (str) – Input data.csv file name
  • template (str) – Input template file name

New in version 8.5.

License: Geosoft Open License

Note: 1. All columns in the speficied ioGAS data file will be imported. 2. If a line already exists, the data will overwrite the existing data.

classmethod import_oddf(db, file)

Import ODDF data file.

Parameters:
  • db (GXDB) – Database
  • file (str) – File name of the ODDF file to import

New in version 5.0.

License: Geosoft Open License

classmethod import_pico(db, template, data, chans)

Import a Picodas data file.

Parameters:
  • db (GXDB) – Database
  • template (str) – Template file name
  • data (str) – Data file name
  • chans (int) – Number of channels to import at one time

New in version 5.0.

License: Geosoft Open License

classmethod import_ubc_mod_msh(db, mesh, mods, dir, dummy)

Import UBC Mod and Msh files.

Parameters:
  • db (GXDB) – Database Object
  • mesh (str) – Mesh file
  • mods (str) – 1-5 Mod files, delimited with “|”
  • dir (int) – Import slice direction (0-2 for X,Y and Z)
  • dummy (float) – Value to interpret as dummy

New in version 6.0.

License: Geosoft Open License

Note: Each slice in X,Y or Z is imported to its own line in the database beginning with L0.

classmethod import_usgs_post(db, file)

Import USGS Post data file.

Parameters:
  • db (GXDB) – Database
  • file (str) – File name of the USGS post file to import

New in version 5.0.

License: Geosoft Open License

classmethod import_xyz(db, mode, data, template)

Import XYZ data into the database.

Parameters:
  • db (GXDB) – Database
  • mode (int) – DU_IMPORT constants
  • data (str) – Import data file name
  • template (str) – Import template name

New in version 5.0.

License: Geosoft Open License

Note: 1. The import template can be in the local directory or the GEOSOFT directory. The import data file must include the path if it is not in the local directory.

  1. Both the import template and data file must exist.
classmethod import_xyz2(db, mode, data, template, wa)

Import XYZ data into the database.

Parameters:
  • db (GXDB) – Database
  • mode (int) – DU_IMPORT constants
  • data (str) – Import data file name
  • template (str) – Import template name

New in version 5.1.6.

License: Geosoft Open License

Note: 1. The import template can be in the local directory or the GEOSOFT directory. The import data file must include the path if it is not in the local directory.

  1. Both the import template and data file must exist.
classmethod index_order(db, line, in_ch, ch)

Change the order of a channel using an index channel.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod interp(db, line, i_ch, o_ch, inside, outside)

Replace all dummies by interpolating from valid data.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod interp_gap(db, line, i_ch, o_ch, inside, outside, gap, extend)

Replace all dummies by interpolating from valid data.

Parameters:

New in version 8.4.

License: Geosoft End-User License

classmethod intersect(db, x_chan, y_chan, z_chan, tol, file)

Create Tie Line & Normal Line intersect table.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod intersect_all(db, x_chan, y_chan, z_chan, tol, file)

Create line intersect table from all lines.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod intersect_gd_bto_tbl(db, tbl)

Create a new intersection table from an intersection database.

Parameters:
  • db (str) – Input Intersection Database name
  • tbl (str) – Output intersection TBL

New in version 7.1.

License: Geosoft End-User License

Note: If the TBL exists, it is overwritten.

classmethod intersect_old(db, x_chan, y_chan, z_chan, in_file, out_file)

Use existing intersection table and re-calculate miss-ties.

Parameters:

New in version 5.1.4.

License: Geosoft End-User License

Note: Reads intersection information from an existing intersect table and looks up the values at the intersections for the input Z channel. This makes it unnecessary to re-calculate the intersections every time if you want to determine miss-ties using different Z channels, or the same Z channel after processing levelling corrections. Existing intersections whose locations do not exist in the database are ignored.

classmethod intersect_tb_lto_gdb(tbl, db)

Create a new intersection database from an intersection table.

Parameters:
  • tbl (str) – Input intersection TBL
  • db (str) – Output Intersection Database name

New in version 7.1.

License: Geosoft End-User License

Note: If the GDB exists, it is deleted, so it should not be loaded. The database is split by Tie lines (or whatever lines are found in column 3 of the TBL file.

is_null()

Check if this is a null (undefined) instance

Returns:True if this is a null (undefined) instance, False otherwise.
Return type:bool
classmethod lab_template(data, template, type, delimit, name_off, unit_off, data_off, sample_type, data_type)

Makes a default template from a lab assay file.

Parameters:
  • data (str) – Data file name
  • template (str) – New template name
  • type (int) – DU_LAB_TYPE constants
  • delimit (str) – Delimiter string
  • name_off (int) – Offset to column labels line (0 for first line)
  • unit_off (int) – Offset to unit labels line, -1 if none
  • data_off (int) – Offset to first line that contains data
  • sample_type (int) – Sample channel element type, recommend -10 for 10-character ASCII, or GS_LONG for numbers.
  • data_type (int) – Default channel element type, recommend GS_FLOAT

New in version 5.0.

License: Geosoft Open License

Note: The template can be used to import the file using sImportBIN_DU.

The first column is assumed to be the sample number.

If the unit label line is the same as the column label line, column labels are assummed to be followed by unit labels using the format “Au-ppm”, “Au ppm” or “Au(ppm)”.

The number of channels is determined from the number of columns in the data channel. If there are more column labels or unit labels, the last labels are assumed to be correct. If there are fewer line labels, default labels “Col_n”, where n is the column number, will be created and no unit labels will be defined.

See also

import_bin

classmethod load_gravity(db, reg, line, data)

Load a gravity survey file

Parameters:
  • db (GXDB) – Database
  • reg (GXREG) – GXREG to hold constant data
  • line (int) – Line in which to load data
  • data (str) – Gravity data file

New in version 5.0.

License: Geosoft End-User License

Note: See GRAVITY.`GXDAT <geosoft.gxapi.GXDAT>` for a description of the file format.

Existing data in the line will be replaced.

The following GXREG parameters will be set if they appear in the data file: default OPERATOR “” DATE none INSTRUMENT “” INSTRUMENT_SCALE “1.0” BASE_GRAVITY “0.0” FORMULA “1967” GMT_DIFF “0.0” DISTANCE_UNITS “m” DENSITY_EARTH “2.67” DENSITY_WATER “1.0” DENSITY_ICE “0.95” MAP_PROJECTION “”

If the corresponding constant is not specified and the GXREG already has the constant defined, it is not changed. If the constant is not defined and it is not already in the GXREG, the indicated default will be set.

classmethod load_ltb(db, line, ltb, mode)

Load GXLTB into a database line.

Parameters:

New in version 5.0.

License: Geosoft End-User License

Note: A new channel will be created for all GXLTB fields that do not already exist. The GXLTB field type will be double if all entries can be converted to double, otherwise it will be a string type set to the larger of 16 characters or the longest string in the field.

For _APPEND, the GXLTB data is simply added the end of each channel. re_fid_all_ch can be used to re-fid data to match a specifc channel and there-by case all channels to be the same length before appending data.

classmethod make_fid(db, line, i_ch, o_ch)

Make a fiducial channel based on an existing channel.

Parameters:

New in version 5.0.

License: Geosoft Open License

classmethod mask(db, line, i_ch, m_ch)

Mask dummies in one channel against another.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod math(db, line, exp)

Apply an expression to the database

Parameters:
  • db (GXDB) – Database
  • line (int) – Line handle
  • exp (GXEXP) – Math expression object (GXEXP)

New in version 5.0.

License: Geosoft End-User License

Note: The MATH_DU method will READWRITE lock channels on the left side of expressions and READONLY lock channels on the right side of expressions. Channels are unlocked before returning. Therefore, channels on the left side of an expression cannot be locked READONLY because the math attempt to lock the channel READWRITE will fail. Similarly, channels on the right side of an expression cannot be locked READWRITE because math‘s attempt to lock the channels READONLY will fail.

If this is confusing, just make sure no channels used in the expression are locked before calling math.

See also

GXEXP

classmethod merge_line(db, i_line, m_line, o_line, mode)

Merge a line a the fiducial and copies any data past that fiducial into the new line.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod mod_fid_range(db, ln, fid_start, incr, start_index, num, opt)

Insert/Append/Delete a range of fids.

Parameters:
  • db (GXDB) – Database
  • ln (int) – Line
  • fid_start (float) – Base fid start
  • incr (float) – Base fid increment
  • start_index (int) – Start index (can be negative)
  • num (int) – Number of fids
  • opt (int) – DU_MODFID constants

New in version 5.0.

License: Geosoft End-User License

Note: Channels that do not have the same fid start or fid increment are not processed.

Protected channels are modified automatically.

classmethod move(db, line, i_ch, c_ch, o_ch, mode)

Move/correct a channel to a control channel.

Parameters:

New in version 5.0.

License: Geosoft End-User License

Note: The input channel is moved to the absolute location of the control channel.

classmethod nl_filt(db, line, i_ch, o_ch, width, tol)

This method applies a non-linear filter to the specified line/channel and places the output in the output channel.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line handle
  • i_ch (int) – Channel to filter [DB_LOCK_READONLY]
  • o_ch (int) – Output filtered channel [DB_LOCK_READWRITE]
  • width (int) – Filter Width
  • tol (float) – Filter Tolerance, 0 for 10% of Std. Dev.

New in version 5.0.

License: Geosoft End-User License

classmethod normal(db, ch, ignore)

Set fid of all channels to match a specified channel.

Parameters:
  • db (GXDB) – Database handle
  • ch (int) – Base Channel for normalization. [DB_LOCK_READONLY]
  • ignore (bool) – Ignore write protection on channels?

New in version 5.0.

License: Geosoft Open License

See also

re_fid_all_ch

classmethod null()

A null (undefined) instance of GXDU

Returns:A null GXDU
Return type:GXDU
classmethod poly_fill(db, line, x_chan, y_chan, r_chan, pply, dummy)

Fill using a polygon with a value of 1.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod poly_mask(db, line, x_chan, y_chan, r_chan, pply, dummy)

Mask against a polygon.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod proj_points(db, line, ix_ch, iy_ch, iz_ch, ox_ch, oy_ch, oz_ch, i_name_chan, i_datum_chan, i_method_chan, i_unit_chan, il_datum_chan, o_name_chan, o_datum_chan, o_method_chan, o_unit_chan, ol_datum_chan, error_chan, force_local_datum)

Project X,Y(Z) channels with different projections

Parameters:

New in version 6.3.

License: Geosoft End-User License

Note: Output channels can be the same as input channels

classmethod project_data(db, line, ix_ch, iy_ch, ox_ch, oy_ch, pj)

Project X,Y channels

Parameters:

New in version 5.0.

License: Geosoft End-User License

Note: Output channels can be the same as input channels

classmethod project_xyz(db, line, ix_ch, iy_ch, iz_ch, ox_ch, oy_ch, oz_ch, pj)

Project X,Y,Z channels from one system to another.

Parameters:

New in version 5.0.

License: Geosoft End-User License

Note: Output channels can be the same as input channels

classmethod qc_init_separation(db, sep, dir)

Creates the nearest line channels for line separation QC.

Parameters:
  • db (GXDB) – Database
  • sep (float) – Nominal Line separation
  • dir (float) – Nominal Line direction

New in version 5.0.

License: Geosoft End-User License

Note: This must be called before QCSeparation_DU. It uses a pager to establish the relative positions of the selected lines, then, for every point determines the closest point in another line to the left and to the right (as determined by looking in the direction of the line.) These distances are stored to two new channels in the database, “Closest_Left” and “Closest_Right”

classmethod qc_survey_plan(db, wa, pply, sl_spa, sl_azi, slx, sly, sl_sta, sl_inc, tl_spa, tl_azi, tlx, tly, tl_sta, tl_inc, type, sample_spacing, extend_outside)

Create a database containing proposed survey plan in a GXPLY

Parameters:
  • db (GXDB) – Database to save proposed survey plan
  • wa (GXWA) – GXWA to save survey plan summary
  • pply (GXPLY) – Boundary GXPLY
  • sl_spa (float) – Survey line spacing
  • sl_azi (float) – Survey line azimuth
  • slx (float) – Survey line reference X coordinate
  • sly (float) – Survey line reference Y coordinate
  • sl_sta (int) – Survey line starting number of LINES
  • sl_inc (int) – Line number increment for survey line
  • tl_spa (float) – Tie line spacing
  • tl_azi (float) – Tie line azimuth
  • tlx (float) – Tie line reference X coordinate
  • tly (float) – Tie line reference Y coordinate
  • tl_sta (int) – Tie line starting number of LINES
  • tl_inc (int) – Line number increment for Tie line
  • type (int) – QC_PLAN_TYPE constants
  • sample_spacing (float) – Sample spacing (spacing between points in lines)
  • extend_outside (float) – Spacing to extend lines outside polygon
Return type:

int

New in version 5.0.

License: Geosoft End-User License

Note: The LINE on which has the reference (X,Y) will have the starting Line number The lines on the right hand side of the reference line (while looking into azimuth of ref. line) have increasing line numbers. The lines on the left hand side have the decreasing line numbers from the starting number. Returns an error code or 0 (if successful)

classmethod range_xy(db, x_min, y_min, x_max, y_max)

Find the range of X, and Y in the selected lines.

Parameters:

New in version 8.5.

License: Geosoft End-User License

Note: Returns the range in X and Y of the current X and Y channels. Returned values are dummy if no valid items are found.

classmethod range_xyz(db, x_ch, y_ch, z_ch, x_min, y_min, z_min, x_max, y_max, z_max, n_tot)

Find the range of X, Y and Z in selected lines.

Parameters:

New in version 8.5.

License: Geosoft End-User License

Note: The X, Y and Z channels should be normal (not array) channels. Only locations where all values are non-dummy are included in the calculation. If no non-dummy values are found, Dummy values are returned.

classmethod range_xyz_data(db, x_ch, y_ch, z_ch, d_ch, x_min, y_min, z_min, d_min, x_max, y_max, z_max, d_max, n_tot)

Find the range of X, Y, Z and Data values in selected lines.

Parameters:

New in version 8.1.

License: Geosoft End-User License

Note: The Z and Data channels may be array channels, but both must have the same number of columns. Only values where all channels are non-dummy (or, for GXVA channels, where the Z or Data value are defined) are included in the calculation. If no non-dummy values are found, Dummy values are returned. This function is optimized for cases where Z and Data are array channels with many columns (e.g. 32 or more columns).

classmethod re_fid(db, line, in_ch, ref_ch, out_ch, mode, start, incr, gap)

Re-fid a channel based on a reference channel

Parameters:
  • db (GXDB) – Database Object
  • line (int) – Line Symbol
  • in_ch (int) – Original Channel [DB_LOCK_READONLY] “Y” values
  • ref_ch (int) – Reference Channel [DB_LOCK_READONLY] “X” locations
  • out_ch (int) – Output Channel [DB_LOCK_READWRITE]
  • mode (int) – DU_REFID constants
  • start (float) – Start Fid, if GS_R8DM, use ref channel minimum
  • incr (float) – Fid increment, if GS_R8DM use nominal spacing of the reference channel.
  • gap (float) – Maximum gap to interpolate across

New in version 5.0.

License: Geosoft Open License

Note: The original channel can be an array channel, in which case the columns (up to the number of columns available in the output) are individually interpolated. If the number of columns in the output channel is more than the input channel, the remaining columns are dummied.

This function is fundamentally different in behaviour from re_fid_ch. The values in the Reference channel in re_fid are the “X” locations corresponding to the “Y” locations in the “Original Channel”. Output Channel values are calculated at the new “X” locations specified by the Start Fid and the Fid Increment.

classmethod re_fid_all_ch(db, line, ref_ch)

Simple re-fid of all channels based on a reference channel

Parameters:
  • db (GXDB) – Database Object
  • line (int) – Line Symbol
  • ref_ch (int) – Reference Channel [DB_LOCK_READONLY]

New in version 5.0.

License: Geosoft Open License

Note: Channels can be array channels, in which case the columns are individually re-fidded.

See also

normal

classmethod re_fid_ch(db, line, ref_ch, ch)

Simple re-fid of a channel based on a reference channel

Parameters:

New in version 5.0.

License: Geosoft Open License

Note: The original channel can be an array channel, in which case the columns are individually re-fidded.

re_fid_ch resamples the “Channel to refid” to the “Reference Channel” Fid range and increment.

classmethod rotate(db, line, in_x_ch, in_y_ch, out_x_ch, out_y_ch, x0, y0, deg)

Rotate coordinates.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line symbol
  • in_x_ch (int) – Input X channel [DB_LOCK_READONLY]
  • in_y_ch (int) – Input Y channel [DB_LOCK_READONLY]
  • out_x_ch (int) – Output X channel [DB_LOCK_READWRITE]
  • out_y_ch (int) – Output Y channel [DB_LOCK_READWRITE]
  • x0 (float) – X point about which to rotate
  • y0 (float) – Y of point about which to rotate
  • deg (float) – Angle in degrees CCW

New in version 5.0.

License: Geosoft End-User License

classmethod sample_gd(db, line, ix_ch, iy_ch, o_ch, img)

Sample a GXGD at a specified X and Y.

Parameters:

New in version 5.0.

License: Geosoft End-User License

Note: Values in result channel

classmethod sample_img(db, line, ix_ch, iy_ch, o_ch, img)

Sample a GXIMG at a specified X and Y.

Parameters:

New in version 5.0.

License: Geosoft End-User License

Note: Values in result channel

classmethod sample_img_line_lst(db, lst, ix_ch, iy_ch, o_ch, img)

Sample an GXIMG at a specified X and Y, for a GXLST of lines.

Parameters:

New in version 8.3.

License: Geosoft End-User License

Note: Values in result channel

classmethod scan_ado(connect, table, template)

Scans an external ADO database and generates a default template.

Parameters:
  • connect (str) – Database connection string
  • table (str) – Database Table Name
  • template (str) – Template file name to Create

New in version 5.0.8.

License: Geosoft End-User License

Note: All the channels are listed

classmethod scan_aseg(file, data, flc, template)

This method scans an ASEG-GDF file and generates a default template listing all the channels and all the ALIAS lines.

Parameters:
  • file (str) – Header file name
  • data (str) – Data file name
  • flc (str) – Flight Line Channel name
  • template (str) – Template file name to Create

New in version 5.0.

License: Geosoft Open License

classmethod scan_dao(file, type, table, template)

Scans an external DAO database and generates a default template.

Parameters:
  • file (str) – Database file name
  • type (str) – Database Type
  • table (str) – Database Table Name
  • template (str) – Template file name to Create

New in version 5.0.

License: Geosoft Open License

Note: All the channels are listed

classmethod scan_pico(data, template)

This method scans a picodas file and generates a default template listing all the channels and all the ALIAS lines.

Parameters:
  • data (str) – Data file Name
  • template (str) – Template file name to Create

New in version 5.0.

License: Geosoft End-User License

classmethod sort(db, line, ch, sort)

Sort the contents of a channel.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod sort_index(db, line, ch, in_ch, sort)

Create an ordered index of the contents of a channel.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod sort_index2(db, line, ch1, sort1, ch2, sort2, in_ch)

Create an ordered index from two channels

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod split_line(db, i_line, o_line, fid)

Splits a line a the fiducial and copies any data past that fiducial into the new line.

Parameters:
  • db (GXDB) – Database
  • i_line (int) – Input Line, will be reduced at fid [DB_LOCK_READWRITE]
  • o_line (int) – Output Line, will take data above fid [DB_LOCK_READWRITE]
  • fid (float) – Fid number of split

New in version 5.0.

License: Geosoft End-User License

classmethod split_line2(db, i_line, o_line, fid, reset_fi_ds)

Splits a line a the fiducial and copies any data past that fiducial into the new line.

Parameters:
  • db (GXDB) – Database
  • i_line (int) – Input Line, will be reduced at fid [DB_LOCK_READWRITE]
  • o_line (int) – Output Line, will take data above fid [DB_LOCK_READWRITE]
  • fid (float) – Fid number of split
  • reset_fi_ds (int) – Reset starting fiducials to zero (0: No, 1: Yes)

New in version 8.4.

License: Geosoft End-User License

Note: The same as SplitLine, but with an option to reset each line’s starting fiducial to zero.

classmethod split_line_by_direction(db, line, x_ch, y_ch, angular_change, over_a_distance_of, minimum_line_length, break_on_separation_distance, save_discards, method, first_line, line_inc, reset_fi_ds)

The line is split when the heading (calculated from the current X and Y channels) changes by more than a specified amount over a specified distance. Additional options to discard too-short lines

Parameters:
  • db (GXDB) – Database
  • line (int) – Line to be broken up [DB_LOCK_READONLY]
  • x_ch (int) – X Channel [DB_LOCK_READWRITE].
  • y_ch (int) – Y Channel [DB_LOCK_READWRITE].
  • angular_change (float) – Maximum angular change allowed (degrees)...
  • over_a_distance_of (float) – ...over a distance of
  • minimum_line_length (float) – Delete lines shorter than (can be rDUMMY)
  • break_on_separation_distance (float) – Break on data XY separation greater than (can be rDUMMY)
  • save_discards (int) – Whether to save too-short segments as special lines or to discard them
  • method (int) – DU_SPLITLINE constants ONLY DU_SPLITLINEXY_SEQUENTIAL and DU_SPLITLINEXY_VERSIONS
  • first_line (int_ref) – First line in the sequence, for DU_SPLITLINE_SEQUENTIAL. On return, the next line in the sequence.
  • line_inc (int) – Increment in the line number sequence, for DU_SPLITLINE_SEQUENTIAL
  • reset_fi_ds (int) – Reset starting fiducials to zero (0: No, 1: Yes)

New in version 8.5.

License: Geosoft End-User License

Note: Split a line based on changes in heading.

classmethod split_line_by_direction2(db, line, x_ch, y_ch, angular_change, over_a_distance_of, minimum_line_length, break_on_separation_distance, save_discards, method, first_line, line_inc, retain_line_type, reset_fi_ds)

The same as SplitLineByDirection, but with the option to maintain line types when outputting sequentially numbered lines.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line to be broken up [DB_LOCK_READONLY]
  • x_ch (int) – X Channel [DB_LOCK_READWRITE].
  • y_ch (int) – Y Channel [DB_LOCK_READWRITE].
  • angular_change (float) – Maximum angular change allowed (degrees)...
  • over_a_distance_of (float) – ...over a distance of
  • minimum_line_length (float) – Delete lines shorter than (can be rDUMMY)
  • break_on_separation_distance (float) – Break on data XY separation greater than (can be rDUMMY)
  • save_discards (int) – Whether to save too-short segments as special lines or to discard them
  • method (int) – DU_SPLITLINE constants ONLY DU_SPLITLINEXY_SEQUENTIAL and DU_SPLITLINEXY_VERSIONS
  • first_line (int_ref) – First line in the sequence, for DU_SPLITLINE_SEQUENTIAL. On return, the next line in the sequence.
  • line_inc (int) – Increment in the line number sequence, for DU_SPLITLINE_SEQUENTIAL
  • retain_line_type (int) – Maintain line types for DU_SPLITLINE_SEQUENTIAL (0: No, 1: Yes)
  • reset_fi_ds (int) – Reset starting fiducials to zero (0: No, 1: Yes)

New in version 9.0.

License: Geosoft End-User License

Note: Split a line based on changes in heading.

classmethod split_line_xy(db, line, x_ch, y_ch, dirctn, tolrnc, down_tol, method, first_line, line_inc)

Break up a line based on tolerance of lateral and horizontal distance, with options for the output line names.

Parameters:

New in version 8.3.

License: Geosoft End-User License

Note: The original line will be deleted.

classmethod split_line_xy2(db, line, x_ch, y_ch, dirctn, tolrnc, down_tol, method, first_line, line_inc, reset_fi_ds)

Break up a line based on tolerance of lateral and horizontal distance, with options for the output line names.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line to be broken up [DB_LOCK_READONLY]
  • x_ch (int) – Channel X [DB_LOCK_READWRITE]
  • y_ch (int) – Channel Y [DB_LOCK_READWRITE]
  • dirctn (int) – Line direction, 0-any, 1-X, 2-Y.
  • tolrnc (float) – Lateral tolerance, DUMMY for the default (10% of the separation between the first two points.
  • down_tol (float) – Downline Tolerance, DUMMY for none
  • method (int) – DU_SPLITLINE constants
  • first_line (int_ref) – First line in the sequence, for DU_SPLITLINE_SEQUENTIAL. On return, the next line in the sequence.
  • line_inc (int) – Increment in the line number sequence, for DU_SPLITLINE_SEQUENTIAL
  • reset_fi_ds (int) – Reset starting fiducials to zero (0: No, 1: Yes)

New in version 8.4.

License: Geosoft End-User License

Note: The same as SplitLineXY, but with an option to reset each line’s starting fiducial to zero.

classmethod split_line_xy3(db, line, x_ch, y_ch, dirctn, tolrnc, down_tol, method, first_line, line_inc, retain_line_type, reset_fi_ds)

Break up a line based on tolerance of lateral and horizontal distance, with options for the output line names.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line to be broken up [DB_LOCK_READONLY]
  • x_ch (int) – Channel X [DB_LOCK_READWRITE]
  • y_ch (int) – Channel Y [DB_LOCK_READWRITE]
  • dirctn (int) – Line direction, 0-any, 1-X, 2-Y.
  • tolrnc (float) – Lateral tolerance, DUMMY for the default (10% of the separation between the first two points.
  • down_tol (float) – Downline Tolerance, DUMMY for none
  • method (int) – DU_SPLITLINE constants
  • first_line (int_ref) – First line in the sequence, for DU_SPLITLINE_SEQUENTIAL. On return, the next line in the sequence.
  • line_inc (int) – Increment in the line number sequence, for DU_SPLITLINE_SEQUENTIAL
  • retain_line_type (int) – Maintain line types for DU_SPLITLINE_SEQUENTIAL (0: No, 1: Yes)
  • reset_fi_ds (int) – Reset starting fiducials to zero (0: No, 1: Yes)

New in version 9.0.

License: Geosoft End-User License

Note: The same as SplitLineXY2, but with the option to maintain line types when outputting sequentially numbered lines.

classmethod stat(db, line, i_ch, st)

Add a data channel to a statistics object.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line handle
  • i_ch (int) – Channel handle [DB_LOCK_READONLY]
  • st (GXST) – Statistics handle

New in version 5.0.

License: Geosoft End-User License

Note: If the input channel is a GXVA (array) channel, then the columns set using GXDB.set_va_windows are used in the statistics; all columns are used by default.

See also

GXST

classmethod table_line_fid(db, chan, ref, tb, field)

Place a Line/Fid information into a Channel.

Parameters:

New in version 5.0.

License: Geosoft End-User License

classmethod table_look1(db, line, i_ch, o_ch, ref_field, l_field, mode, close, tb)

Create a new channel using a single reference table

Parameters:
  • db (GXDB) – Database
  • line (int) – Line Handle
  • i_ch (int) – Lookup reference channel [DB_LOCK_READONLY]
  • o_ch (int) – Output Channel Token [DB_LOCK_READWRITE]
  • ref_field (str) – Reference field name in table
  • l_field (str) – Lookup output name in table
  • mode (int) – DU_LOOKUP constants
  • close (float) – CLOSE lookup distance. If 0.0, distance is calculated from lookup reference channel.
  • tb (GXTB) – GXTB table Object

New in version 5.0.

License: Geosoft End-User License

Note: Fails if table does not contain requested fields. The nominal data sample spacing for the CLOSE options is calculated by finding the fiducial increment the - primary index channel for Lookup1C_DU; - secondary index channel for Lookup2C_DU, LookupIValC_DU and LookupRValC_DU

classmethod table_look2(db, line, r1_ch, r2_ch, o_ch, r1_field, r2_field, l_field, mode, close, tb)

Create a new channel using a double reference table.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line Handle
  • r1_ch (int) – Primary reference channel [DB_LOCK_READONLY]
  • r2_ch (int) – Secondary reference channel [DB_LOCK_READONLY]
  • o_ch (int) – Output channel [DB_LOCK_READWRITE]
  • r1_field (str) – Primary reference field name in table
  • r2_field (str) – Secondary reference field name in table
  • l_field (str) – Lookup result field name in table
  • mode (int) – DU_LOOKUP constants
  • close (float) – CLOSE lookup distance. If 0.0, distance is calculated from secondary reference channel.
  • tb (GXTB) – Table Object

New in version 5.0.

License: Geosoft End-User License

Note: Fails if table does not contain requested fields. The nominal data sample spacing for the CLOSE options is calculated by finding the fiducial increment the - primary index channel for Lookup1C_DU; - secondary index channel for Lookup2C_DU, LookupIValC_DU and LookupRValC_DU

classmethod table_look_i2(db, line, val, i_ch, o_ch, r1, r2, field, mode, dist, tb)

Create a new channel using constant integer primary reference and a secondary reference table.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line Handle
  • val (int) – Lookup primary reference value
  • i_ch (int) – Lookup secondary reference channel [DB_LOCK_READONLY]
  • o_ch (int) – Output Channel Token [DB_LOCK_READWRITE]
  • r1 (str) – Primary reference field name in table
  • r2 (str) – Secondary reference field name in table
  • field (str) – Lookup result field name in table
  • mode (int) – DU_LOOKUP constants
  • dist (float) – CLOSE lookup distance. If 0.0, distance calculated from secondary reference channel.
  • tb (GXTB) – Table Object

New in version 5.0.

License: Geosoft End-User License

Note: Fails if table does not contain requested fields. The nominal data sample spacing for the CLOSE options is calculated by finding the fiducial increment the - primary index channel for Lookup1C_DU; - secondary index channel for Lookup2C_DU, LookupIValC_DU and LookupRValC_DU

classmethod table_look_r2(db, line, val, i_ch, o_ch, r1, r2, field, mode, dist, tb)

Create a new channel using a constant real primary reference and a secondary reference table.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line Handle
  • val (float) – Primary reference value
  • i_ch (int) – Secondary reference value [DB_LOCK_READONLY]
  • o_ch (int) – Output Channel Token [DB_LOCK_READWRITE]
  • r1 (str) – Primary reference field name in table
  • r2 (str) – Secondary reference field name in table
  • field (str) – Lookup result field name in table
  • mode (int) – DU_LOOKUP constants
  • dist (float) – CLOSE lookup distance. If 0.0, distance calculated from secondary reference channel.
  • tb (GXTB) – Table Object

New in version 5.0.

License: Geosoft End-User License

Note: Fails if table does not contain requested fields. The nominal data sample spacing for the CLOSE options is calculated by finding the fiducial increment the - primary index channel for Lookup1C_DU; - secondary index channel for Lookup2C_DU, LookupIValC_DU and LookupRValC_DU

classmethod table_selected_lines_fid(db, chan, ref, tb, field)

Place a Line/Fid information into a Channel for the selected lines in the database.

Parameters:

New in version 9.1.

License: Geosoft End-User License

classmethod time_constant(db, line, resp_chan, time_chan, tau_chan, intercept_chan, fit_chan, log_opt)

Calculate TEM time constant (Tau)

Parameters:
  • db (GXDB) – Database, required
  • line (int) – Line Handle, required
  • resp_chan (int) – Response channel, required [DB_LOCK_READONLY]
  • time_chan (int) – Time channel, required [DB_LOCK_READONLY]
  • tau_chan (int) – Output Time constant (Tau) channel, required [DB_LOCK_READWRITE]
  • intercept_chan (int) – Output Intercept channel, no output if NULLSYMB [DB_LOCK_READWRITE]
  • fit_chan (int) – Output predicted response channel, no output if NULLSYMB [DB_LOCK_READWRITE] Result is based on least square fit from Tau and Intercept
  • log_opt (int) – Log option applied to time channel: 0 - linear, 1 - log10

New in version 5.0.

License: Geosoft End-User License

Note: When DU_TIME_LOG option is used, Time channel will be converted with logarithmic before calculating time constant. Logarthmic conversion is always applied to the response channel.

classmethod trend(db, line, i_ch, o_ch, order)

Calculates an n’th order trend of a data channel.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line Handle to Apply this to
  • i_ch (int) – Input channel [DB_LOCK_READONLY]
  • o_ch (int) – Result channel [DB_LOCK_READWRITE]
  • order (int) – Trend Order, 0 to 9

New in version 5.0.

License: Geosoft End-User License

See also

b_spline

classmethod update_intersect_db(db, x_chan, z_chan, int_db)

Update the Z and DZ values in an intersection database, using the current database.

Parameters:
  • db (GXDB) – Flight Database Object
  • x_chan (int) – X Channel [DB_LOCK_READONLY] (for location info)
  • z_chan (int) – Z Channel [DB_LOCK_READONLY]
  • int_db (GXDB) – Intersection database to update

New in version 7.1.

License: Geosoft End-User License

Note: Updates the TZ, TDZ, LZ and LDZ channels at the intersections, using the current flight database.

classmethod voxel_section(db, line, x_ch, y_ch, vox, grid, cell_x, cell_y, interp)

Slice a voxel to a grid under a database line.

Parameters:
  • db (GXDB) – Database Object
  • line (int) – Input Line Symbol [READWRITE]
  • x_ch (int) – X Channel (DB_NO_SYMB if LineDir==0)
  • y_ch (int) – Y Channel (DB_NO_SYMB if LineDir==0)
  • vox (GXVOX) – Voxel to slice
  • grid (str) – Output grid name
  • cell_x (float) – X cell size (horizontal)
  • cell_y (float) – Y cell size (vertical)
  • interp (int) – Interp: 1 - linear, 0 - nearest

New in version 6.4.

License: Geosoft End-User License

Note: Takes the first and XY locations in a line (using the current X and Y channels) and defines a section grid as a slice through a voxel file. The grid cell sizes can be left as GS_R8DM, in which case an attempt will be made to match the voxel cell size, based on the line azimuth, voxel rotation, etc.

If the slice does NOT intersect the voxel, or if there are fewer than 2 valid locations in the line, then no grid file is created, but there is no error. (This is to simplify creating multiple grids from at once, where not all may intersect).

classmethod write_wa(db, line, lst, wa)

Write data to an ASCII file.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line symbol
  • lst (GXLST) – List of channel names to write
  • wa (GXWA) – GXWA to write to

New in version 5.0.

License: Geosoft Open License

Note: Channels to be written should be placed in a GXLST object.

Channels are written in the order of the list. Only the channel names in the list are used.

Data is formated as in the channel definition and channels are separated by a single space character.

classmethod xyz_line(db, line, x_ch, y_ch, dirctn, tolrnc)

Break up a line based on tolerance of lateral distance.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line to be broken up
  • x_ch (int) – Channel X
  • y_ch (int) – Channel Y
  • dirctn (int) – Line direction, 0-any, 1-X, 2-Y.
  • tolrnc (float) – Tolerance, DUMMY for the default (10% of the separation between the first two points.

New in version 5.0.

License: Geosoft End-User License

Note: The original line will be deleted.

classmethod xyz_line2(db, line, x_ch, y_ch, dirctn, tolrnc, down_tol)

Break up a line based on tolerance of lateral and horizontal distance.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line to be broken up [DB_LOCK_READONLY]
  • x_ch (int) – Channel X [DB_LOCK_READWRITE]
  • y_ch (int) – Channel Y [DB_LOCK_READWRITE]
  • dirctn (int) – Line direction, 0-any, 1-X, 2-Y.
  • tolrnc (float) – Tolerance, DUMMY for the default (10% of the separation between the first two points.
  • down_tol (float) – Downline Tolerance, DUMMY for none

New in version 5.0.

License: Geosoft End-User License

Note: The original line will be deleted.

classmethod xyz_line3(db, line, x_ch, y_ch, dirctn, tolrnc, down_tol, reset_fi_ds)

Break up a line based on tolerance of lateral and horizontal distance.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line to be broken up [DB_LOCK_READONLY]
  • x_ch (int) – Channel X [DB_LOCK_READWRITE]
  • y_ch (int) – Channel Y [DB_LOCK_READWRITE]
  • dirctn (int) – Line direction, 0-any, 1-X, 2-Y.
  • tolrnc (float) – Tolerance, DUMMY for the default (10% of the separation between the first two points.
  • down_tol (float) – Downline Tolerance, DUMMY for none
  • reset_fi_ds (int) – Reset starting fiducials to zero (0: No, 1: Yes)

New in version 8.4.

License: Geosoft End-User License

Note: The same as XyzLine2, but with an option to reset each line’s starting fiducial to zero.

classmethod z_mask(db, line, chan, z_chan, zmin, zmax)

Mask dummies in one channel against another(Z) with the range Zmin/Zmax.

Parameters:
  • db (GXDB) – Database
  • line (int) – Line Handle
  • chan (int) – Channel to mask [DB_LOCK_READWRITE]
  • z_chan (int) – Mask Channel [DB_LOCK_READONLY]
  • zmin (float) – Min value of mask range
  • zmax (float) – Max value of mask range

New in version 5.0.

License: Geosoft End-User License

DB_DUP constants

Duplicate Types

DB_DUP_FIRST

First

gxapi.DB_DUP_FIRST = 1
DB_DUP_AVERAGE

Average

gxapi.DB_DUP_AVERAGE = 2
DB_DUP_MINIMUM

Minimum

gxapi.DB_DUP_MINIMUM = 3
DB_DUP_MAXIMUM

Maximum

gxapi.DB_DUP_MAXIMUM = 4
DB_DUP_MEDIAN

Median

gxapi.DB_DUP_MEDIAN = 5
DB_DUP_LAST

Last

gxapi.DB_DUP_LAST = 6

DB_DUPEDIT constants

Duplicate Edit Flags

DB_DUPEDIT_SINGLE

Single

gxapi.DB_DUPEDIT_SINGLE = 0
DB_DUPEDIT_ALL

All

gxapi.DB_DUPEDIT_ALL = 1

DU_CHANNELS constants

Channels to Display

DU_CHANNELS_DISPLAYED

Displayed

gxapi.DU_CHANNELS_DISPLAYED = 0
DU_CHANNELS_ALL

All

gxapi.DU_CHANNELS_ALL = 1

DU_EXPORT constants

Export Type

DU_EXPORT_CSV

Csv

gxapi.DU_EXPORT_CSV = 0
DU_EXPORT_ODDF

Oddf

gxapi.DU_EXPORT_ODDF = 1
DU_EXPORT_POST_PC

Post pc

gxapi.DU_EXPORT_POST_PC = 2
DU_EXPORT_POST_UNIX

Post unix

gxapi.DU_EXPORT_POST_UNIX = 3

DU_FILL constants

Filling Options

DU_FILL_INSIDE

Inside

gxapi.DU_FILL_INSIDE = 0
DU_FILL_OUTSIDE

Outside

gxapi.DU_FILL_OUTSIDE = 1

DU_IMPORT constants

Import Mode

DU_IMPORT_APPEND

Append

gxapi.DU_IMPORT_APPEND = 0
DU_IMPORT_REPLACE

Replace

gxapi.DU_IMPORT_REPLACE = 1
DU_IMPORT_MERGE

Merge

gxapi.DU_IMPORT_MERGE = 2
DU_IMPORT_MERGE_APPEND

Merge append

gxapi.DU_IMPORT_MERGE_APPEND = 3

DU_INTERP constants

Inside Interpolation Method

DU_INTERP_NEAREST

Nearest

gxapi.DU_INTERP_NEAREST = 1
DU_INTERP_LINEAR

Linear

gxapi.DU_INTERP_LINEAR = 2
DU_INTERP_CUBIC

Cubic

gxapi.DU_INTERP_CUBIC = 3
DU_INTERP_AKIMA

Akima

gxapi.DU_INTERP_AKIMA = 4
DU_INTERP_PREDICT

Predict

gxapi.DU_INTERP_PREDICT = 5

DU_INTERP_EDGE constants

Edge Interpolation Method

DU_INTERP_EDGE_NONE

None

gxapi.DU_INTERP_EDGE_NONE = 0
DU_INTERP_EDGE_SAME

Same

gxapi.DU_INTERP_EDGE_SAME = 1
DU_INTERP_EDGE_NEAREST

Nearest

gxapi.DU_INTERP_EDGE_NEAREST = 2
DU_INTERP_EDGE_LINEAR

Linear

gxapi.DU_INTERP_EDGE_LINEAR = 3

DU_LAB_TYPE constants

File Types

DU_LAB_TYPE_FREE

The delimiter string identifies characters to be used as delimiters. Use C style escape sequences to identify non-printable characters. The default delimiters for FREE format files are ” \t,”.

gxapi.DU_LAB_TYPE_FREE = 1
DU_LAB_TYPE_COMMA

For COMMA type files, the delimiter string identifies characters to be removed before comma delimiting. The default for COMMA delimited files is ” \t”.

gxapi.DU_LAB_TYPE_COMMA = 2

DU_LEVEL constants

Leveling Options

DU_LEVEL_LINES

Extract line corrections

gxapi.DU_LEVEL_LINES = 0
DU_LEVEL_TIES

Extract tie corrections

gxapi.DU_LEVEL_TIES = 1
DU_LEVEL_ALL

Extract all corrections

gxapi.DU_LEVEL_ALL = 2

DU_LINEOUT constants

Lineout Options (du.h)

DU_LINEOUT_SINGLE

Single

gxapi.DU_LINEOUT_SINGLE = 0
DU_LINEOUT_MULTIPLE

Multiple

gxapi.DU_LINEOUT_MULTIPLE = 1

DU_FEATURE_TYPE_OUTPUT constants

Export to geodatabase feature type (du.h)

DU_FEATURE_TYPE_OUTPUT_POINT

Point

gxapi.DU_FEATURE_TYPE_OUTPUT_POINT = 0
DU_FEATURE_TYPE_OUTPUT_LINE

Line

gxapi.DU_FEATURE_TYPE_OUTPUT_LINE = 1

DU_GEODATABASE_EXPORT_TYPE constants

Export to geodatabase overwrite mode(du.h)

DU_GEODATABASE_EXPORT_TYPE_OVERWRITE_GEODATABASE

Overwrite geodatabase

gxapi.DU_GEODATABASE_EXPORT_TYPE_OVERWRITE_GEODATABASE = 0
DU_GEODATABASE_EXPORT_TYPE_OVERWRITE_FEATURECLASS

Overwrite featureclass

gxapi.DU_GEODATABASE_EXPORT_TYPE_OVERWRITE_FEATURECLASS = 1
DU_GEODATABASE_EXPORT_TYPE_APPEND

Append

gxapi.DU_GEODATABASE_EXPORT_TYPE_APPEND = 2

DU_LINES constants

Lines to display

DU_LINES_DISPLAYED

Displayed

gxapi.DU_LINES_DISPLAYED = 0
DU_LINES_SELECTED

Selected

gxapi.DU_LINES_SELECTED = 1
DU_LINES_ALL

All

gxapi.DU_LINES_ALL = 2

DU_LOADLTB constants

Load table options

DU_LOADLTB_REPLACE

Replace

gxapi.DU_LOADLTB_REPLACE = 0
DU_LOADLTB_APPEND

Append

gxapi.DU_LOADLTB_APPEND = 1

DU_LOOKUP constants

Lookup Mode

DU_LOOKUP_EXACT

Requires an exact match in all indexes. Results will dummy if Indexes are not found.

gxapi.DU_LOOKUP_EXACT = 0
DU_LOOKUP_NEAREST

Requires that the first index match exactly. The nearest second index will be used for the finding the lookup value. The results will be dummy only if the first index does not have a match.

gxapi.DU_LOOKUP_NEAREST = 1
DU_LOOKUP_INTERPOLATE

The same as _NEAREST, except that the value will be interpolated between the two nearest framing values in the table.

gxapi.DU_LOOKUP_INTERPOLATE = 2
DU_LOOKUP_NEARESTCLOSE

Same as _NEAREST mode except that the target value must be within the CLOSE distance to a table value. a) the primary index channel for single index lookups; b) the secondary index channel for double index lookups. Values not in data spacing are dummy.

gxapi.DU_LOOKUP_NEARESTCLOSE = 3
DU_LOOKUP_INTERPCLOSE

Same as _INTERPOLATE mode except that the target value must be within the CLOSE distance to a table value. a) the primary index channel for single index lookups; b) the secondary index channel for double index lookups. Values not in data spacing are dummy.

gxapi.DU_LOOKUP_INTERPCLOSE = 4
DU_LOOKUP_INTERPOLATE_DUMMYOUTSIDE

Interpolate between values, dummy beyond two ends

gxapi.DU_LOOKUP_INTERPOLATE_DUMMYOUTSIDE = 5
DU_LOOKUP_INTERPOLATE_CONSTOUTSIDE

Interpolate between values, constant end values beyond two ends

gxapi.DU_LOOKUP_INTERPOLATE_CONSTOUTSIDE = 6
DU_LOOKUP_INTERPOLATE_EXTPLOUTSIDE

Interpolate between values, extrapolate beyond two ends

gxapi.DU_LOOKUP_INTERPOLATE_EXTPLOUTSIDE = 7
DU_LOOKUP_MAXOPTION

Maximum option value

gxapi.DU_LOOKUP_MAXOPTION = 8

DU_MASK constants

Masking Options

DU_MASK_INSIDE

Inside

gxapi.DU_MASK_INSIDE = 0
DU_MASK_OUTSIDE

Outside

gxapi.DU_MASK_OUTSIDE = 1

DU_MERGE constants

Merge flags

DU_MERGE_APPEND

Append

gxapi.DU_MERGE_APPEND = 0

DU_MODFID constants

Fid Update Options

DU_MODFID_INSERT

Will insert fid range by moving data. Inserted range will always be dummied out. If the insertion point is before start of data, the fid start is changed.

gxapi.DU_MODFID_INSERT = 0
DU_MODFID_DELETE

Will delete the range of fids.

gxapi.DU_MODFID_DELETE = 1
DU_MODFID_APPEND

Is like INSERT, except that it is only used to add fids to the start or end of the existing data. The data is not moved with repect to the current fid locations.

gxapi.DU_MODFID_APPEND = 2

DU_MOVE constants

Move Style

DU_MOVE_ABSOLUTE

Move input to absolute value in control channel

gxapi.DU_MOVE_ABSOLUTE = 0
DU_MOVE_MINUS

Subtract control channel from input channel

gxapi.DU_MOVE_MINUS = 1
DU_MOVE_PLUS

Add control channel to input channel

gxapi.DU_MOVE_PLUS = 2
DU_MOVE_INTERP

data is NOT moved, but dummies in the input are interpolated based on the control channel, assuming both the input and control vary linearly inside the gaps

gxapi.DU_MOVE_INTERP = 3

DU_REFID constants

Interpolation mode

DU_REFID_LINEAR

0

gxapi.DU_REFID_LINEAR = 0
DU_REFID_MINCUR

1

gxapi.DU_REFID_MINCUR = 1
DU_REFID_AKIMA

2

gxapi.DU_REFID_AKIMA = 2
DU_REFID_NEAREST

3

gxapi.DU_REFID_NEAREST = 3

DU_SORT constants

Sort Direction

DU_SORT_ASCENDING

Ascending

gxapi.DU_SORT_ASCENDING = 0
DU_SORT_DESCENDING

Descending

gxapi.DU_SORT_DESCENDING = 1

DU_SPLITLINE constants

Sort Direction

DU_SPLITLINE_XYPOSITION

Xyposition

gxapi.DU_SPLITLINE_XYPOSITION = 0
DU_SPLITLINE_SEQUENTIAL

Sequential

gxapi.DU_SPLITLINE_SEQUENTIAL = 1
DU_SPLITLINE_TOVERSIONS

Toversions

gxapi.DU_SPLITLINE_TOVERSIONS = 2

DU_STORAGE constants

Storage Type

DU_STORAGE_LINE

Line

gxapi.DU_STORAGE_LINE = 0
DU_STORAGE_GROUP

Group

gxapi.DU_STORAGE_GROUP = 1

QC_PLAN_TYPE constants

Type Plan

QC_PLAN_SURVEYLINE

Qc plan surveyline

gxapi.QC_PLAN_SURVEYLINE = 0
QC_PLAN_TIELINE

Qc plan tieline

gxapi.QC_PLAN_TIELINE = 1
QC_PLAN_BOTHLINES

Qc plan bothlines

gxapi.QC_PLAN_BOTHLINES = 2

DU_DISTANCE_CHANNEL_TYPE constants

Distance channel direction type

DU_DISTANCE_CHANNEL_MAINTAIN_DIRECTION

Zero distance is always at the start of the line.

gxapi.DU_DISTANCE_CHANNEL_MAINTAIN_DIRECTION = 0
DU_DISTANCE_CHANNEL_CARTESIAN_COORDINATES

Put zero at the end of the line with min X if X changes most, or min Y if Y changes most

gxapi.DU_DISTANCE_CHANNEL_CARTESIAN_COORDINATES = 1

DU_DIRECTGRID_METHOD constants

How to calculate the cell values for direct gridding.

DU_DIRECTGRID_MIN

Du directgrid min

gxapi.DU_DIRECTGRID_MIN = 0
DU_DIRECTGRID_MAX

Du directgrid max

gxapi.DU_DIRECTGRID_MAX = 1
DU_DIRECTGRID_MEAN

Du directgrid mean

gxapi.DU_DIRECTGRID_MEAN = 2