The data obtained from SPM microscopes are very often not leveled at all; the microscope directly outputs raw data values computed from piezoscanner voltage, strain gauge, interferometer or other detection system values. This way of exporting data enables the user to choose his/her own method of leveling data.
The choice of leveling method should be based on your SPM system configuration. Basically, for systems with independent scanner(s) for each axis, plane leveling should be sufficient. For systems with scanner(s) moving in all three axes (tube scanners) 2nd order polynomial leveling should be used.
Of course, you can use higher order leveling for any data, however, this can supress real features on the surface (namely waviness of the surface) and therefore alter the statistical functions and quantities evaluated from the surface.
→ →
→ →
The simplest modules that are connected with data leveling are Fix Zero and Zero Mean Value that simply set the average height of the data to put the minimum to zero (Fix Zero) or mean value to zero (Zero Mean Value).
→ →
Plane leveling is usually one of the first functions applied to raw SPM data. The plane is computed from all the image points and is subtracted from the data.
The Three Point Leveling tool can be used for leveling very complicated surface structures. The user can simply mark three points in the image that should be at the same level, and then click . The plane is computed from these three points and is subtracted from the data.
The Path Leveling tool can be used to correct the heights in an arbitrary subset of rows in complicated images.
First, one selects a number of straight lines on the data. The intersections of these lines with the rows then form a set of points in each row that is used for leveling. The rows are moved up or down to minimize the difference between the heights of the points of adjacent rows. Rows that are not intersected by any line are not moved (relatively to neighbouring rows).
Figure 4.5. Path Level example: (a) uncorrected data with steps that the automated method may fail to correct, two suitable leveling lines are selected; (b) the result of Path Level application with line width 5.

→ →
Facet Level levels data by subtracting a plane like the standard Plane Level function does. However, the plane is determined differently: it makes facets of the surface as horizontal as possible. Thus for surfaces with flat horizontal areas it leads to much better results than the standard Plane Level. On the other hand, for random surfaces, it can behave much worse.
Figure 4.6. Facet Level example: (a) uncorrected, sloping data; (b) data leveled by standard plane fitting (Plane Level); (c) data leveled by Facet Level.

→ →
Level Rotate behaves similarly to Plane Level, however it does not simply subtract the fitted plane from the data. Instead, this module takes the fitted plane parameters and rotates the image data by a calculated amount to make it lie in a plane. So unlike Plane Level, this module should therefore preserve angle data in the image.
Gwyddion has several special modules for background subtraction. All allow you to extract the subtracted background to a separate data window.
→ →
Fits data by a polynomial of the given order and subtracts this polynomial. In the Independent degree mode the horizontal and vertical polynomial orders can be generally set separately, i.e. the fitted polynomial is
where m and n are the selected horizontal and vertical polynomial degrees, respectively. In the Limited total degree mode the fitted polynomial is
where n is the selected total polynomial degree.
→ →
Revolves virtual 'arc' of given radius horizontally or vertically over (or under) the data. The envelope of this arc is treated as a background, resulting in removal of features larger than the arc radius (approximately).