Skip to content

Commit 256cbf2

Browse files
authored
Update documentation for ROI and stats (#676)
1 parent 0b878cf commit 256cbf2

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

dev-environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
- tqdm
1414
- scikit-image=0.*
1515
- scikit-gstat>=1.0.18,<1.1
16-
- geoutils=0.1.12
16+
- geoutils=0.1.13
1717
- affine
1818
- pandas
1919
- pyogrio

doc/source/dem_class.md

+22
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,23 @@ slope.plot(cmap="Reds", cbar_title="Slope (°)")
136136
For the full list of terrain attributes, see the {ref}`terrain-attributes` page.
137137
```
138138

139+
## Statistics
140+
The [`get_stats()`](https://geoutils.readthedocs.io/en/latest/gen_modules/geoutils.Raster.get_stats.html) method allows to extract key statistical information from a raster in a dictionary.
141+
142+
- Get all statistics in a dict:
143+
```{code-cell} ipython3
144+
dem.get_stats()
145+
```
146+
147+
The DEM statistics functionalities in `xdem` are based on those in `geoutils`.
148+
For more information on computing statistics, please refer to the [`geoutils` documentation](https://geoutils.readthedocs.io/en/latest/raster_class.html#obtain-statistics).
149+
150+
151+
Note: as [`get_stats()`](https://geoutils.readthedocs.io/en/latest/gen_modules/geoutils.Raster.get_stats.html) is a raster method, it can also be used for terrain attributes:
152+
```{code-cell} ipython3
153+
slope.get_stats()
154+
```
155+
139156
## Coregistration
140157

141158
3D coregistration is performed with {func}`~xdem.DEM.coregister_3d`, which aligns the
@@ -182,3 +199,8 @@ We use `random_state` to ensure a fixed randomized output. It is **only necessar
182199
183200
For more details on quantifying random and structured errors, see the {ref}`uncertainty` page.
184201
```
202+
203+
## Cropping a DEM
204+
205+
The DEM cropping functionalities in `xdem` are based on those in `geoutils` ([`crop()`](https://geoutils.readthedocs.io/en/latest/gen_modules/geoutils.Raster.crop.html#geoutils.Raster.crop), [`icrop()`](https://geoutils.readthedocs.io/en/latest/gen_modules/geoutils.Raster.icrop.html#geoutils.Raster.icrop)).
206+
For more information on using cropping functions, please refer to the [`geoutils` documentation](https://geoutils.readthedocs.io/en/latest/raster_class.html#crop).

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
- tqdm
1414
- scikit-image=0.*
1515
- scikit-gstat>=1.0.18,<1.1
16-
- geoutils=0.1.12
16+
- geoutils=0.1.13
1717
- pip
1818
- affine
1919
- pandas

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ scipy==1.*
1111
tqdm
1212
scikit-image==0.*
1313
scikit-gstat>=1.0.18,<1.1
14-
geoutils==0.1.12
14+
geoutils==0.1.13
1515
pip
1616
affine
1717
pandas

xdem/dem.py

+1
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def from_array(
209209
compatible. If False, will raise an error when incompatible.
210210
:param vcrs: Vertical coordinate reference system.
211211
212+
212213
:returns: DEM created from the provided array and georeferencing.
213214
"""
214215
# We first apply the from_array of the parent class

0 commit comments

Comments
 (0)