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

Fix issue with NaNs masks in Coreg methods #242

Merged
merged 3 commits into from
Nov 19, 2021

Conversation

adehecq
Copy link
Member

@adehecq adehecq commented Nov 19, 2021

This is a fix to #237.
During coreg.apply, a resampling is needed. When NaNs exist in the input DEMs, the NaNs also propagate and must be handled carefully. Currently, such resampling is done at 3 different places, and NaNs are not always caught properly.
This PR tries to fix this issue.

I also fixed a small issue in BlockwiseCoreg. Errors during fitting were caught, but not during apply.

…Catch an error when irrealistic shifts are estimated.
@adehecq
Copy link
Member Author

adehecq commented Nov 19, 2021

Note that BlockwiseCoreg is not very reliable with large gaps, but the current fix improved it a bit. See figure of elevation difference after Blockwise coregistration (See attached script inspired from test_blockwise_coreg_large_gaps): test_blockwise.txt

Before the PR
Figure_1

After the PR
Figure_2

The underlying NuthKaab method should probably be improved to be more robust with few points.

@adehecq adehecq linked an issue Nov 19, 2021 that may be closed by this pull request
@adehecq
Copy link
Member Author

adehecq commented Nov 19, 2021

Finally, this is another indication that Coreg methods should be thoroughly tested for datasets with large gaps (#140).

@rhugonnet
Copy link
Member

rhugonnet commented Nov 19, 2021

Thanks for tackling this! It's good to have all these fixes incorporated right away.

I agree, we'll have to work on a testing scheme for outlier robustness! This can probably be done in the future by simulating data gaps/NaNs, which will also be super useful if we want to write a paper comparing the performance of Coreg methods, including robustness 😄 !

Copy link
Member

@rhugonnet rhugonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@adehecq adehecq merged commit c904d48 into GlacioHack:main Nov 19, 2021
@adehecq adehecq deleted the fix_nan_mask branch November 19, 2021 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NuthKaab shifted grids in fit_func contain interpolated nodata
2 participants