GXIMU class

class geosoft.gxapi.GXIMU
Not a class. This is a catch-all group of functions working
on IMG objects (see IMG). Grid operations include masking,
trending, windowing, expanding and grid stitching.
static agg_to_geo_color((GXAGG)arg1, (str)arg2, (GXIPJ)arg3, (float)arg4) → None:
Create a geosoft color grid from an aggregate.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.6.

Note:

This consumes a very small amount of memory
static crc((GXIMG)arg1, (int)arg2) → int:
Computes a CRC Checksum on an image.
Parameters:
Returns:

CRC value

Return type:

int

New in version 5.0.0.

static crc_grid((str)arg1, (int)arg2) → int:
Computes a CRC Checksum on a grid.
Parameters:
Returns:

CRC value

Return type:

int

New in version 5.0.0.

static crc_grid_inexact((str)arg1, (int)arg2, (int)arg3, (int)arg4) → int:
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.0.

Note:

Very usefull for testing where the last bits of accuracy
are not as important.
static crc_inexact((GXIMG)arg1, (int)arg2, (int)arg3, (int)arg4) → int:
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.0.

Note:

Very usefull for testing where the last bits of accuracy
are not as important.
static export_grid_without_data_section_xml((str)arg1, (int_ref)arg2, (str)arg3) → None:
Export a Grid minus the data section as an XML file.
Parameters:
Returns:

Nothing

Return type:

None

New in version 7.2.0.

static export_grid_xml((str)arg1, (int_ref)arg2, (str)arg3) → None:
Export a Grid as an XML file.
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.0.0.

static export_raw_xml((GXIMG)arg1, (int_ref)arg2, (str)arg3) → None:
Export a Grid as an XML file using a fast raw output.
Parameters:
Returns:

Nothing

Return type:

None

New in version 7.0.0.

static export_xml((GXIMG)arg1, (int_ref)arg2, (str)arg3) → None:
Export a Grid as an XML file.
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.0.0.

static get_z_peaks_vv((GXIMG)arg1, (GXVV)arg2, (GXVV)arg3, (GXVV)arg4) → None:
Same as geosoft.gxapi.GXIMU.get_zvv(), but find the closest peak value to the input locations, and return
                                          the peak value and peak value location.
Parameters:
Returns:

Nothing

Return type:

None

New in version 9.0.0.

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.
static get_zvv((GXIMG)arg1, (GXVV)arg2, (GXVV)arg3, (GXVV)arg4) → None:
Extract an interpolated image value for given XY VV locations
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.8.

static grid_add((GXIMG)arg1, (float)arg2, (GXIMG)arg3, (float)arg4, (GXIMG)arg5) → None:
Adds two Grid images together point-by-point.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The IMG parameters MUST be of type GS_DOUBLE!
If not, the method will terminate.
static grid_agc((GXIMG)arg1, (GXIMG)arg2, (int)arg3, (float)arg4, (int)arg5) → None:
Automatic Gain Compensation of a grid.
Parameters:
  • arg1 (geosoft.gxapi.GXIMG) – Image of input grid
  • arg2 (geosoft.gxapi.GXIMG) – Image of output grid
  • arg3 (int) – Width of filter to separate signal from background.
  • arg4 (float) – Maximum gain applied to the signal.
  • arg5 (int) – Remove background before applying gain?
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The IMG parameters MUST be of type GS_FLOAT!
If not, the method will terminate.
static grid_bool((GXIMG)arg1, (GXIMG)arg2, (str)arg3, (int)arg4, (int)arg5, (int)arg6) → None:
Mask one grid against another using boolean logic
operations.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The IMG parameters must be of type GS_DOUBLE!
If not, the method will terminate.
static grid_edge((str)arg1, (GXVV)arg2, (GXVV)arg3) → None:
Get grid edge points
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static grid_edge_ply((GXIMG)arg1, (GXPLY)arg2, (int)arg3) → None:
Get grid edge points
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.8.

Note:

