Modify Trend

Use the Grid and Image > Filters > Trend menu option (GRIDTRND GX) to remove a trend surface from a grid or add a trend back in.

Modify Trend dialog options

Input grid

Name of input grid file.

Script Parameter: GRIDTRND.GRDIN

Output grid

Name of output grid after adding or removing the trend.

Script Parameter: GRIDTRND.GRDOUT

Trend action

Define if you would like to remove a trend from the supplied grid or add trend back from grid header (replace a previously removed trend back into the grid).

If you are replacing a trend, and the grid header carries the polynomial coefficients previously calculated, the Trend order and Polynomial coefficients entries are ignored.

Script Parameter: GRIDTRND.REPLACE

Points to use

Points to use for removing a trend: "EDGE" points only or "ALL" points. The default is "EDGE".

Script Parameter: GRIDTRND.POINTS

Trend order

Order of trend to remove: 0,1,2, or 3. (Default is 1.)

Script Parameter: GRIDTRND.ORDER

Polynomial coefficients

Coefficients of the polynomial. If left blank, the coefficients are calculated. If supplied, they take precedence and the coefficients will not be calculated. This is a comma-delimited string of up to ten real numbers (see Application Notes below).

Script Parameter: GRIDTRND.COEFF

Application Notes

If any coefficients are specified, there must be a correct number of coefficients depending on the Trend order specified. On the other hand, if the Trend order parameter is blank, it will default to the number supporting the supplied number of coefficients.

The GRIDTRND GX removes up to a third order trend surface from a grid. The trend surface may be user defined or calculated by least squares fitting to all the values in the grid or to only the values along the edge of the grid. GRIDTRND may also be used to replace a previously removed first or zero order trend.

GRIDTRND can be useful for removing regional trends and gradients. It is also a fast way to remove a strong gradient, such as an IGRF approximation.

It is often a good idea to remove a trend before MAGMAP processing. The information defined by low order trends cannot usually be handled well in the frequency domain because of the coarse low wave number resolution.

GRIDTRND may also be used to add or subtract a base level from grids.

If a zero or first order trend is removed, the trend coefficients are stored in the first three elements of the user area in the grid header. The -GS_R4DM is also stored in the 4th element of the user area. To make a grid of the trend that was removed, subtract the resultant grid from the original grid using GRIDADD.

GRIDTRND will also produce a report and save it in a file named '<outputgrid>_Coefficient.txt'. This file lists the order of the polynomial along with the coefficients.