GXITR class

class geosoft.gx.GXITR
The ITR class provides access to ITR files. An ITR file maps
ranges of values to specific colours. The ITR object is typically
used in conjunction with MVIEW objects (see MVIEW and MVU).

Note:

Histogram ranges and colour zone ranges

Histogram bins are defined with inclusive minima and exclusive maxima;
for instance if Min = 0 and Inc = 1, then the second bin would include
all values z such that  0 <= z < 1 (the first bin has all values < 0).

Colour zones used in displaying grids (ITR, ZON etc...) are the
opposite, with exclusive minima and inclusive maxima.
For instance, if a zone is defined from 0 to 1, then it would
contain all values of z such that 0 < z <= 1.

These definitions mean that it is impossible to perfectly assign
ITR colours to individual bars of a histogram. The best work-around
when the data values are integers is to define the colour zones using
0.5 values between the integers. A general work-around is to make the
number of histogram bins much larger than the number of colour zones.

The geosoft.gx.GXITR.null() is used to hold a NULL handle to an ITR class.
change_brightness((float)arg1) → None:
Change the brightness.
Parameters:arg1 (float) – -1.0 - black; 0.0 no change; 1.0 white
Returns:Nothing
Return type:None

New in version 5.0.0.

Note:

0.0 brightness does nothing.
-1.0 to 0.0 makes colours darker, -1.0 is black
0.0 to 1.0 makes colours lighter, 1.0 is white
color_value((float)arg1) → int:
Transform single data value to color
Parameters:arg1 (float) – Data value
Returns:MVIEW_COLOR constants
Return type:int

New in version 5.1.0.

color_vv((GXVV)arg1, (GXVV)arg2) → None:
Get color transform of a VV.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.6.

Note:

If the input value is a dummy, then the output colour
is 0 (no colour).
copy((GXITR)arg1) → None:
Copies ITRs
Parameters:arg1 (geosoft.gx.GXITR) – ITR Source
Returns:Nothing
Return type:None

New in version 5.0.0.

static create((GXContext)ctx) → GXITR:
Create an ITR Object
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:ITR Object
Return type:geosoft.gx.GXITR

New in version 5.0.0.

static create_file((GXContext)ctx, (str)arg1) → GXITR:
Create an ITR Object from an itr, tbl, zon, lut file.
Parameters:
  • ctx (geosoft.gx.GXContext) – The GX execution context
  • arg1 (str) – file name, type determined from extension
Returns:

ITR Object

Return type:

geosoft.gx.GXITR

New in version 5.0.0.

static create_img((GXContext)ctx, (GXIMG)arg1, (str)arg2, (int)arg3, (float)arg4) → GXITR:
Create an ITR for an image.
Parameters:
Returns:

ITR Object

Return type:

geosoft.gx.GXITR

New in version 5.1.0.

Note:

The ITR_ZONE_DEFAULT model will ask the IMG to provide
a model if it can.

If a shaded relief model is selected, a shaded image
will be created and a shaded image file will be created with
the same name as the original grid but with the suffux "_s"
added to the name part of the grid.
static create_map((GXContext)ctx, (GXMAP)arg1, (str)arg2) → GXITR:
Create ITR from Map with Agg Group name.
Parameters:
Returns:

ITR Object

Return type:

geosoft.gx.GXITR

New in version 5.0.0.

static create_s((GXContext)ctx, (GXBF)arg1) → GXITR:
Create an ITR Object from a BF
Parameters:
Returns:

ITR Object

Return type:

geosoft.gx.GXITR

New in version 5.0.0.

equal_area((GXST)arg1, (float)arg2) → None:
Calculate an equal area transform.
Parameters:
  • arg1 (geosoft.gx.GXST) – Stat object with a histogram
  • arg2 (float) – colour contour interval or dummy for none
Returns:

Nothing

Return type:

None

New in version 5.1.2.

get_brightness() → float:
Get the brightness setting of the ITR
Returns:The brightness setting of the ITR
Return type:float

New in version 5.0.0.

Note:

Brightness can range from -1.0 (black) to 1.0 (white).
This brightness control is relative to the normal colour
when the ITR is created.
get_data_limits((float_ref)arg1, (float_ref)arg2) → None:
Get ITR max/min data limits.
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.0.0.

Note:

In some ITRs, especially those defined and
embedded inside grid (IMG) objects, the
actual data minimum and maximum values are
stored. This function retrieves those values.
This is NOT true of all ITR objects, and in
those cases dummy values will be returned.
get_reg() → GXREG:
Get the ITR's REG
Returns:REG object
Return type:geosoft.gx.GXREG

New in version 5.0.0.

get_size() → int:
Get the number of zones in an ITR
Returns:The number of zones.
Return type:int

New in version 5.0.0.

get_zone_color((int)arg1, (int_ref)arg2) → None:
Get the colour in a zone of the ITR
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Valid indices are 0 to N-1, where N is the size of the ITR.
get_zone_model_type() → int:
Get the ITR zone model (e.g. Linear, LogLin, Equal Area).
Returns:ITR_ZONE_MODEL constants
Return type:int

New in version 6.4.0.

Note:

This function may be used to determine if a colour
transform is included in an ITR.
get_zone_value((int)arg1) → float:
Get the value in a zone of the ITR
Parameters:arg1 (int) – Number of the zone to set.
Returns:The value of the specified zone.
Return type:float

New in version 5.0.0.

Note:

Valid indices are 0 to N-2, where N is the size of the ITR.
is_null() → bool

Check if the instance of geosoft.gx.GXITR is null (undefined)