Unlike geosoft.gxapi.GXIMU.grid_ply() and GridPlyEx_IMU, the image is not
altered. It just gives the PLY.
static grid_exp_fill((str)arg1, (str)arg2, (float)arg3, (int)arg4) → None:
Extends and fills a grid for FFT2.
Parameters:
  • arg1 (str) – Name of the input grid
  • arg2 (str) – Name of the output grid
  • arg3 (float) – % expansion
  • arg4 (int) – Shape of expansion: 0 - rectangle, 1 - square
Returns:

Nothing

Return type:

None

New in version 7.2.0.

static grid_expand((GXIMG)arg1, (str)arg2, (float)arg3, (int)arg4, (int)arg5, (int)arg6) → None:
Expand a grid and place dummies in the area
beyond the original edges.
Parameters:
  • arg1 (geosoft.gxapi.GXIMG) – Image of input grid
  • arg2 (str) – File name of output grid
  • arg3 (float) – Minimum percentage to expand the grid by
  • arg4 (int) – IMU_EXPAND_SHAPE constants
  • arg5 (int) – X Dimension the output grid is expanded to
  • arg6 (int) – Y Dimension the output grid is expanded to
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The IMG parameter MUST be of type GS_FLOAT!
If not, the method will terminate.
static grid_fill((GXIMG)arg1, (GXIMG)arg2, (int)arg3, (int)arg4, (int)arg5, (int)arg6, (float)arg7, (float)arg8, (float)arg9, (int)arg10, (int)arg11) → None:
Interpolates to fill dummies, generates an output grid.
Parameters:
  • arg1 (geosoft.gxapi.GXIMG) – Image of input grid
  • arg2 (geosoft.gxapi.GXIMG) – Image of output grid
  • arg3 (int) – IMU_FILL_ROLLOPT constants
  • arg4 (int) – Distance at which to roll off to 0
  • arg5 (int) – Maximum prediction filter length
  • arg6 (int) – Maximum prediction filter area
  • arg7 (float) – Base value to roll off to
  • arg8 (float) – Maximum amplitude allowed in grid
  • arg9 (float) – Maximum edge amplitude allowed in grid
  • arg10 (int) – Width from edge to start limiting from
  • arg11 (int) – Number of convolution passes to apply
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The IMG parameters MUST be of type GS_FLOAT!
If not, the method will terminate.
static grid_filt((GXIMG)arg1, (GXIMG)arg2, (int)arg3, (float)arg4, (int)arg5, (int)arg6, (int)arg7, (str)arg8, (GXVV)arg9) → None:
Applies a filter to a grid any number
of passes.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The IMG parameters MUST be of type GS_FLOAT!
If not, the method will terminate.
static grid_head((str)arg1, (float)arg2, (float)arg3, (float)arg4, (float)arg5, (float)arg6) → None:
Modifies Statistics contained in a grid header.
Parameters:
  • arg1 (str) – Name of the grid whose header is to be modified.
  • arg2 (float) – Element separation
  • arg3 (float) – Vector separation
  • arg4 (float) – Grid X Origin on ground
  • arg5 (float) – Grid Y Origin on ground
  • arg6 (float) – Grid Rotation
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static grid_in_fill((GXIMG)arg1, (str)arg2, (int)arg3, (int)arg4) → None:
Fill in a ribbon along the edge and inside hollow areas of the grid
Parameters:
  • arg1 (geosoft.gxapi.GXIMG) – Image of input grid
  • arg2 (str) – Name of the output grid
  • arg3 (int) – Number of cells to extend ribbon along the edge
  • arg4 (int) – Number of iterations to fill inside hollow areas
Returns:

Nothing

Return type:

None

New in version 7.2.0.

static grid_mask((str)arg1, (str)arg2, (GXPLY)arg3, (int)arg4) → None:
Create a mask grid using a set of polygon
coordinates defined in a separate file, then
masking the polygon over an input grid.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

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

The PLY will contain more than one polygon
if it was loaded from a file containing
coordinates of more than one polygon.
static grid_peak((str)arg1, (int)arg2, (GXVV)arg3, (GXVV)arg4, (GXVV)arg5) → None:
Pick grid peaks.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

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.
static grid_ply((GXIMG)arg1, (GXPLY)arg2, (int)arg3) → None:
Get the grid edge in a PLY
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.0.

Note:

This will optionally refresh the grid boundary PLY and return
the PLY.

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

The grid PLY will be added to existing ploygons in the passed PLY.
static grid_ply_ex((GXIMG)arg1, (GXPLY)arg2, (int)arg3, (int)arg4) → None:
Get the grid edge in a PLY (with min points)
Parameters:
  • arg1 (geosoft.gxapi.GXIMG) – the IMG
  • arg2 (geosoft.gxapi.GXPLY) – PLY to which the bounding polygons will be added.
  • arg3 (int) – TRUE to force the boundary to be refreshed.
  • arg4 (int) – Minimum number of points in polygons refreshed (0 for all)
Returns:

Nothing

Return type:

None

New in version 5.1.6.

Note:

This will optionally refresh the grid boundary PLY and return
the PLY.

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

The grid PLY will be added to existing ploygons in the passed PLY.
static grid_reproject_and_window((str)arg1, (str)arg2, (GXIPJ)arg3, (float)arg4, (float)arg5, (float)arg6, (float)arg7) → None:
Create a new grid by reprojecting an existing grid and windowing its contents
Parameters:
  • arg1 (str) – Input grid filename
  • arg2 (str) – Output grid filename
  • arg3 (geosoft.gxapi.GXIPJ) – Output grid projection
  • arg4 (float) – Window minX (in output projection)
  • arg5 (float) – Window maxX (in output projection)
  • arg6 (float) – Window minY (in output projection)
  • arg7 (float) – Window maxY (in output projection)
Returns:

Nothing

Return type:

None

New in version 7.3.0.

static grid_resample((str)arg1, (str)arg2, (float)arg3, (float)arg4, (float)arg5, (float)arg6, (int)arg7, (int)arg8) → None:
Create a new grid by resampling an existing grid 
Parameters:
  • arg1 (str) – Input grid filename
  • arg2 (str) – Output grid filename
  • arg3 (float) – Origin X
  • arg4 (float) – Origin Y
  • arg5 (float) – cell spacing X
  • arg6 (float) – cell spacing Y
  • arg7 (int) – elements in X
  • arg8 (int) – elements in Y
Returns:

Nothing

Return type:

None

New in version 7.3.0.

Note:

Works only for un rotated grids.
static grid_resize((str)arg1, (str)arg2) → None:
Resize a grid to reduce the size not cover the outside dummies.
Parameters:
  • arg1 (str) – File name of input grid
  • arg2 (str) – File name of output grid
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static grid_shad((str)arg1, (str)arg2, (float_ref)arg3, (float_ref)arg4, (float_ref)arg5) → None:
Create a shadded relief image.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Pass GS_R8DM as parameters to obtain default values.
The default values are returned.
static grid_st((str)arg1, (GXST)arg2) → None:
Update an ST object using a grid.
Parameters:
  • arg1 (str) – grid name
  • arg2 (geosoft.gxapi.GXST) – ST (statistics) object to fill/update
Returns:

Nothing

Return type:

None

New in version 5.1.2.

Note:

The input ST object is not initialized by geosoft.gxapi.GXIMU.grid_st(),
so this function can be used to accumulate statistical
info on more than a single grid.
See ST.GXH.
static grid_stat((str)arg1, (int_ref)arg2, (int_ref)arg3, (int_ref)arg4, (float_ref)arg5, (float_ref)arg6, (int_ref)arg7, (float_ref)arg8, (float_ref)arg9, (float_ref)arg10, (float_ref)arg11, (float_ref)arg12) → None:
Reports statistics contained in a grid header.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Statistics are returned in the parameter set
static grid_stat_comp((str)arg1, (int_ref)arg2, (int_ref)arg3, (int_ref)arg4, (float_ref)arg5, (float_ref)arg6, (int_ref)arg7, (float_ref)arg8, (float_ref)arg9, (float_ref)arg10, (float_ref)arg11, (float_ref)arg12, (float_ref)arg13) → None:
Reports statistics contained in a grid header.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Statistics are returned in the parameter set
static grid_stat_ext((str)arg1, (int)arg2, (int_ref)arg3, (int_ref)arg4, (float_ref)arg5, (float_ref)arg6, (float_ref)arg7, (float_ref)arg8) → None:
Reports statistics of a grid's elements.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

