Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SlideRule example #608

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Linting
  • Loading branch information
rhugonnet committed Dec 5, 2024
commit 9add285aa051cf74d99732e72668ef300d9039c4
8 changes: 4 additions & 4 deletions doc/source/sliderule.md
Original file line number Diff line number Diff line change
@@ -16,10 +16,10 @@ kernelspec:

# Pair with SlideRule for reference

Most analysis of **xDEM relies on independent, high-precision elevation data to use as reference**, whether for
Most analysis of **xDEM relies on independent, high-precision elevation data to use as reference**, whether for
coregistration, bias-corrections or uncertainty analysis.

[SlideRule](https://slideruleearth.io/) provides the ideal way to retrieve such data by accessing big data archives
[SlideRule](https://slideruleearth.io/) provides the ideal way to retrieve such data by accessing big data archives
of high-precision elevations, such as ICESat-2 or GEDI, efficiently in the cloud.

Below, a short example to coregister and perform uncertainty analysis of a DEM with ICESat-2 ATL06.
@@ -53,7 +53,7 @@ inlier_mask = ~glacier_outlines.create_mask(dem)
bounds = list(dem.get_bounds_projected(4326))
region = sliderule.toregion(bounds)["poly"]

# Initiliaze SlideRule client
# Initialize SlideRule client
sliderule.init("slideruleearth.io")

# Define desired parameters for ICESat-2 ATL06
@@ -109,4 +109,4 @@ vect.plot(column="dh_aft", cmap='RdYlBu', vmin=-10, vmax=10, ax=ax[1], markersiz
_ = ax[1].set_yticklabels([])
plt.tight_layout()
plt.savefig("/home/atom/ongoing/test.png", dpi=400)
```
```
4 changes: 2 additions & 2 deletions xdem/dem.py
Original file line number Diff line number Diff line change
@@ -490,7 +490,7 @@ def coregister_3d(
def estimate_uncertainty(
self,
other_elev: DEM | gpd.GeoDataFrame,
stable_terrain: Mask | NDArrayb = None,
stable_terrain: Mask = None,
approach: Literal["H2022", "R2009", "Basic"] = "H2022",
precision_of_other: Literal["finer"] | Literal["same"] = "finer",
spread_estimator: Callable[[NDArrayf], np.floating[Any]] = nmad,
@@ -542,7 +542,7 @@ def estimate_uncertainty(

# Stable terrain depending on input
if stable_terrain is None:
stable_terrain = np.ones(self.shape, dtype="uint8")
stable_terrain = self.copy(new_array=np.ones(self.shape, dtype=bool))

# Elevation change with the other DEM or elevation point cloud
if isinstance(other_elev, DEM):
Loading