Bias-correction with deramping

Bias-correction with deramping#

Deramping can help correct rotational or doming errors in elevation data. In xDEM, this approach is implemented through the xdem.coreg.Deramp class.

See also the Deramping section in feature pages.

import geoutils as gu
import numpy as np

import xdem

We open example files.

reference_dem = xdem.DEM(xdem.examples.get_path("longyearbyen_ref_dem"))
dem_to_be_aligned = xdem.DEM(xdem.examples.get_path("longyearbyen_tba_dem"))
glacier_outlines = gu.Vector(xdem.examples.get_path("longyearbyen_glacier_outlines"))

# Create a stable ground mask (not glacierized) to mark "inlier data"
inlier_mask = ~glacier_outlines.create_mask(reference_dem)

We visualize the patterns of error from the elevation differences.

diff_before = reference_dem - dem_to_be_aligned
diff_before.plot(cmap="RdYlBu", vmin=-10, vmax=10, cbar_title="Elevation differences (m)")
plot deramp

A 2-D 3rd order polynomial is estimated, and applied to the data:

Then, the new difference can be plotted.

diff_after = reference_dem - corrected_dem
diff_after.plot(cmap="RdYlBu", vmin=-10, vmax=10, cbar_title="Elevation differences (m)")
plot deramp

We compare the median and NMAD to validate numerically that there was an improvement (see Measures of central tendency and dispersion):

Error before: median = -2.33 - NMAD = 3.42 m
Error after: median = -0.20 - NMAD = 2.91 m

Total running time of the script: (0 minutes 3.479 seconds)

Gallery generated by Sphinx-Gallery