If the IMU_STAT_FORCED constants value is set, the
statistics will be recalculated.
Statistics are returned in the parameter set.
static grid_stat_trend((str)arg1, (int_ref)arg2, (float_ref)arg3, (float_ref)arg4, (float_ref)arg5) → None:
Reports Trend Info of a grid (for first order coef only).
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Trend Info are returned in the parameter set
static grid_stat_trend_ext((str)arg1, (int_ref)arg2, (int_ref)arg3, (float_ref)arg4, (float_ref)arg5, (GXVM)arg6) → None:
Reports Extended Trend Info of a grid (for upto third order coef).
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Trend Info are returned in the parameter set
static grid_stitch((str)arg1, (str)arg2, (str)arg3, (int)arg4, (int)arg5, (int)arg6, (int)arg7, (float)arg8, (int)arg9, (int)arg10, (GXPLY)arg11, (float)arg12, (int)arg13) → None:
Stitches together too grids
Parameters:
  • arg1 (str) – Input Grid1 Name
  • arg2 (str) – Input Grid2 Name
  • arg3 (str) – Output Grid Name
  • arg4 (int) – Stitching Method
  • arg5 (int) – Grid 1 trend removal order
  • arg6 (int) – Grid 2 trend removal order
  • arg7 (int) – Trend removal type of points to use
  • arg8 (float) – Gap for interpolation
  • arg9 (int) – Interpolation spline method
  • arg10 (int) – Path selection
  • arg11 (geosoft.gxapi.GXPLY) – PLY object for user path
  • arg12 (float) – Correction weighting
  • arg13 (int) – width of corrections, in grid cells (8 to 256)
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static grid_stitch_ctl((str)arg1) → None:
Stitches together two grids - control file for options.
Parameters:arg1 (str) – Control file containing all “GRIDSTCH” parameters
Returns:Nothing
Return type:None

New in version 5.1.4.

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.
static grid_tiff((str)arg1, (str)arg2, (str)arg3, (int)arg4, (int)arg5, (int)arg6, (float)arg7, (int)arg8, (float)arg9) → None:
Generate a Tiff (Tagged-Image file format) file with up to 16 grids.
Parameters:
  • arg1 (str) – Comma-delimited string containing names of all grids to use in Tiff generation Up to 16 grids allowed.
  • arg2 (str) – Name of Tiff file to create
  • arg3 (str) – Background colour option. One of W (White) K (Black) C (Cyan) M (Magenta) Y (Yellow) R (Red) G (Green) B (Blue)
  • arg4 (int) – Background Red value (0-255)
  • arg5 (int) – Background Green (0-255)
  • arg6 (int) – Background Blue (0-255)
  • arg7 (float) – New cell size
  • arg8 (int) – Pixel size of registration marks
  • arg9 (float) – Map Scale
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The background colour can be either selected
from one of 8 settings, or can be specified
as a combination of Reg,Green, and Blue values.
static grid_trnd((GXIMG)arg1, (GXIMG)arg2, (int)arg3, (int)arg4, (int)arg5, (GXVM)arg6, (int)arg7) → None:
Remove a trend surface from a grid.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Both Images must be of type GS_DOUBLE.
The VM 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
static grid_trns((str)arg1, (int)arg2) → None:
Transpose a grid by swapping the grid rows with
the grid columns.
Parameters:
  • arg1 (str) – Name of the grid to transpose
  • arg2 (int) – Transpose condition value IMU_TRANS constants
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

If the grid has a line orientation that does NOT
match the IMU_TRANS constants value, this method will
not succeed.
static grid_type((str)arg1) → int:
Reports the true data the of a grid (geosoft types)
Parameters:arg1 (str) – Name of the Grid
Returns:GS_TYPES constants
Return type:int

New in version 5.0.0.

