GXIMU class

class GXIMU(handle=0)

GXIMU class.

Not a class. This is a catch-all group of functions working on GXIMG objects (see GXIMG). Grid operations include masking, trending, windowing, expanding and grid stitching.

classmethod agg_to_geo_color(agg, grid, ipj, res)

Create a Geosoft color grid from an aggregate.

Parameters:
  • agg (GXAGG) – Input Aggregate
  • grid (str) – Output image name
  • ipj (GXIPJ) – Projection to use
  • res (float) – Resolution (Cell Size) size to use

New in version 5.1.6.

License: Geosoft End-User License

Note: This consumes a very small amount of memory

classmethod crc(img, pul_crc)

Computes a CRC Checksum on an image.

Parameters:
Returns:

CRC value

Return type:

int

New in version 5.0.

License: Geosoft Open License

classmethod crc_grid(grid, pul_crc)

Computes a CRC Checksum on a grid.

Parameters:
  • grid (str) – Grid
  • pul_crc (int) – Starting CRC (use CRC_INIT_VALUE if none)
Returns:

CRC value

Return type:

int

New in version 5.0.

License: Geosoft Open License

classmethod crc_grid_inexact(grid, pul_crc, float_bits, double_bits)

Computes a CRC Checksum on a grid and allows you to specify number of bits of floats/doubles to drop so that the CRC will be same even of this are changed.

Parameters:
Returns:

CRC value

Return type:

int

New in version 5.0.

License: Geosoft Open License

Note: Very useful for testing where the last bits of accuracy are not as important.

classmethod crc_inexact(img, pul_crc, float_bits, double_bits)

Computes a CRC Checksum on an image and allows you to specify number of bits of floats/doubles to drop so that the CRC will be same even of this are changed.

Parameters:
Returns:

CRC value

Return type:

int

New in version 5.0.

License: Geosoft Open License

Note: Very useful for testing where the last bits of accuracy are not as important.

classmethod export_grid_without_data_section_xml(grid, crc, file)

Export a Grid minus the data section as an XML file.

Parameters:
  • grid (str) – Grid
  • crc (int_ref) – CRC returned
  • file (str) – Output XML file

New in version 7.2.

License: Geosoft End-User License

classmethod export_grid_xml(grid, crc, file)

Export a Grid as an XML file.

Parameters:
  • grid (str) – Grid
  • crc (int_ref) – CRC returned
  • file (str) – Output XML file

New in version 6.0.

License: Geosoft End-User License

classmethod export_raw_xml(img, crc, file)

Export a Grid as an XML file using a fast raw output.

Parameters:
  • img (GXIMG) – Image
  • crc (int_ref) – CRC returned
  • file (str) – Output XML file

New in version 7.0.

License: Geosoft End-User License

classmethod export_xml(img, crc, file)

Export a Grid as an XML file.

Parameters:
  • img (GXIMG) – Image
  • crc (int_ref) – CRC returned
  • file (str) – Output XML file

New in version 6.0.

License: Geosoft End-User License

classmethod get_z_peaks_vv(img, vv_x, vv_y, vv_z)
Same as get_zvv, but find the closest peak value to the input locations, and return
the peak value and peak value location.
Parameters:
  • img (GXIMG) – Input grid
  • vv_x (GXVV) – X GXVV
  • vv_y (GXVV) – Y GXVV
  • vv_z (GXVV) – Z GXVV filled with values (set to be same size as X, Y)

New in version 9.0.

License: Geosoft End-User License

Note: The returned locations will always be a grid point location; no interpolation is performed when locating the peaks. A simple search is
done of all neighbouring points from the starting point, and once no neighbours can be located with a higher value, the search stops.
classmethod get_zvv(img, vv_x, vv_y, vv_z)

Extract an interpolated image value for given XY GXVV locations

Parameters:
  • img (GXIMG) – Input grid
  • vv_x (GXVV) – X GXVV
  • vv_y (GXVV) – Y GXVV
  • vv_z (GXVV) – Z GXVV filled with values (set to be same size as X, Y)

New in version 5.0.8.

License: Geosoft End-User License

classmethod grid_add(img1, m1, img2, m2, imgo)

Adds two Grid images together point-by-point.

Parameters:
  • img1 (GXIMG) – Image of first grid
  • m1 (float) – Multiplier to operate on first grid image
  • img2 (GXIMG) – Image of second grid
  • m2 (float) – Multiplier to operate on second grid image
  • imgo (GXIMG) – Output grid image

New in version 5.0.

License: Geosoft End-User License

Note: The GXIMG parameters MUST be of type GS_DOUBLE! If not, the method will terminate.

classmethod grid_agc(i_img, o_img, width, max_gain, remove_background)

Automatic Gain Compensation of a grid.

Parameters:
  • i_img (GXIMG) – Image of input grid
  • o_img (GXIMG) – Image of output grid
  • width (int) – Width of filter to separate signal from background.
  • max_gain (float) – Maximum gain applied to the signal.
  • remove_background (int) – Remove background before applying gain?

New in version 5.0.

License: Geosoft End-User License

