API reference#
This page provides a summary of xDEM’s API. For more details and examples, refer to the relevant chapters in the main part of the documentation.
Examples using xdem.DEM
#
Iterative closest point coregistration
Spatial propagation of elevation errors
Bias correction with deramping
Working with a collection of DEMs
Normalized regional hypsometric interpolation
Estimation and modelling of spatial variograms
Estimation and modelling of heteroscedasticity
Standardization for stable terrain as error proxy
DEM#
Important
A DEM
inherits all raster methods and attributes from the Raster
object of GeoUtils.
Below, we only repeat the core attributes and methods of GeoUtils, see
the Raster API in GeoUtils for the full list.
Opening or saving a DEM#
|
The digital elevation model. |
|
Print summary information about the raster. |
|
Write the raster to file. |
Plotting a DEM#
|
The digital elevation model. |
|
Plot the raster, with axes in projection of image. |
Create from an array#
|
Create a DEM from a numpy array and the georeferencing information. |
Unique attributes#
Inherited from Raster
#
Array of the raster. |
|
Coordinate reference system of the raster. |
|
Geotransform of the raster. |
|
Nodata value of the raster. |
Specific to DEM
#
Vertical coordinate reference system of the DEM. |
Georeferencing#
Inherited from Raster
#
|
Reproject raster to a different geotransform (resolution, bounds) and/or coordinate reference system (CRS). |
|
Crop the raster to a given extent. |
Vertical referencing for DEM
#
|
Set the vertical coordinate reference system of the DEM. |
|
Convert the DEM to another vertical coordinate reference system. |
Raster-vector interface#
Note
See the full list of vector methods in GeoUtils’ documentation.
|
Polygonize the raster into a vector. |
|
Compute proximity distances to the raster target pixels, or to a vector geometry on the raster grid. |
Coregistration#
Tip
To build and pass your coregistration pipeline to coregister_3d()
, see the API of Coreg.
|
Coregister DEM to a reference DEM in three dimensions. |
Terrain attributes#
|
Generate a slope map for a DEM, returned in degrees by default. |
|
Calculate the aspect of each cell in a DEM, returned in degrees by default. |
|
Generate a hillshade from the given DEM. |
|
Calculate the terrain curvature (second derivative of elevation) in m-1 multiplied by 100. |
|
Calculate the terrain curvature parallel to the direction of the slope in m-1 multiplied by 100. |
|
Calculate the terrain curvature perpendicular to the direction of the slope in m-1 multiplied by 100. |
|
Calculate the signed maximum profile or planform curvature parallel to the direction of the slope in m-1 multiplied by 100. |
|
Calculates the Topographic Position Index, the difference to the average of neighbouring pixels. |
|
Calculates the Terrain Ruggedness Index, the cumulated differences to neighbouring pixels. |
|
Calculates the roughness, the maximum difference between neighbouring pixels, for any window size. |
Calculates the rugosity, the ratio between real area and planimetric area. |
|
|
Calculates the fractal roughness, the local 3D fractal dimension. |
dDEM#
|
A difference-DEM object. |
DEMCollection#
dDEM#
|
A temporal collection of DEMs. |
Coreg#
Overview of co-registration class structure:
Coregistration, pipeline and blockwise#
|
Generic co-registration processing class. |
|
A sequential set of co-registration processing steps. |
|
Block-wise co-registration processing class to run a step in segmented parts of the grid. |
Fitting and applying transforms#
|
Estimate the coregistration transform on the given DEMs. |
|
Apply the estimated transform to a DEM. |
Other functionalities#
|
Calculate the residual offsets (the difference) between two DEMs after applying the transformation. |
Affine coregistration methods#
Generic parent class:
|
Generic affine coregistration class. |
Convenience classes for specific coregistrations:
|
DEM vertical shift correction. |
|
Nuth and Kääb (2011) DEM coregistration: iterative registration of horizontal and vertical shift using slope/aspect. |
|
Iterative Closest Point DEM coregistration. |
|
DEM tilting. |
Bias-correction (including non-affine coregistration) methods#
Generic parent class:
|
Parent class of bias correction methods: non-rigid coregistrations. |
Classes for any 1-, 2- and N-D biases:
|
Bias-correction along a single variable (e.g., angle, terrain attribute). |
|
Bias-correction along two variables (e.g., X/Y coordinates, slope and curvature simultaneously). |
|
Bias-correction along N variables (e.g., simultaneously slope, curvature, aspect and elevation). |
Convenience classes for specific corrections:
|
Correct for a 2D polynomial along X/Y coordinates, for example from residual camera model deformations. |
|
Bias correction for directional biases, for example along- or across-track of satellite angle. |
|
Correct a bias according to terrain, such as elevation or curvature. |
Terrain attributes#
Terrain attribute calculations, such as slope, aspect, hillshade, curvature and ruggedness indexes. |
Volume integration methods#
Volume change calculation tools (aimed for glaciers). |
Fitting methods#
Functions to perform normal, weighted and robust fitting. |
Filtering methods#
Filters to remove outliers and reduce noise in DEMs. |
Spatial statistics methods#
Spatial statistical tools to estimate uncertainties related to DEMs |