static grid_vd((GXIMG)arg1, (GXIMG)arg2) → None:
Apply vertical derivertive convolution filter to a grid.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static grid_vol((GXIMG)arg1, (float)arg2, (float)arg3, (float_ref)arg4, (float_ref)arg5, (float_ref)arg6) → None:
Calculates the grid volumes above and below a
reference base.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

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 IMG parameters MUST be of type GS_FLOAT!
If not, the method will terminate.
static grid_wind((GXIMG)arg1, (str)arg2, (int)arg3, (float)arg4, (float)arg5, (float)arg6, (float)arg7, (float)arg8, (float)arg9, (float)arg10, (int)arg11, (int)arg12, (str)arg13) → None:
Create a grid using a defined area window
within a larger grid.
Parameters:
  • arg1 (geosoft.gxapi.GXIMG) – Image of input grid
  • arg2 (str) – Name of output grid file
  • arg3 (int) – IMU_WIND_COORD constants
  • arg4 (float) – Min. limit of window in X direction (can be rDUMMY)
  • arg5 (float) – Max. limit of window in X direction (can be rDUMMY)
  • arg6 (float) – Min. limit of window in Y direction (can be rDUMMY)
  • arg7 (float) – Max. limit of window in Y direction (can be rDUMMY)
  • arg8 (float) – Minimum Z data value in output grid (can be rDUMMY)
  • arg9 (float) – Maximum Z data value in output grid (can be rDUMMY)
  • arg10 (float) – New grid cell size
  • arg11 (int) – IMU_WIND_DUMMIES constants
  • arg12 (int) – Decimation factor
  • arg13 (str) – Name of .MDF file for data clipping
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static grid_wind2((GXIMG)arg1, (str)arg2, (float)arg3, (float)arg4, (float)arg5, (float)arg6, (float)arg7, (float)arg8, (int)arg9) → None:
Window a grid.
Parameters:
  • arg1 (geosoft.gxapi.GXIMG) – Image of input grid
  • arg2 (str) – Name of output grid file
  • arg3 (float) – Minimum X, ground units (can be rDUMMY)
  • arg4 (float) – Maximum X (can be rDUMMY)
  • arg5 (float) – Minimum Y (can be rDUMMY)
  • arg6 (float) – Maximum Y (can be rDUMMY)
  • arg7 (float) – Minimum Z (can be rDUMMY)
  • arg8 (float) – Maximum Z (can be rDUMMY)
  • arg9 (int) – IMU_WIND_DUMMIES constants
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

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

The windowed grid will be adjusted/expanded to include the
defined area and line up on an even grid cell.
static grid_xyz((GXIMG)arg1, (str)arg2, (int)arg3, (int)arg4, (int)arg5, (int)arg6) → None:
Export a Grid image to an XYZ file.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

The IMG (image) of the grid to export must
be of type GS_FLOAT. If not, this method will
terminate with an error.
static make_mi_tab_file((str)arg1) → None:
Make a MapInfo tab file for this grid
Parameters:arg1 (str) – Grid file name
Returns:Nothing
Return type:None

New in version 5.1.6.

static make_mi_tabfrom_grid((str)arg1) → None:
Make a MapInfo tab file for this grid as rendered in a map
Parameters:arg1 (str) – Grid file name
Returns:Nothing
Return type:None

New in version 5.1.5.

static make_mi_tabfrom_map((str)arg1) → None:
Make a MapInfo tab file from this map
Parameters:arg1 (str) – Map file name
Returns:Nothing
Return type:None

New in version 5.1.5.

static mosaic((str)arg1, (str)arg2, (GXIPJ)arg3, (float)arg4) → GXIMG:
Create a mosaic image of an image list.
Parameters:
  • arg1 (str) – Image names (‘|‘ separated)
  • arg2 (str) – Output image name (“” for a memory only image)
  • arg3 (geosoft.gxapi.GXIPJ) – Projection to use (0 to use the first grid’s projection)
  • arg4 (float) – Cell size to use (rDummy to use first grid)
Returns:

IMG Object

Return type:

geosoft.gxapi.GXIMG