Note: The GXIMG parameters MUST be of type GS_FLOAT! If not, the method will terminate.

classmethod grid_bool(img1, img2, out, bool, sizing, olap)

Mask one grid against another using boolean logic operations.

Parameters:

New in version 5.0.

License: Geosoft End-User License

Note: The GXIMG parameters must be of type GS_DOUBLE! If not, the method will terminate.

classmethod grid_edge(grid, vv_x, vv_y)

Get grid edge points

Parameters:
  • grid (str) – Grid file name
  • vv_x (GXVV) – X coordinates of edge points
  • vv_y (GXVV) – Y coordinates of edge points

New in version 5.0.

License: Geosoft End-User License

classmethod grid_edge_ply(img, ply, min_points)

Get grid edge points

Parameters:
  • img (GXIMG) – The Grid
  • ply (GXPLY) – GXPLY containing the edges.
  • min_points (int) – Minimum number of points in polygons (0 for all)

New in version 5.1.8.

License: Geosoft End-User License

Note: Unlike grid_ply and GridPlyEx_IMU, the image is not altered. It just gives the GXPLY.

classmethod grid_exp_fill(in_grd, out_grd, p_ex, t_ex)

Extends and fills a grid for GXFFT2.

Parameters:
  • in_grd (str) – Name of the input grid
  • out_grd (str) – Name of the output grid
  • p_ex (float) – % expansion
  • t_ex (int) – Shape of expansion: 0 - rectangle, 1 - square

New in version 7.2.

License: Geosoft Open License

classmethod grid_expand(im_gi, out, per, shape, x, y)

Expand a grid and place dummies in the area beyond the original edges.

Parameters:
  • im_gi (GXIMG) – Image of input grid
  • out (str) – File name of output grid
  • per (float) – Minimum percentage to expand the grid by
  • shape (int) – IMU_EXPAND_SHAPE constants
  • x (int) – X Dimension the output grid is expanded to
  • y (int) – Y Dimension the output grid is expanded to

New in version 5.0.

License: Geosoft End-User License

Note: The GXIMG parameter MUST be of type GS_FLOAT! If not, the method will terminate.

classmethod grid_fill(im_gi, im_go, rollopt, rolldist, mxf, mxp, rollbase, alimit, elimit, width, npass)

Interpolates to fill dummies, generates an output grid.

Parameters:
  • im_gi (GXIMG) – Image of input grid
  • im_go (GXIMG) – Image of output grid
  • rollopt (int) – IMU_FILL_ROLLOPT constants
  • rolldist (int) – Distance at which to roll off to 0
  • mxf (int) – Maximum prediction filter length
  • mxp (int) – Maximum prediction filter area
  • rollbase (float) – Base value to roll off to
  • alimit (float) – Maximum amplitude allowed in grid
  • elimit (float) – Maximum edge amplitude allowed in grid
  • width (int) – Width from edge to start limiting from
  • npass (int) – Number of convolution passes to apply

New in version 5.0.

License: Geosoft End-User License

Note: The GXIMG parameters MUST be of type GS_FLOAT! If not, the method will terminate.

classmethod grid_filt(img, imgo, passes, mult, dum, hz, usefile, file, vv)

Applies a filter to a grid any number of passes.

Parameters:
  • img (GXIMG) – Image of first grid
  • imgo (GXIMG) – Image of second grid
  • passes (int) – Number of passes to apply filter (>0)
  • mult (float) – Multiplier to apply to grid values
  • dum (int) – IMU_FILT_DUMMY constants
  • hz (int) – IMU_FILT_HZDRV constants
  • usefile (int) – IMU_FILT_FILE constants
  • file (str) – Name of file containing filter values
  • vv (GXVV) – GXVV containing filter values (if not using a file for the values) MUST BE OF TYPE ‘real’

New in version 5.0.

License: Geosoft End-User License

Note: The GXIMG parameters MUST be of type GS_FLOAT! If not, the method will terminate.

classmethod grid_head(grid, esep, vsep, x_orig, y_orig, rot)

Modifies Statistics contained in a grid header.

Parameters:
  • grid (str) – Name of the grid whose header is to be modified.
  • esep (float) – Element separation
  • vsep (float) – Vector separation
  • x_orig (float) – Grid X Origin on ground
  • y_orig (float) – Grid Y Origin on ground
  • rot (float) – Grid Rotation

New in version 5.0.

License: Geosoft Open License

classmethod grid_in_fill(im_gi, out_grd, extend, iter)

Fill in a ribbon along the edge and inside hollow areas of the grid

Parameters:
  • im_gi (GXIMG) – Image of input grid
  • out_grd (str) – Name of the output grid
  • extend (int) – Number of cells to extend ribbon along the edge
  • iter (int) – Number of iterations to fill inside hollow areas

New in version 7.2.

License: Geosoft Open License

classmethod grid_mask(in_grid, m_grid, pply, mode)

Create a mask grid using a set of polygon coordinates defined in a separate file, then masking the polygon over an input grid.

Parameters:
  • in_grid (str) – Name of input grid
  • m_grid (str) – Name of output mask grid file
  • pply (GXPLY) – Polygon containing mask coordinates
  • mode (int) – IMU_MASK constants

