Comments (3)
Related shape issue at line https://github.com/GlacioHack/DemUtils/blob/95cf00be26499b09830e300f273d25ceef4a3b57/DemUtils/coreg.py#L207
from xdem.
Here is a quick fix, but I believe the issue should be analyzed more in depth:
diff --git a/DemUtils/coreg.py b/DemUtils/coreg.py
index acb58ea..8a18852 100644
--- a/DemUtils/coreg.py
+++ b/DemUtils/coreg.py
@@ -626,7 +626,7 @@ class Coregistration:
intersection = reference_raster.intersection(to_be_aligned_raster)
bounds = dict(zip(["west", "south", "east", "north"], intersection))
- resolution = (bounds["east"] - bounds["west"]) / reference_raster.data.shape[1]
+ resolution = (bounds["east"] - bounds["west"]) / reference_raster.data.shape[2]
# TODO: Read the to_be_aligned_dem from the actual to_be_aligned_raster and not its filename
# TODO: The above leads to highly surprising results sometimes if the raster had been modified from its file.
@@ -639,7 +639,7 @@ class Coregistration:
# Align the raster using the selected method. This returns a numpy array and the corresponding error
aligned_dem, error = self.method( # type: ignore
- reference_dem=reference_raster.data,
+ reference_dem=reference_raster.data.squeeze(),
dem_to_be_aligned=to_be_aligned_dem,
bounds=bounds,
crs=reference_raster.crs
from xdem.
All suggestions have been taken into account for as of commit 36dbf5b
from xdem.
Related Issues (20)
- Remove legacy NumPy random number generator
- Clarify which angle is needed for DirectionalBias HOT 1
- Add function `Coreg.run()` or `Coreg.fit_and_apply()` to run both `fit()` and `apply()` steps simultaneously
- Remove classes `Bias1D`, `Bias2D` in favor of a `nd` argument defined on instantiation?
- Make `DEM.to_vcrs()` not inplace by default
- Improve `fit.robust_nfreq_sumsin_fit()` with fast fourier transform?
- Fix error with `robust_nfreq_sumsin_fit()` in CI
- Coverage error in CI HOT 1
- Unpin `coverage<7` in CI once `coveragepy-lcov` fixed
- Test in `test_biascorr` fails randomly with optimizer error
- Collect references of projects using xdem HOT 1
- Update coreg examples to use `fit_and_apply`
- Homogenize typing between xDEM and GeoUtils
- Speed-up tests of pipeline combinations using `subsample` with `random_state`
- Test `Coreg` module with `DEM` inputs instead of `Raster`
- Generalize `scipy.interpolate.RectBivariateSpline` into any regular grid interpolator in `NuthKaab` for consistent package-wide resampling
- Optimize coregistration module performance for Xarray/Raster objects
- Improve 1d binning plots HOT 2
- Bug with raster-point coregistration HOT 1
- Rename `Coreg.meta` into a clearer naming before documenting it
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xdem.