New in version 5.1.8.

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.
static peak_size((str)arg1, (GXVV)arg2, (GXVV)arg3, (int)arg4, (float)arg5, (GXVV)arg6) → None:
Define the sizes of all the peaks in an image.
Parameters:
  • arg1 (str) – Grid file name
  • arg2 (geosoft.gxapi.GXVV) – Peaks’ X
  • arg3 (geosoft.gxapi.GXVV) – Peaks’ Y
  • arg4 (int) – Maximum target diameter (window) in # of cells
  • arg5 (float) – Precision factor (see note above)
  • arg6 (geosoft.gxapi.GXVV) – Returned peak (anomaly) sizes in data units
Returns:

Nothing

Return type:

None

New in version 5.0.0.

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: geosoft.gxapi.GXIMU.peak_size2() is probably a better routine...
static peak_size2((str)arg1, (GXVV)arg2, (GXVV)arg3, (int)arg4, (GXVV)arg5) → None:
Define the sizes of all the peaks in an image - new algorithm
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.4.

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 geosoft.gxapi.GXIMU.peak_size().
static pigeon_hole((GXIMG)arg1, (GXVV)arg2, (GXVV)arg3, (int_ref)arg4) → None:
Pigeon-hole and count points by location into a grid.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.8.

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.
static profile((GXIMG)arg1, (float)arg2, (float)arg3, (float)arg4, (float)arg5, (float)arg6, (GXVV)arg7) → None:
Extract a profile from a grid.
Parameters:
  • arg1 (geosoft.gxapi.GXIMG) – input image
  • arg2 (float) – X1
  • arg3 (float) – Y1
  • arg4 (float) – X2
  • arg5 (float) – Y2
  • arg6 (float) – sample separation, if 0.0, use grid cell size
  • arg7 (geosoft.gxapi.GXVV) – VV in which to place result
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

Returned VV will start at X1,Y1 and will sample
up to X2,Y2 at the specified separation.
static profile_vv((GXIMG)arg1, (GXVV)arg2, (GXVV)arg3, (GXVV)arg4) → None:
Extract a VV profile from a grid.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

See also

iGetPolyLine_DBE

static range_grids((str)arg1, (GXIPJ)arg2, (float_ref)arg3, (float_ref)arg4, (float_ref)arg5, (float_ref)arg6) → None:
Determine bounding rectangle for a set of grids
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.8.

Note:

If an IPJ is IPJ_CS_UNKNOWN, the
IPJ of the first grid in the list will be used and
the IPJ will be returned in this setting.
Otherwise, the range in the requested IPJ will be
determined.
static range_ll((GXIMG)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4, (float_ref)arg5) → None:
Determine the range in lat. and long. of a projected grid
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

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 IPJ object, or if the Source Type of
the IPJ is not IPJ_TYPE_PCS (projected coordinate system), then the
returned values are dummies (GS_R8DM).
static slope_standard_deviation((GXIMG)arg1) → float:
Return the standard deviation of the slopes.
Parameters:arg1 (geosoft.gxapi.GXIMG) – Grid object
Returns:Standard devation of grid slopes
Return type:float

New in version 8.2.0.

Note:

This method calculates the standard dev. 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.
static stat_window((GXIMG)arg1, (float)arg2, (float)arg3, (float)arg4, (float)arg5, (int)arg6, (GXST)arg7) → None:
Calculate grid statistics in a window
Parameters:
  • arg1 (geosoft.gxapi.GXIMG) – Name of the grid to get stats from
  • arg2 (float) – min X window
  • arg3 (float) – min Y window
  • arg4 (float) – max X window
  • arg5 (float) – max Y window
  • arg6 (int) – maximum values needed, 0 for all
  • arg7 (geosoft.gxapi.GXST) – ST object, stats are accumulated
Returns:

Nothing

Return type:

None

New in version 5.0.5.

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.
static update_ply((GXIMG)arg1, (GXPLY)arg2) → None:
Update the grid boundary in the grid metadata
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.2.0.

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
PLY before it is placed back in the IMG.

IMU_BOOL_OLAP constants

Overlapping area option
gxapi.IMU_BOOL_OLAP_AVE = 0
Overlap values are averaged
gxapi.IMU_BOOL_OLAP_1 = 1
Overlap values use grid 1 value
gxapi.IMU_BOOL_OLAP_2 = 2
Overlap values use grid 2 value

IMU_BOOL_OPT constants