Returns:True if this is a null instance of geosoft.gx.GXITR, False otherwise.
Return type:bool`
linear((float)arg1, (float)arg2, (float)arg3) → None:
Calculate a linear transform.
Parameters:
  • arg1 (float) – minimum
  • arg2 (float) – maximum
  • arg3 (float) – colour contour interval or dummy for none
Returns:

Nothing

Return type:

None

New in version 5.0.0.

load_a((str)arg1) → None:
Load to an ASCII file, ZON, TBL or ER-Mapper LUT
Parameters:arg1 (str) – file name
Returns:Nothing
Return type:None

New in version 5.1.6.

log_linear((float)arg1, (float)arg2, (float)arg3) → None:
Calculate a log transform.
Parameters:
  • arg1 (float) – minimum ( > 0)
  • arg2 (float) – maximum ( > minimum)
  • arg3 (float) – colour contour interval or dummy for none
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The function name is a misnomer. This is a pure log transform.
normal((float)arg1, (float)arg2, (float)arg3, (float)arg4) → None:
Calculate a normal distribution transform.
Parameters:
  • arg1 (float) – Standard deviation
  • arg2 (float) – mean
  • arg3 (float) – expansion, normally 1.0
  • arg4 (float) – colour contour interval or dummy for none
Returns:

Nothing

Return type:

None

New in version 5.1.2.

static null() → GXITR

A null (undefined) instance of geosoft.gx.GXITR

Returns:A null geosoft.gx.GXITR
Return type:geosoft.gx.GXITR
power_zone((int)arg1) → None:
Modified ITR zone values to 10 (or e) raized to the power of the values
Parameters:arg1 (int) – ITR_POWER constants
Returns:Nothing
Return type:None

New in version 5.0.0.

save_a((str)arg1) → None:
Save to an ASCII file, ZON, TBL or ER-Mapper LUT
Parameters:arg1 (str) – file name
Returns:Nothing
Return type:None

New in version 5.1.2.

save_file((str)arg1) → None:
Save to any type (based on the extension of the input file name).
Parameters:arg1 (str) – file name
Returns:Nothing
Return type:None

New in version 8.2.

serial((GXBF)arg1) → None:
Serialize an ITR to a BF
Parameters:arg1 (geosoft.gx.GXBF) – BF to serialize to
Returns:Nothing
Return type:None

New in version 5.0.0.

static set_agg_map((GXContext)ctx, (GXMAP)arg1, (str)arg2, (GXITR)arg3) → None:
Set ITR to an Agg in map
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

See the geosoft.gx.GXITR.create_map() function
set_bright_contrast((float)arg1, (float)arg2) → None:
Set the brightness of the ITR colours
Parameters:
  • arg1 (float) – 0.0 - black; 0.5 normal; 1.0 white
  • arg2 (float) – 0.0 - flat; 1.0 normal
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Brightness settings:
    0.0   - black
    0.5   - normal (no change)
    1.0   - white

Contrast
   0.0   - flat
   1.0   - full contrast (normal)
set_color_model((int)arg1) → None:
Set the color model of an ITR.
Parameters:arg1 (int) – ITR_COLOR_MODEL constants
Returns:Nothing
Return type:None

New in version 5.0.2.

set_data_limits((float)arg1, (float)arg2) → None:
Set ITR max/min data limits.
Parameters:
  • arg1 (float) – Data minimum value
  • arg2 (float) – Data maximum value
Returns:

Nothing

Return type:

None

New in version 6.3.0.

set_size((int)arg1) → None:
Set the number of zones in an ITR
Parameters:arg1 (int) – Number of zones to set ITR to.
Returns:Nothing
Return type:None

New in version 5.0.0.

set_zone_color((int)arg1, (int)arg2) → None:
Set the colour in a zone of the ITR
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Valid indices are 0 to N-1, where N is the size of the ITR.
set_zone_value((int)arg1, (float)arg2) → None:
Set the value in a zone of the ITR
Parameters:
  • arg1 (int) – Number of the zone to set.
  • arg2 (float) – The value to set
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Valid indices are 0 to N-2, where N is the size of the ITR.

ITR_COLOR_MODEL constants

ITR Color Model defines
gx.ITR_COLOR_MODEL_HSV = 1
gx.ITR_COLOR_MODEL_RGB = 2
gx.ITR_COLOR_MODEL_CMY = 3

ITR_POWER constants

Power Zoning defines
gx.ITR_POWER_10 = 0
Power of 10
gx.ITR_POWER_EXP = 1
Exponential

ITR_ZONE constants

Zoning Methods
gx.ITR_ZONE_DEFAULT = 0
gx.ITR_ZONE_LINEAR = 1
gx.ITR_ZONE_NORMAL = 2
gx.ITR_ZONE_EQUALAREA = 3
gx.ITR_ZONE_SHADE = 4
gx.ITR_ZONE_LOGLINEAR = 5

ITR_ZONE_MODEL constants

ITR Zone Model defines
gx.ITR_ZONE_MODEL_NOZONE = -1
The ITR has no numeric zones defined (e.g. from a TBL file)
gx.ITR_ZONE_MODEL_NONE = 0
There is no specific zone model defined.
gx.ITR_ZONE_MODEL_LINEAR = 1
The ITR is set up with a linear transform.
gx.ITR_ZONE_MODEL_NORMAL = 2
The ITR is set up with a normal distribution transform.
gx.ITR_ZONE_MODEL_EQUAL = 3
The ITR is set up with an equal area transform.
gx.ITR_MODEL_LOGLIN = 4
The ITR is set up with a log-linear transform.