From 9281f8d8d89571071ae25b02f80f95ccabcf3eb9 Mon Sep 17 00:00:00 2001 From: Romain Hugonnet Date: Mon, 18 Mar 2024 23:22:10 -0800 Subject: [PATCH] Finalize minor improvements --- examples/basic/plot_dem_subtraction.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/basic/plot_dem_subtraction.py b/examples/basic/plot_dem_subtraction.py index eb0448da..ee158338 100644 --- a/examples/basic/plot_dem_subtraction.py +++ b/examples/basic/plot_dem_subtraction.py @@ -4,7 +4,7 @@ Subtracting a DEM with another one should be easy. -xDEM allows to use any operator on :class:`xdem.DEM` objects, such as :func:`+` or :func:``-`` as well as most NumPy functions +xDEM allows to use any operator on :class:`xdem.DEM` objects, such as :func:`+` or :func:`-` as well as most NumPy functions while respecting nodata values and checking that georeferencing is consistent. This functionality is inherited from `GeoUtils' Raster class `_. Before DEMs can be compared, they need to be reprojected to the same grid and have the same 3D CRSs. The :func:`geoutils.Raster.reproject` and :func:`xdem.DEM.to_vcrs` methods are used for this. @@ -50,6 +50,7 @@ # Load the outlines glacier_outlines = gu.Vector(xdem.examples.get_path("longyearbyen_glacier_outlines")) +glacier_outlines = glacier_outlines.crop(ddem, clip=True) ddem.plot(cmap="coolwarm_r", vmin=-20, vmax=20, cbar_title="Elevation change (m)") glacier_outlines.plot(ref_crs=ddem, fc="none", ec="k")