Boolean logic option
gxapi.IMU_BOOL_OPT_AND = 0
Valid areas are only where grids overlap
gxapi.IMU_BOOL_OPT_OR = 1
Valid areas are where either grid is a valid value
gxapi.IMU_BOOL_OPT_XOR = 2
Overlap areas are dummied

IMU_BOOL_SIZING constants

Sizing option
gxapi.IMU_BOOL_SIZING_MIN = 0
Output grid is sized to overlapping region
gxapi.IMU_BOOL_SIZING_0 = 1
Output grid is sized to grid 1
gxapi.IMU_BOOL_SIZING_1 = 2
Output grid is sized to grid 2
gxapi.IMU_BOOL_SIZING_MAX = 3
Output grid is sized to maximum combined area of both grids

IMU_DOUBLE_CRC_BITS constants

Bits to use in double CRC's
gxapi.IMU_DOUBLE_CRC_BITS_EXACT = 0
Exact CRC
gxapi.IMU_DOUBLE_CRC_BITS_DEFAULT = 10
Default inaccuracy in double (10 Bits)
gxapi.IMU_DOUBLE_CRC_BITS_MAX = 51
Maximum number of inaccuracy bits (51 Bits)

IMU_EXPAND_SHAPE constants

Shape of output grid
gxapi.IMU_EXPAND_SHAPE_RECTANGLE = 0
gxapi.IMU_EXPAND_SHAPE_SQUARE = 1

IMU_FILL_ROLLOPT constants

Defines for Grid Filling Method Options
gxapi.IMU_FILL_ROLLOPT_LINEAR = 1
gxapi.IMU_FILL_ROLLOPT_SQUARE = 2

IMU_FILT_DUMMY constants

Settings for placing dummy values in grid if any of filter
values are dummy
gxapi.IMU_FILT_DUMMY_NO = 0
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
gxapi.IMU_FILT_FILE_NO = 0
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)
gxapi.IMU_FILT_HZDRV_NO = 0
gxapi.IMU_FILT_HZDRV_X = 1
gxapi.IMU_FILT_HZDRV_Y = 2

IMU_FLOAT_CRC_BITS constants

Bits to use in float CRC's
gxapi.IMU_FLOAT_CRC_BITS_EXACT = 0
Exact CRC
gxapi.IMU_FLOAT_CRC_BITS_DEFAULT = 7
Default inaccuracy in floats (7 Bits)
gxapi.IMU_FLOAT_CRC_BITS_MAX = 22
Maximum number of inaccuracy bits (22 Bits)

IMU_MASK constants

Defined options for masking grids
gxapi.IMU_MASK_INSIDE = 0
gxapi.IMU_MASK_OUTSIDE = 1

IMU_STAT_FORCED constants

Defined options for forcing recalculating the grid values
gxapi.IMU_STAT_FORCED_NO = 0
gxapi.IMU_STAT_FORCED_YES = 1

IMU_TRANS constants

Transpose Options available for \ :func:`geosoft.gxapi.GXIMU.grid_trns`\
implies original grid lines:
gxapi.IMU_TRANS_DEFAULT = 0
can be ANY orientation
gxapi.IMU_TRANS_Y = 1
MUST be parallel to Y-Axis
gxapi.IMU_TRANS_X = -1
MUST be parallel to X-Axis

IMU_TREND constants

Points in grid to use
gxapi.IMU_TREND_ALL = 0
gxapi.IMU_TREND_EDGE = 1

IMU_WIND_COORD constants

Output grid coordinate units
gxapi.IMU_WIND_GRID = 0
gxapi.IMU_WIND_GROUND = 1

IMU_WIND_DUMMIES constants

Option for handling out-of-range Z values
gxapi.IMU_WIND_DUMMY = 0
gxapi.IMU_WIND_CLIP = 1

IMU_XYZ_INDEX constants

Flags whether to use grid index numbers as
station numbers.
gxapi.IMU_XYZ_INDEX_NO = 0
gxapi.IMU_XYZ_INDEX_YES = 1

IMU_XYZ_LABEL constants

XYZ Label Flags
gxapi.IMU_XYZ_LABEL_NO = 1
gxapi.IMU_XYZ_LABEL_YES = 0