GXAGG class¶
-
class
GXAGG
(handle=0)¶ GXAGG class.
The
GXAGG
class is used to handle image display on maps. An aggregate contains one or more image layers (LAY) with each layer representing a grid or image file. TheGXAGG
will combine all the layers to form one image-
change_brightness
(brt)¶ Change the brightness.
Parameters: brt (float) – -1.0 - black; 0.0 no change; 1.0 white New in version 5.0.
License: Geosoft Open License
Note: 0.0 brightness does nothing. -1.0 to 0.0 makes colors darker, -1.0 is black 0.0 to 1.0 makes colors lighter, 1.0 is white
-
classmethod
create
()¶ Create an aggregate
Returns: GXAGG
objectReturn type: GXAGG New in version 5.0.
License: Geosoft Open License
-
classmethod
create_map
(map, name)¶ Create
GXAGG
from Map with Group name.Parameters: Returns: GXAGG
objectReturn type: New in version 5.0.5.
License: Geosoft Open License
Note: The Agg Group name must include the View name with a backslash separating the view name and group name; e.g. “DataAGG_test” (when used as a string, the double slash represents as single ).
-
get_brightness
()¶ Get the brightness setting of the
GXAGG
Return type: float New in version 5.0.
License: Geosoft Open License
Note: Brightness can range from -1.0 (black) to 1.0 (white). This brightness control is relative to the normal color when the
GXAGG
is created.GXAGG
brightness depends on the brightness of theGXITR
of each layer. Calling dGetBright_AGG will poll all layers, and if all have the same brightness, this is returned. If any of the layers have a different brightness, the current brightness of each layer is changed to be the reference brightness (0.0)and the brightness value of 0.0 is returned.See also
-
get_layer_itr
(layer, itr)¶ Get the
GXITR
of a layerParameters: layer (int) – Layer number New in version 5.0.
License: Geosoft Open License
Note: Layers are numbered from 0, consecutively in the order they are placed in the aggregate.
An error will occur if the layer does not exist.
Caller must create/destroy
GXITR
.
-
is_null
()¶ Check if this is a null (undefined) instance
Returns: True if this is a null (undefined) instance, False otherwise. Return type: bool
-
layer_img
(name, zone, color, cont)¶ Add an image as a layer in an aggregate.
Parameters: - name (str) – Grid name
- zone (int) – AGG_LAYER_ZONE constants transform to use if color table has none defined.
- color (str) – Color table name, “” for default This can be a .TBL .ZON .`GXITR <geosoft.gxapi.GXITR>` or .`GXAGG <geosoft.gxapi.GXAGG>` file .TBL is the default
- cont (float) – Color contour interval or
rDUMMY
for default
New in version 5.0.
License: Geosoft Open License
See also
-
layer_img_ex
(name, zone, color, min, max, cont)¶ Add an image as a layer in an aggregate.
Parameters: - name (str) – Grid name
- zone (int) – AGG_LAYER_ZONE constants transform to use if color table has none defined.
- color (str) – Color table name, “” for default This can be a .TBL .ZON .`GXITR <geosoft.gxapi.GXITR>` or .`GXAGG <geosoft.gxapi.GXAGG>` file .TBL is the default
- min (float) – Minimum value or
rDUMMY
for default - max (float) – Maximum value or
rDUMMY
for default - cont (float) – Color contour interval or
rDUMMY
for default
New in version 8.2.
License: Geosoft Open License
See also
-
layer_shade_img
(name, color, inc, dec, scl)¶ Add a shaded image as a layer in an aggregate.
Parameters: New in version 5.0.
License: Geosoft Open License
Note: A new grid file will be created to hold the shaded image data. This file will have the same name as the original grid but with “_s” added to the root name. It will always be located in the workspace directory regardless of the location of the original source image. If the file already exists, it will replaced.
-
list_img
(gvv)¶ Lists file names of all the IMGs inside of the
GXAGG
.Parameters: gvv (GXVV) – GXVV
of type -STR_FILE
Returns: The number of IMGs. Return type: int New in version 5.0.6.
License: Geosoft Open License
Note: The returned
GXVV
contains the file names.
-
num_layers
()¶ Get the number of layers in an aggregate.
Returns: The number of layers in an aggregate. Return type: int New in version 5.0.
License: Geosoft Open License
-
set_layer_itr
(layer, itr)¶ Set the
GXITR
of a layerParameters: layer (int) – Layer number New in version 5.0.
License: Geosoft Open License
Note: Layers are numbered from 0, consecutively in the order they are placed in the aggregate.
An error will occur if the layer does not exist.
Caller must create/destroy
GXITR
.
-
set_model
(model)¶ Sets the Color Model
Parameters: model (int) – AGG_MODEL constants New in version 5.0.
License: Geosoft Open License
-
set_render_method
(method)¶ Sets the Rendering Method
Parameters: method (int) – AGG_RENDER constants New in version 5.1.1.
License: Geosoft Open License
-
AGG_LAYER_ZONE constants¶
Aggregate Layer Zone defines
-
AGG_LAYER_ZONE_DEFAULT
¶ If a color table with no color transform is passed it will be used with the default zoning method of the data, which is usually
AGG_LAYER_ZONE_EQUALAREA
.-
gxapi.
AGG_LAYER_ZONE_DEFAULT
= 0
-
-
AGG_LAYER_ZONE_LINEAR
¶ Linear Distribution
-
gxapi.
AGG_LAYER_ZONE_LINEAR
= 1
-
-
AGG_LAYER_ZONE_NORMAL
¶ Normal Distribution
-
gxapi.
AGG_LAYER_ZONE_NORMAL
= 2
-
-
AGG_LAYER_ZONE_EQUALAREA
¶ Equal Area Distribution
-
gxapi.
AGG_LAYER_ZONE_EQUALAREA
= 3
-
-
AGG_LAYER_ZONE_SHADE
¶ If
AGG_LAYER_ZONE_SHADE
is specified, a shaded relief layer is created from the specified grid. A new grid file will also be created to hold the shaded relief image data. This file will have the same name as the original grid but with “_s” added to the root name. It will always be located in the workspace directory regardless of the location of the original source image. If the file already exists, it will used as it is. Shading is always at inclination = declination = 45 deg. with default scaling. If different shading is desired, use thelayer_shade_img
method.-
gxapi.
AGG_LAYER_ZONE_SHADE
= 4
-
-
AGG_LAYER_ZONE_LOGLINEAR
¶ Log Linear Distribution
-
gxapi.
AGG_LAYER_ZONE_LOGLINEAR
= 5
-
-
AGG_LAYER_ZONE_LAST
¶ The last
GXITR
used to display this data will be used if it exists. If it does not exist, the behaviour is the same asAGG_LAYER_ZONE_DEFAULT
.-
gxapi.
AGG_LAYER_ZONE_LAST
= 6
-
AGG_MODEL constants¶
Aggregation color model defines
-
AGG_MODEL_HSV
¶ Hue Saturation Value
-
gxapi.
AGG_MODEL_HSV
= 1
-
-
AGG_MODEL_RGB
¶ Red Green Blue
-
gxapi.
AGG_MODEL_RGB
= 2
-
-
AGG_MODEL_CMY
¶ Cyan Magenta Yellow
-
gxapi.
AGG_MODEL_CMY
= 3
-
AGG_RENDER constants¶
Aggregation rendering modes
-
AGG_RENDER_ADD
¶ Add all the colors together
-
gxapi.
AGG_RENDER_ADD
= 0
-
-
AGG_RENDER_BLEND
¶ Adds and divides by the number of non-dummy colors
-
gxapi.
AGG_RENDER_BLEND
= 1
-
-
AGG_RENDER_BLEND_ALL
¶ Adds and divides by the number of colors
-
gxapi.
AGG_RENDER_BLEND_ALL
= 2
-
-
AGG_RENDER_FADE
¶ Multiplies current colors by the input’s colors over 255 (input works as the percentage of color to preserve)
-
gxapi.
AGG_RENDER_FADE
= 3
-