Skip to content

Commit

Permalink
docs: add dem_coregistration function in doc
Browse files Browse the repository at this point in the history
  • Loading branch information
vschaffn committed Nov 22, 2024
1 parent d5e4602 commit d31d074
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions doc/source/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,14 @@ To build and pass your coregistration pipeline to {func}`~xdem.DEM.coregister_3d
coreg.Coreg.meta
```

#### Quick coregistration
```{eval-rst}
.. autosummary::
:toctree: gen_modules/
coreg.workflows.dem_coregistration
```

### Affine coregistration

#### Parent object (to define custom methods)
Expand Down
9 changes: 8 additions & 1 deletion doc/source/coregistration.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ my_coreg_pipeline = xdem.coreg.ICP() + xdem.coreg.NuthKaab()
my_coreg_pipeline = xdem.coreg.NuthKaab()
```

Then, coregistering a pair of elevation data can be done by calling {func}`xdem.DEM.coregister_3d` from the DEM that should be aligned.
Then, coregistering a pair of elevation data can be done by calling {func}`xdem.coreg.workflows.dem_coregistration`, or
{func}`xdem.DEM.coregister_3d` from the DEM that should be aligned.

```{code-cell} ipython3
:tags: [hide-cell]
Expand All @@ -66,12 +67,18 @@ Then, coregistering a pair of elevation data can be done by calling {func}`xdem.
import geoutils as gu
import numpy as np
import matplotlib.pyplot as plt
from xdem.coreg.workflows import dem_coregistration
# Open a reference and to-be-aligned DEM
ref_dem = xdem.DEM(xdem.examples.get_path("longyearbyen_ref_dem"))
tba_dem = xdem.DEM(xdem.examples.get_path("longyearbyen_tba_dem"))
```

```{code-cell} ipython3
# Coregister by calling the dem_coregistration function
aligned_dem = dem_coregistration(tba_dem, ref_dem, coreg_method=my_coreg_pipeline)
```

```{code-cell} ipython3
# Coregister by calling the DEM method
aligned_dem = tba_dem.coregister_3d(ref_dem, my_coreg_pipeline)
Expand Down

0 comments on commit d31d074

Please sign in to comment.