New in version 5.0.

License: Geosoft End-User License

Note: The GXIMG parameters MUST be of type GS_DOUBLE! If not, the method will terminate.

The GXPLY will contain more than one polygon if it was loaded from a file containing coordinates of more than one polygon.

classmethod grid_peak(grid, nlmt, v_vx, v_vy, v_vz)

Pick grid peaks.

Parameters:
  • grid (str) – Grid file name
  • nlmt (int) – Peak test directions (1 to 4)
  • v_vx (GXVV) – X of found peaks
  • v_vy (GXVV) – Y of found peaks
  • v_vz (GXVV) – Z values of found peaks

New in version 5.0.

License: Geosoft End-User License

Note: Peak test directions defines how grid peaks are to be found. For example, with the 1, a grid point will be picked if its value is greater than it’s two neighbors in at least one direction. Up to 4 directions can be tested.

classmethod grid_ply(img, ply, refresh)

Get the grid edge in a GXPLY

Parameters:
  • img (GXIMG) – The GXIMG
  • ply (GXPLY) – GXPLY to which the bounding polygons will be added.
  • refresh (int) – TRUE to force the boundary to be refreshed.

New in version 5.1.

License: Geosoft End-User License

Note: This will optionally refresh the grid boundary GXPLY and return the GXPLY.

If the boundary is not refreshed and has never been calculated, the boundary will be the bounding rectangle of the grid.

The grid GXPLY will be added to existing ploygons in the passed GXPLY.

classmethod grid_ply_ex(img, ply, refresh, min_points)

Get the grid edge in a GXPLY (with min points)

Parameters:
  • img (GXIMG) – The GXIMG
  • ply (GXPLY) – GXPLY to which the bounding polygons will be added.
  • refresh (int) – TRUE to force the boundary to be refreshed.
  • min_points (int) – Minimum number of points in polygons refreshed (0 for all)

New in version 5.1.6.

License: Geosoft End-User License

Note: This will optionally refresh the grid boundary GXPLY and return the GXPLY.

If the boundary is not refreshed and has never been calculated, the boundary will be the bounding rectangle of the grid.

The grid GXPLY will be added to existing ploygons in the passed GXPLY.

classmethod grid_reproject_and_window(input_grid_filename, output_grid_filename, new_projection, min_x, max_x, min_y, max_y)

Create a new grid by reprojecting an existing grid and windowing its contents

Parameters:
  • input_grid_filename (str) – Input grid filename
  • output_grid_filename (str) – Output grid filename
  • new_projection (GXIPJ) – Output grid projection
  • min_x (float) – Window minX (in output projection)
  • max_x (float) – Window maxX (in output projection)
  • min_y (float) – Window minY (in output projection)
  • max_y (float) – Window maxY (in output projection)

New in version 7.3.

License: Geosoft Open License

classmethod grid_resample(input_grid_filename, output_grid_filename, o_x, o_y, d_x, d_y, n_x, n_y)

Create a new grid by resampling an existing grid

Parameters:
  • input_grid_filename (str) – Input grid filename
  • output_grid_filename (str) – Output grid filename
  • o_x (float) – Origin X
  • o_y (float) – Origin Y
  • d_x (float) – Cell spacing X
  • d_y (float) – Cell spacing Y
  • n_x (int) – Elements in X
  • n_y (int) – Elements in Y

New in version 7.3.

License: Geosoft Open License

Note: Works only for un rotated grids.

classmethod grid_resize(in_grd, out_grd)

Resize a grid to reduce the size not cover the outside dummies.

Parameters:
  • in_grd (str) – File name of input grid
  • out_grd (str) – File name of output grid

New in version 5.0.

License: Geosoft End-User License

classmethod grid_shad(in_grid, sh_grid, inc, dec, scl)

Create a shaded relief image.

Parameters:
  • in_grid (str) – Input image name
  • sh_grid (str) – Output new shaded image
  • inc (float_ref) – Inclination 0-90 degrees (def. 45)
  • dec (float_ref) – Declination 0-360 degrees azimuth (def. 45)
  • scl (float_ref) – Vertical scale factor (distance/z unit)

New in version 5.0.

License: Geosoft Open License

Note: Pass GS_R8DM as parameters to obtain default values. The default values are returned.

classmethod grid_st(grid, st)

Update an GXST object using a grid.

Parameters:
  • grid (str) – Grid name
  • st (GXST) – GXST (statistics) object to fill/update

New in version 5.1.2.

License: Geosoft End-User License

Note: The input GXST object is not initialized by grid_st, so this function can be used to accumulate statistical info on more than a single grid. See GXST.

classmethod grid_stat(grid, type, xelem, yelem, xsep, ysep, kx, x_orig, y_orig, rot, base, mult)

Reports statistics contained in a grid header.

