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#
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#
Plotting a DEM#
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:
|
Vertical translation alignment. |
|
Nuth and Kääb (2011) coregistration, https://doi.org/10.5194/tc-5-271-2011. |
|
Iterative closest point registration, based on Besl and McKay (1992), https://doi.org/10.1117/12.57955. |
|
Tilt alignment. |
Bias-correction (including non-affine coregistration) methods#
Generic parent class:
|
Bias-correction (non-rigid alignment) simultaneously with any number and type of variables. |
Convenience classes for specific corrections:
|
Correct for a 2D polynomial along X/Y coordinates, for example from residual camera model deformations (dome-like errors). |
|
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 |