GXEXP class¶
-
class
GXEXP
(handle=0)¶ 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 theGXDU.math
function (seeGXDU
). See alsoGXIEXP
for applying math expressions to images (grids). See alsoGXDU.math
applies expressions to the database-
classmethod
create
(db, formula, max_len)¶ This method creates an
GXEXP
object.Parameters: - db (GXDB) – Database Object
- formula (str) – Expression using channel names
- max_len (int) – Maximum size of expression after expanding all local variables (those with $ prefix).
Returns: GXEXP
ObjectReturn type: 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)¶ This method creates an
GXEXP
object from a fileParameters: - db (GXDB) – Database Object
- file (str) – File name
Returns: GXEXP
ObjectReturn type: New in version 5.0.
License: Geosoft End-User License
-
is_null
()¶ Check if this is a null (undefined) instance
Returns: True if this is a null (undefined) instance, False otherwise. Return type: bool
-
classmethod