Parameters:
  • grid (str) – Name of the grid to get stats from
  • type (int_ref) – Element type in bytes
  • xelem (int_ref) – Elements in X direction
  • yelem (int_ref) – Elements in Y direction
  • xsep (float_ref) – X element separation
  • ysep (float_ref) – Y element separation
  • kx (int_ref) – KX (storage orientation)
  • x_orig (float_ref) – X origin
  • y_orig (float_ref) – Y origin
  • rot (float_ref) – Grid Rotation
  • base (float_ref) – Base removed
  • mult (float_ref) – Grid multiplier

New in version 5.0.

License: Geosoft Open License

Note: Statistics are returned in the parameter set

classmethod grid_stat_comp(grid, type, xelem, yelem, xsep, ysep, kx, x_orig, y_orig, rot, base, mult, comp)

Reports statistics contained in a grid header.

Parameters:
  • grid (str) – Name of the grid to get stats from
  • type (int_ref) – Element type: 0 - byte 1 - USHORT 2 - SHORT 3 - LONG 4 - FLOAT 5 - DOUBLE 6 - 32 byte Color (RGBx)
  • xelem (int_ref) – Elements in X direction
  • yelem (int_ref) – Elements in Y direction
  • xsep (float_ref) – X element separation
  • ysep (float_ref) – Y element separation
  • kx (int_ref) – KX (storage orientation)
  • x_orig (float_ref) – X origin
  • y_orig (float_ref) – Y origin
  • rot (float_ref) – Grid Rotation
  • base (float_ref) – Base removed
  • mult (float_ref) – Grid multiplier
  • comp (float_ref) – Compression Ratio

New in version 5.0.

License: Geosoft Open License

Note: Statistics are returned in the parameter set

classmethod grid_stat_ext(grid, force, items, dums, min, max, mean, stddev)

Reports statistics of a grid’s elements.

Parameters:

New in version 5.0.

License: Geosoft Open License

Note: If the IMU_STAT_FORCED constants value is set, the statistics will be recalculated. Statistics are returned in the parameter set.

classmethod grid_stat_trend(grid, trend_valid, co, cx, cy)

Reports Trend Info of a grid (for first order coefficients only).

Parameters:
  • grid (str) – Name of the grid to get stats from
  • trend_valid (int_ref) – Trend Valid Flag
  • co (float_ref) – Trend coefficient rCo
  • cx (float_ref) – Trend coefficient rCx
  • cy (float_ref) – Trend coefficient rCy

New in version 5.0.

License: Geosoft End-User License

Note: Trend Info are returned in the parameter set

classmethod grid_stat_trend_ext(grid, order, num_coef, xo, yo, vm)

Reports Extended Trend Info of a grid (for up to third order coefficients).

Parameters:
  • grid (str) – Grid name
  • order (int_ref) – Trend order
  • num_coef (int_ref) – Number of coefficients
  • xo (float_ref) – Trend origin Xo
  • yo (float_ref) – Trend origin Yo
  • vm (GXVM) – GXVM hold coefficient values MUST BE OF TYPE ‘real’

New in version 5.0.

License: Geosoft End-User License

Note: Trend Info are returned in the parameter set

classmethod grid_stitch(grid1, grid2, grid3, method, tr_order1, tr_order2, tr_calc, gap, spline, path, pply, weighting, width)

Stitches together too grids

Parameters:
  • grid1 (str) – Input Grid1 name
  • grid2 (str) – Input Grid2 name
  • grid3 (str) – Output Grid name
  • method (int) – Stitching method
  • tr_order1 (int) – Grid 1 trend removal order
  • tr_order2 (int) – Grid 2 trend removal order
  • tr_calc (int) – Trend removal type of points to use
  • gap (float) – Gap for interpolation
  • spline (int) – Interpolation spline method
  • path (int) – Path selection
  • pply (GXPLY) – GXPLY object for user path
  • weighting (float) – Correction weighting
  • width (int) – Width of corrections, in grid cells (8 to 256)

New in version 5.0.

License: Geosoft End-User License

classmethod grid_stitch_ctl(ctl)

Stitches together two grids - control file for options.

Parameters:ctl (str) – Control file containing all “GRIDSTCH” parameters

New in version 5.1.4.

License: Geosoft End-User License

Note: Data validation is done internally, not in the GX. This is simply a way of avoiding writing a new GX wrapper every time an option is added.

classmethod grid_tiff(grds, tiff, bcol, red, green, blue, csize, reg, scale)

Generate a Tiff (Tagged-Image file format) file with up to 16 grids.

Parameters:
  • grds (str) – Comma-delimited string containing names of all grids to use in Tiff generation Up to 16 grids allowed.
  • tiff (str) – Name of Tiff file to create
  • bcol (str) – Background color option. One of W (White) K (Black) C (Cyan) M (Magenta) Y (Yellow) R (Red) G (Green) B (Blue)
  • red (int) – Background Red value (0-255)
  • green (int) – Background Green (0-255)
  • blue (int) – Background Blue (0-255)
  • csize (float) – New cell size
  • reg (int) – Pixel size of registration marks
  • scale (float) – Map scale

New in version 5.0.

License: Geosoft End-User License

Note: The background color can be either selected from one of 8 settings, or can be specified as a combination of Reg,Green, and Blue values.

