Amaury Dehecq
Amaury Dehecq
A simple solution is to replace the whole _apply_matrix method by something like this: ``` dem_to_be_aligned_copy = dem_to_be_aligned.copy() dem_to_be_aligned_copy.shift(-nuth_kaab._meta['offset_east_px']*nuth_kaab._meta['resolution'], -nuth_kaab._meta['offset_north_px']*nuth_kaab._meta['resolution']) aligned_dem = dem_to_be_aligned_copy.reproject(reference_dem, resampling='cubic') ``` Note that one can check...
Actually, cubic interpolation spreads the NaNs even more, so bilinear is preferable, see below. With bilinear interpolation ![image](https://user-images.githubusercontent.com/3285905/141820869-76be37f7-fda6-49ab-a2df-39cfff6dce4a.png) With cubic interpolation ![image](https://user-images.githubusercontent.com/3285905/141820718-fef6190d-27e4-4b8c-8bdc-2ffea378b3ac.png) See attached script for tests. [plot_nuth_kaab.txt](https://github.com/GlacioHack/xdem/files/7540269/plot_nuth_kaab.txt)
The NaN spread is even worse with two coregistrations in a row, like `coreg = xdem.coreg.ICP() + xdem.coreg.NuthKaab()` (see attached script and figure). Turning off the 'dilate_mask' option reduces the...
@rhugonnet, could you add here the few lines of code that are repeated each time? Is it more than just 1-2 lines of code?
Yes, I think we should first run it on our current code and see what the output looks like and whether or not it makes sense!
Yes, I think we should force one of the cases. I would favor using only (height, width) as it makes many steps easier... But what create a copy each time?...
Maybe we should just re-use [get_array_and_mask](https://github.com/GlacioHack/xdem/blob/8faaef1185dcd910a65183def5c4d2a10d8c280e/xdem/spatial_tools.py#L25) and add a step to force a dimension of 2? Then we would simply call this function each time we want to enforce the...
Looks promising!
Hi, just catching up with the now long discussion! Here's my viewpoint: - option 2 (standalone) module with a minimum of dependency is great. It would of course be great...
Wow, thanks for the detailed answer ! A few more comments/questions: - in the `get_n_threads` function, I would raise a warning if trying to set a value larger than the...