geosoft.gxpy.agg submodule

Geosoft aggregate images

Classes

Aggregate_image

image constructed from one or more grid/image layers

Geosoft aggregates are “aggregations” of one or more grid layers that together create a georeferenced image that can be placed in a map view or rendered on a plane in a 3D view.

Note

Regression tests provide usage examples: aggregate tests

exception AggregateException(message)[source]

Bases: geosoft.GXRuntimeError

Exceptions from geosoft.gxpy.agg.

New in version 9.2.

class Aggregate_image[source]

Bases: geosoft.gxpy.geometry.Geometry

The AGG class supports the creation of aggregate images from one or more grid data sets. Aggregates can be placed into a 2D or 3D view for display.

Constructors
open

open an existing aggregate

new

create a new aggregate

New in version 9.2.

__init__()[source]

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

add_layer(grid_file, color_map=None, zone=None, shade=False, minimum=None, maximum=None, contour=None)[source]

Add an image layer to an aggregate

Parameters
  • grid_file – The name of a grid file (image or data) to add.

  • color_mapgxpy.group.Color_map instance, or the name of a file, which may be tbl, zon, itr, or agg.

  • zone

    Colour distribution method:

    ZONE_DEFAULT

    as set by user global default settings

    ZONE_LINEAR

    linearly distributed

    ZONE_NORMAL

    normal (Gaussian) distribution

    ZONE_EQUALAREA

    each color will occupy an equal area on the image

    ZONE_LOGLINEAR

    logarithmic linear distribution

    ZONE_LAST

    last used coloring for this grid file

    ZONE_SHADE

    Displays the shaded image version of the grid. The shaded image is a grid file will with ‘_s’ appended to the file name. If it does not exist, a shaded image with illumination inclination and declination both set to 45 degrees is automatically created.

  • shade – True, to add a shading layer

  • minimum – Minimum data value. All grid values less than or equal to the minimum will be assigned the first color in the table. The default is calculated from the data.

  • maximum – Maximum data value. All grid values greater than or equal to the maximum will be assigned the last color in the table. The default is calculated from the data.

  • contour – Break colors on this interval, colors will be thinned if necessary.

New in version 9.2.

property brightness

Aggregate brightness between -1 (black) and +1 (white).

close()[source]

Close an Aggregate, releases resources.

property coordinate_system

Returns the aggregate coordinate_system, which is the same as the first layer.

Returns

pixel size in units of the coordinate system

New in version 9.3.1.

property extent

Object extent as a Point2 instance.

property extent_2d
figure_map(file_name=None, overwrite=False, title=None, legend_label=None, features='SCALE', 'LEGEND', 'NEATLINE', **kwargs)[source]

Create a figure map file from an aggregate.

Parameters
  • file_name – the name of the map, if None a default map is created.

  • overwrite – True to overwrite existing image file

  • title – Title added to the image

  • legend_label – If plotting a legend make this the legned title. The default is the title in the first aggregate layer colour map.

  • features

    list of features to place on the map, default is (‘SCALE’, ‘LEGEND’, ‘NEATLINE’)

    ’SCALE’

    show a scale bar

    ’LEGEND’

    show an aggregate colour legend

    ’NEATLINE’

    draw a neat-line around the image

    ’ANNOT_XY’

    annotate map coordinates

    ’ANNOT_LL’

    annotate map Latitude, Longitude

    ’CONTOUR’

    contour the first layer in the aggregate

  • kwargs – passed to geosoft.gxpy.map.Map.new

New in version 9.3.

property gxagg

The geosoft.gxapi.GXAGG instance handle.

image_file(image_file=None, image_type='PNG', pix_width=None, display_area=None, pix_32_bit=False)[source]

Save the aggregate as a georeferenced image file.

Parameters
  • image_file – image file name. The extension should be consistent with the image_type. If not specified a temporary PNG file is created.

  • image_type – image type, one ot the RASTER_FORMAT constants in geosoft.gxpy.map.

  • pix_width – desired image width in pixels, default is the width of the aggregate base layer

  • display_areageosoft.gxpy.geometry.Point2 instance, which defines the desired display area. The display area coordinate system can be different from the grid.

  • pix_32_bit – make 32-bit image (with 8-bit alpha background)

Returns

image file name.

New in version 9.3.1.

layer_color_map(layer=0)[source]

Return the geosoft.gxpy.group.Color_map of a layer.

Parameters

layer – layer number or layer name

Returns

geosoft.gxpy.group.Color_map

New in version 9.2.

property layer_count

Number of layers in the aggregate.

property layer_file_names

Return list of layer files in the aggregate.

New in version 9.2.

layer_unit_of_measure(layer=0)[source]

Return the unit of measurement for the specified layer

Parameters

layer – layer number or layer name

New in version 9.3.

property name

Name of the Aggregate_image.

classmethod new(grid_file=None, **kwargs)[source]

Create a new aggregate from a grid.

Parameters

grid_file – grid file name

add_layer() is called to add the grid as a layer.

New in version 9.2.

classmethod open(gxagg)[source]

Create an Aggregate_image from a geosoft.gxapi.GXAGG instance.

Parameters

gxagggeosoft.gxapi.GXAGG instance

New in version 9.2.

property spatial_properties

Returns the spatial properties of the base layer in the aggregate.

Returns

(nx, ny, x0, y0, dx, dy, rot)

New in version 9.3.1.