classmethod grid_trnd(imgi, imgo, tr_option, edge, order, vm, num_coefs)

Remove a trend surface from a grid.

Parameters:
  • imgi (GXIMG) – Handle to input image
  • imgo (GXIMG) – Handle to output image
  • tr_option (int) – 0-calculate, 1-given, 2-replace
  • edge (int) – IMU_TREND constants
  • order (int) – Trend order
  • vm (GXVM) – GXVM holds coefficients
  • num_coefs (int) – Number of coefficients

New in version 5.0.

License: Geosoft End-User License

Note: Both Images must be of type GS_DOUBLE. The GXVM parameter must be of type REAL, and be of size 10 at most.

The number of coefficients must be compatible with the order of the trend removed. Following is the number of coefficients which should be present for a given order

Order Number of Coefficients
0 1
1 3
2 6
3 10
classmethod grid_trns(grid, tcon)

Transpose a grid by swapping the grid rows with the grid columns.

Parameters:
  • grid (str) – Name of the grid to transpose
  • tcon (int) – Transpose condition value IMU_TRANS constants

New in version 5.0.

License: Geosoft Open License

Note: If the grid has a line orientation that does NOT match the IMU_TRANS constants value, this method will not succeed.

classmethod grid_type(grid)

Reports the true data the of a grid (geosoft types)

Parameters:grid (str) – Name of the Grid
Returns:GS_TYPES constants
Return type:int

New in version 5.0.

License: Geosoft Open License

classmethod grid_vd(im_gi, im_go)

Apply vertical derivative convolution filter to a grid.

Parameters:
  • im_gi (GXIMG) – Input image
  • im_go (GXIMG) – Output image

New in version 5.0.

License: Geosoft End-User License

classmethod grid_vol(img, rbase, mult, vol_a, vol_b, diff)

Calculates the grid volumes above and below a reference base.

Parameters:
  • img (GXIMG) – Image of the grid to calculate volume for
  • rbase (float) – Reference base
  • mult (float) – Multiplier to final volume
  • vol_a (float_ref) – Grid Volume above reference base
  • vol_b (float_ref) – Grid Volume below reference base
  • diff (float_ref) – Differences between volumes

New in version 5.0.

License: Geosoft End-User License

Note: Volumes are calculated above and below a reference base level, and reported as positive integers. A multiplier is applied to the final volume (to correct for units).

The GXIMG parameters MUST be of type GS_FLOAT! If not, the method will terminate.

classmethod grid_wind(img, out, coord, xmin, xmax, ymin, ymax, zmin, zmax, csize, clip, dec, mdf)

Create a grid using a defined area window within a larger grid.

Parameters:
  • img (GXIMG) – Image of input grid
  • out (str) – Name of output grid file
  • coord (int) – IMU_WIND_COORD constants
  • xmin (float) – Min. limit of window in X direction (can be rDUMMY)
  • xmax (float) – Max. limit of window in X direction (can be rDUMMY)
  • ymin (float) – Min. limit of window in Y direction (can be rDUMMY)
  • ymax (float) – Max. limit of window in Y direction (can be rDUMMY)
  • zmin (float) – Minimum Z data value in output grid (can be rDUMMY)
  • zmax (float) – Maximum Z data value in output grid (can be rDUMMY)
  • csize (float) – New grid cell size
  • clip (int) – IMU_WIND_DUMMIES constants
  • dec (int) – Decimation factor
  • mdf (str) – Name of .MDF file for data clipping

New in version 5.0.

License: Geosoft Open License

classmethod grid_wind2(img, out, xmin, xmax, ymin, ymax, zmin, zmax, clip)

Window a grid.

Parameters:
  • img (GXIMG) – Image of input grid
  • out (str) – Name of output grid file
  • xmin (float) – Minimum X, ground units (can be rDUMMY)
  • xmax (float) – Maximum X (can be rDUMMY)
  • ymin (float) – Minimum Y (can be rDUMMY)
  • ymax (float) – Maximum Y (can be rDUMMY)
  • zmin (float) – Minimum Z (can be rDUMMY)
  • zmax (float) – Maximum Z (can be rDUMMY)
  • clip (int) – IMU_WIND_DUMMIES constants

New in version 5.0.

License: Geosoft Open License

Note: To change the cell size or work in a different projection, first inherit the GXIMG by calling

The windowed grid will be adjusted/expanded to include the defined area and line up on an even grid cell.

classmethod grid_xyz(img, xyz, index, dec_x, dec_y, lab)

Export a Grid image to an XYZ file.

Parameters:

New in version 5.0.

License: Geosoft End-User License

Note: The GXIMG (image) of the grid to export must be of type GS_FLOAT. If not, this method will terminate with an error.

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 make_mi_tab_file(file)

Make a MapInfo tab file for this grid

Parameters:file (str) – Grid file name

New in version 5.1.6.

License: Geosoft End-User License

classmethod make_mi_tabfrom_grid(file)

Make a MapInfo tab file for this grid as rendered in a map

Parameters:file (str) – Grid file name

New in version 5.1.5.

License: Geosoft End-User License

classmethod make_mi_tabfrom_map(map)

