GXIMU class¶
-
class
GXIMU
(handle=0)¶ GXIMU class.
Not a class. This is a catch-all group of functions working on
GXIMG
objects (seeGXIMG
). 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: 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: - img (GXIMG) – Input image
- 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
(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: - grid (str) – Grid
- pul_crc (int) – Starting CRC (use
CRC_INIT_VALUE
if none) - float_bits (int) – IMU_FLOAT_CRC_BITS constants
- double_bits (int) – IMU_DOUBLE_CRC_BITS constants
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: - img (GXIMG) – Input image
- pul_crc (int) – Starting CRC (use
CRC_INIT_VALUE
if none) - float_bits (int) – IMU_FLOAT_CRC_BITS constants
- double_bits (int) – IMU_DOUBLE_CRC_BITS constants
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: New in version 7.0.
License: Geosoft End-User License
-
classmethod
export_xml
(img, crc, file)¶ Export a Grid as an XML file.
Parameters: 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: 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.
- Same as
-
classmethod
get_zvv
(img, vv_x, vv_y, vv_z)¶ Extract an interpolated image value for given XY
GXVV
locationsParameters: 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: New in version 5.0.
License: Geosoft End-User License
Note: The
GXIMG
parameters MUST be of typeGS_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: New in version 5.0.
License: Geosoft End-User License
Note: The
GXIMG
parameters MUST be of typeGS_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: - img1 (GXIMG) – Image of first input grid
- img2 (GXIMG) – Image of second input grid
- out (str) – File name of output grid
- bool (int) – IMU_BOOL_OPT constants
- sizing (int) – IMU_BOOL_SIZING constants
- olap (int) – IMU_BOOL_OLAP constants
New in version 5.0.
License: Geosoft End-User License
Note: The
GXIMG
parameters must be of typeGS_DOUBLE
! If not, the method will terminate.
-
classmethod
grid_edge
(grid, vv_x, vv_y)¶ Get grid edge points
Parameters: New in version 5.0.
License: Geosoft End-User License
-
classmethod
grid_edge_ply
(img, ply, min_points)¶ Get grid edge points
Parameters: 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 theGXPLY
.
-
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 typeGS_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 typeGS_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 typeGS_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 typeGS_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: 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: New in version 5.1.
License: Geosoft End-User License
Note: This will optionally refresh the grid boundary
GXPLY
and return theGXPLY
.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 passedGXPLY
.
-
classmethod
grid_ply_ex
(img, ply, refresh, min_points)¶ Get the grid edge in a
GXPLY
(with min points)Parameters: New in version 5.1.6.
License: Geosoft End-User License
Note: This will optionally refresh the grid boundary
GXPLY
and return theGXPLY
.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 passedGXPLY
.
-
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: 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: New in version 5.1.2.
License: Geosoft End-User License
Note: The input
GXST
object is not initialized bygrid_st
, so this function can be used to accumulate statistical info on more than a single grid. SeeGXST
.
-
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: - grid (str) – Name of the grid to get stats from
- force (int) – IMU_STAT_FORCED constants
- items (int_ref) – Number of valid elements in grid
- dums (int_ref) – Number of dummies in grid
- min (float_ref) – Minimum grid value
- max (float_ref) – Maximum grid value
- mean (float_ref) – Grid mean
- stddev (float_ref) – Grid standard deviation
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: 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: 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
. TheGXVM
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: 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: 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 typeGS_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 callingThe 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: - img (GXIMG) – Image of the grid to export
- xyz (str) – Name of new XYZ file
- index (int) – IMU_XYZ_INDEX constants
- dec_x (int) – X direction decimation factor
- dec_y (int) – Y direction decimation factor
- lab (int) – IMU_XYZ_LABEL constants
New in version 5.0.
License: Geosoft End-User License
Note: The
GXIMG
(image) of the grid to export must be of typeGS_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
ObjectReturn type: 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
peak_size
(grid, vv_x, vv_y, max, prec, v_vz)¶ Define the sizes of all the peaks in an image.
Parameters: 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: 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: 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: 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: 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: New in version 5.1.8.
License: Geosoft End-User License
Note: If an
GXIPJ
is IPJ_CS_UNKNOWN, theGXIPJ
of the first grid in the list will be used and theGXIPJ
will be returned in this setting. Otherwise, the range in the requestedGXIPJ
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 theGXIPJ
is notIPJ_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: 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: 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 theGXIMG
.
-
classmethod
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
-