GXEXP class

class GXEXP(handle=0)[source]

GXEXP class.

GXEXP objects are created from text strings that contain C-like math to be applied to channels in a database. It is used with the GXDU.math function (see GXDU). See also GXIEXP for applying math expressions to images (grids). See also GXDU.math applies expressions to the database

__init__(handle=0)[source]

Initialize self. See help(type(self)) for accurate signature.

classmethod create(db, formula, unused)[source]

This method creates an GXEXP object.

Parameters
  • db (GXDB) – Database Object

  • formula (str) – Expression using channel names

  • unused (int) – Legacy parameter, no longer used.

Returns

GXEXP Object

Return type

GXEXP

New in version 5.0.

License: Geosoft End-User License

Note: Expressions are strings that contain C-like math to be applied to channels in a database. For example, following an expression:

"@a = mag-64000; @b = gravity*100;
 $sRatio = @a/@b;
 MULT = @a *@b;"

Rules:

;

terminates a sub-expression

@

prefix to a temporary name, which is a double precision floating point number to be used later in the same expression.

$

prefix to a local GX variable name. Such names will be evaluated to the variable value at the time create is called.

All other tokens are assumed to be channel names.

classmethod create_file(db, file)[source]

This method creates an GXEXP object from a file

Parameters
  • db (GXDB) – Database Object

  • file (str) – File name

Returns

GXEXP Object

Return type

GXEXP

New in version 5.0.

License: Geosoft End-User 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

classmethod null()[source]

A null (undefined) instance of GXEXP

Returns

A null GXEXP

Return type

GXEXP