Make a MapInfo tab file from this map

Parameters:map (str) – Map file name

New in version 5.1.5.

License: Geosoft End-User License

classmethod mosaic(grids, name, ipj, cell)

Create a mosaic image of an image list.

Parameters:
  • grids (str) – Image names (‘|’ separated)
  • name (str) – Output image name (“” for a memory only image)
  • ipj (GXIPJ) – Projection to use (0 to use the first grid’s projection)
  • cell (float) – Cell size to use (rDummy to use first grid)
Returns:

GXIMG Object

Return type:

GXIMG

New in version 5.1.8.

License: Geosoft End-User License

Note: The images are simply placed on the output image, starting with the first image. Note that this function may require very large amounts of virtual memory.

classmethod null()

A null (undefined) instance of GXIMU

Returns:A null GXIMU
Return type:GXIMU
classmethod peak_size(grid, vv_x, vv_y, max, prec, v_vz)

Define the sizes of all the peaks in an image.

Parameters:
  • grid (str) – Grid file name
  • vv_x (GXVV) – Peaks’ X
  • vv_y (GXVV) – Peaks’ Y
  • max (int) – Maximum target diameter (window) in # of cells
  • prec (float) – Precision factor (see note above)
  • v_vz (GXVV) – Returned peak (anomaly) sizes in data units

New in version 5.0.

License: Geosoft End-User License

Note: Extending from the peak location of an anomaly to the inflection points of the grid values along each of the 8 directions results in 8 radii. Anomaly size is defined as the 2*mediam of the 8 radii.

Precision factor is used to control definition of an inflection point. For points A,B, and C, B is an inflection point if (A+C)/2.0 > B. With the precision factor, B is an inflection point only when (A+C)/2.0 > B*(1.0+Precision factor). This factor must be within (-1.0,1.0).

Note: peak_size2 is probably a better routine…

classmethod peak_size2(grid, vv_x, vv_y, max, v_vz)

Define the sizes of all the peaks in an image - new algorithm

Parameters:
  • grid (str) – Grid file name
  • vv_x (GXVV) – Peaks’ X
  • vv_y (GXVV) – Peaks’ Y
  • max (int) – Maximum target diameter (window) in # of cells
  • v_vz (GXVV) – Returned peak (anomaly) sizes in data units

New in version 5.1.4.

License: Geosoft End-User License

Note: Extending from the peak location of an anomaly to the inflection points of the grid values along each of the 8 directions results in 8 radii. Anomaly size is defined as the 2*mediam of the 8 radii.

This algorithm uses 4 successive points d1, d2, d3 and d4 in any direction. Given slopes m1 = d2-d1, m2 = d3-d2 and m3 = d4-d3, an inflection point occurs between d2 and d3 if m1>m2 and m2<m3. The location index is given as i3 - s2/(s2-s1), where i3 is the index of d3, and s1=m2-m1 and s2=m3-m2.

This algorithm tends to give much smaller (and more reasonable) results than peak_size.

classmethod pigeon_hole(img, vv_x, vv_y, put)

Pigeon-hole and count points by location into a grid.

Parameters:
  • img (GXIMG) – Input grid
  • vv_x (GXVV) – X locations
  • vv_y (GXVV) – Y locations
  • put (int_ref) – Number of points located in the grid.

New in version 5.0.8.

License: Geosoft End-User License

Note: X and Y location VVs are input. If a point (X, Y) is located within one-half cell width from a location in the grid, then the value of the grid at that location is incremented by 1. The cells are inclusive at the minima, and exclusive at the maxima: e.g. if dDx = dDy = 1, and dXo = dYo = 0, then the corner cell would accept values -0.5 <= X < 0.5 and -0.5 <= Y < 0.5. The grid values should be set to 0 before calling this function.

The number of points “pigeon-holed” is returned to the user. This function is useful, for instance, in determining the density of sample locations in a survey area.

classmethod profile(img, x1, y1, x2, y2, samsep, vv_z)

Extract a profile from a grid.

Parameters:
  • img (GXIMG) – Input image
  • x1 (float) – X1
  • y1 (float) – Y1
  • x2 (float) – X2
  • y2 (float) – Y2
  • samsep (float) – Sample separation, if 0.0, use grid cell size
  • vv_z (GXVV) – GXVV in which to place result

New in version 5.0.

License: Geosoft End-User License

Note: Returned GXVV will start at X1,Y1 and will sample up to X2,Y2 at the specified separation.

classmethod profile_vv(img, vv_x, vv_y, vv_z)

Extract a GXVV profile from a grid.

Parameters:
  • img (GXIMG) – Input image
  • vv_x (GXVV) – X GXVV coordinates
  • vv_y (GXVV) – Y GXVV coordinates
  • vv_z (GXVV) – GXVV in which to place result

New in version 5.0.

License: Geosoft End-User License

See also

iGetPolyLine_DBE

classmethod range_grids(grids, ipj, min_x, min_y, max_x, max_y)

Determine bounding rectangle for a set of grids

Parameters:
  • grids (str) – List of grid files, “|” delimited
  • ipj (GXIPJ) – Projection for the range - see notes
  • min_x (float_ref) – Min X - returned range in the projection
  • min_y (float_ref) – Min Y
  • max_x (float_ref) – Max X
  • max_y (float_ref) – Max Y

New in version 5.1.8.

License: Geosoft End-User License

Note: If an GXIPJ is IPJ_CS_UNKNOWN, the GXIPJ of the first grid in the list will be used and the GXIPJ will be returned in this setting. Otherwise, the range in the requested GXIPJ will be determined.

classmethod range_ll(img, min_lat, min_lon, max_lat, max_lon)

Determine the range in lat. and long. of a projected grid

Parameters:

New in version 5.0.

License: Geosoft End-User License

Note: This routine determines the latitude and longitudes along the edge of a grid and returns the minimal and maximal values. It scans each row and and column and finds the first non-dummy position at the start and end, and then determines the coordinates at those points. If the grid has no data, no GXIPJ object, or if the Source Type of the GXIPJ is not IPJ_TYPE_PCS (projected coordinate system), then the returned values are dummies (GS_R8DM).

classmethod refresh_shad(in_img, sh_img, inc, dec, scl)

Refresh a shaded relief image

Parameters:
  • in_img (GXIMG) – Input grid object
  • sh_img (GXIMG) – Output shaded grid object
  • inc (float_ref) – Inclination 0-90 degrees (def. 45)
  • dec (float_ref) – Declination 0-360 degrees azimuth (def. 45)
  • scl (float_ref) – Vertical scale factor (distance/z unit)

New in version 9.4.

License: Geosoft Open License

Note: Pass GS_R8DM as parameters to obtain default values. The default values are returned.

classmethod slope_standard_deviation(img)

Return the standard deviation of the slopes.

Parameters:img (GXIMG) – Grid object
Returns:Standard deviation of grid slopes
Return type:float

New in version 8.2.

License: Geosoft Open License

Note: This method calculates the standard deviation of the horizontal differences in the X and Y directions for the supplied image. This is useful for shading routines. A good default scaling factor is 2.5 / standard deviation.

The image will be sub-sampled to a statistically meaningful number.

The cell sizes are used to determine the slopes.

classmethod stat_window(img, min_x, min_y, max_x, max_y, max, st)

Calculate grid statistics in a window

Parameters:
  • img (GXIMG) – Name of the grid to get stats from
  • min_x (float) – Min X window
  • min_y (float) – Min Y window
  • max_x (float) – Max X window
  • max_y (float) – Max Y window
  • max (int) – Maximum values needed, 0 for all
  • st (GXST) – GXST object, stats are accumulated

New in version 5.0.5.

License: Geosoft End-User License

Note: The maximum values needed will beused to decimate the sampling of the grid in order to improve performance. 100000 is often a good number when absolute precision is not required.

classmethod update_ply(img, ply)

Update the grid boundary in the grid metadata

Parameters:

New in version 6.2.

License: Geosoft End-User License

Note: You can call the GridEdgePLY function to get an edge, perhaps alter the edge, such as thin it to a reasonable resolution, then put set it as the grid boundary by calling this funtion. This is similar to the GridPLYEx function except that you get to alter the GXPLY before it is placed back in the GXIMG.

IMU_BOOL_OLAP constants

Overlapping area option

IMU_BOOL_OLAP_AVE

Overlap values are averaged

gxapi.IMU_BOOL_OLAP_AVE = 0
IMU_BOOL_OLAP_1

Overlap values use grid 1 value

gxapi.IMU_BOOL_OLAP_1 = 1
IMU_BOOL_OLAP_2

Overlap values use grid 2 value

gxapi.IMU_BOOL_OLAP_2 = 2

IMU_BOOL_OPT constants

Boolean logic option

IMU_BOOL_OPT_AND

Valid areas are only where grids overlap

gxapi.IMU_BOOL_OPT_AND = 0
IMU_BOOL_OPT_OR

Valid areas are where either grid is a valid value

gxapi.IMU_BOOL_OPT_OR = 1
IMU_BOOL_OPT_XOR

Overlap areas are dummied

gxapi.IMU_BOOL_OPT_XOR = 2

IMU_BOOL_SIZING constants

Sizing option

IMU_BOOL_SIZING_MIN

Output grid is sized to overlapping region

gxapi.IMU_BOOL_SIZING_MIN = 0
IMU_BOOL_SIZING_0

Output grid is sized to grid 1

gxapi.IMU_BOOL_SIZING_0 = 1
IMU_BOOL_SIZING_1

Output grid is sized to grid 2

gxapi.IMU_BOOL_SIZING_1 = 2
IMU_BOOL_SIZING_MAX

Output grid is sized to maximum combined area of both grids

gxapi.IMU_BOOL_SIZING_MAX = 3

IMU_DOUBLE_CRC_BITS constants

Bits to use in double CRC’s

IMU_DOUBLE_CRC_BITS_EXACT

Exact CRC

gxapi.IMU_DOUBLE_CRC_BITS_EXACT = 0
IMU_DOUBLE_CRC_BITS_DEFAULT

Default inaccuracy in double (10 Bits)

gxapi.IMU_DOUBLE_CRC_BITS_DEFAULT = 10
IMU_DOUBLE_CRC_BITS_MAX

Maximum number of inaccuracy bits (51 Bits)

gxapi.IMU_DOUBLE_CRC_BITS_MAX = 51

IMU_EXPAND_SHAPE constants

Shape of output grid

IMU_EXPAND_SHAPE_RECTANGLE

Rectangle

gxapi.IMU_EXPAND_SHAPE_RECTANGLE = 0
IMU_EXPAND_SHAPE_SQUARE

Square

gxapi.IMU_EXPAND_SHAPE_SQUARE = 1

IMU_FILL_ROLLOPT constants

Defines for Grid Filling Method Options

IMU_FILL_ROLLOPT_LINEAR

Linear

gxapi.IMU_FILL_ROLLOPT_LINEAR = 1
IMU_FILL_ROLLOPT_SQUARE

Square

gxapi.IMU_FILL_ROLLOPT_SQUARE = 2

IMU_FILT_DUMMY constants

Settings for placing dummy values in grid if any of filter values are dummy

IMU_FILT_DUMMY_NO

No

gxapi.IMU_FILT_DUMMY_NO = 0
IMU_FILT_DUMMY_YES

Yes

gxapi.IMU_FILT_DUMMY_YES = 1

IMU_FILT_FILE constants

Flags which indicate if a file is to be used to read the filter values

IMU_FILT_FILE_NO

No

gxapi.IMU_FILT_FILE_NO = 0
IMU_FILT_FILE_YES

Yes

gxapi.IMU_FILT_FILE_YES = 1

IMU_FILT_HZDRV constants

Flags which indicate which type of horizontal derivative is being applied (X direction, Y direction, none at all)

IMU_FILT_HZDRV_NO

No

gxapi.IMU_FILT_HZDRV_NO = 0
IMU_FILT_HZDRV_X

X

gxapi.IMU_FILT_HZDRV_X = 1
IMU_FILT_HZDRV_Y

Y

gxapi.IMU_FILT_HZDRV_Y = 2

IMU_FLOAT_CRC_BITS constants

Bits to use in float CRC’s

IMU_FLOAT_CRC_BITS_EXACT

Exact CRC

gxapi.IMU_FLOAT_CRC_BITS_EXACT = 0
IMU_FLOAT_CRC_BITS_DEFAULT

Default inaccuracy in floats (7 Bits)

gxapi.IMU_FLOAT_CRC_BITS_DEFAULT = 7
IMU_FLOAT_CRC_BITS_MAX

Maximum number of inaccuracy bits (22 Bits)

gxapi.IMU_FLOAT_CRC_BITS_MAX = 22

IMU_MASK constants

Defined options for masking grids

IMU_MASK_INSIDE

Inside

gxapi.IMU_MASK_INSIDE = 0
IMU_MASK_OUTSIDE

Outside

gxapi.IMU_MASK_OUTSIDE = 1

IMU_STAT_FORCED constants

Defined options for forcing recalculating the grid values

IMU_STAT_FORCED_NO

No

gxapi.IMU_STAT_FORCED_NO = 0
IMU_STAT_FORCED_YES

Yes

gxapi.IMU_STAT_FORCED_YES = 1

IMU_TRANS constants

Transpose Options available for grid_trns implies original grid lines:

IMU_TRANS_DEFAULT

Can be ANY orientation

gxapi.IMU_TRANS_DEFAULT = 0
IMU_TRANS_Y

MUST be parallel to Y-Axis

gxapi.IMU_TRANS_Y = 1
IMU_TRANS_X

MUST be parallel to X-Axis

gxapi.IMU_TRANS_X = -1

IMU_TREND constants

Points in grid to use

IMU_TREND_ALL

All

gxapi.IMU_TREND_ALL = 0
IMU_TREND_EDGE

Edge

gxapi.IMU_TREND_EDGE = 1

IMU_WIND_COORD constants

Output grid coordinate units

IMU_WIND_GRID

Imu wind grid

gxapi.IMU_WIND_GRID = 0
IMU_WIND_GROUND

Imu wind ground

gxapi.IMU_WIND_GROUND = 1

IMU_WIND_DUMMIES constants

Option for handling out-of-range Z values

IMU_WIND_DUMMY

Imu wind dummy

gxapi.IMU_WIND_DUMMY = 0
IMU_WIND_CLIP

Imu wind clip

gxapi.IMU_WIND_CLIP = 1

IMU_XYZ_INDEX constants

Flags whether to use grid index numbers as station numbers.

IMU_XYZ_INDEX_NO

No

gxapi.IMU_XYZ_INDEX_NO = 0
IMU_XYZ_INDEX_YES

Yes

gxapi.IMU_XYZ_INDEX_YES = 1

IMU_XYZ_LABEL constants

XYZ Label Flags

IMU_XYZ_LABEL_NO

No

gxapi.IMU_XYZ_LABEL_NO = 1
IMU_XYZ_LABEL_YES

Yes

gxapi.IMU_XYZ_LABEL_YES = 0