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

Is the grid being interpolated before snaphu? #92

Open
SteffanDavies opened this issue Jan 27, 2024 · 6 comments
Open

Is the grid being interpolated before snaphu? #92

SteffanDavies opened this issue Jan 27, 2024 · 6 comments

Comments

@SteffanDavies
Copy link

https://github.com/mobigroup/gmtsar/blob/b23580b9b6138752cc88bc5a63837c5197b1f036/pygmtsar/pygmtsar/Stack_unwrap_snaphu.py#L79

I can't seem to find any reference to interpolate_nearest in the code. Just filling nan with 0.

@AlexeyPechnikov
Copy link
Owner

The next line in the code also masks them using the SNAPHU mask, effectively excluding NaN pixels from unwrapping. This is a feature not present in GMTSAR processing. Additionally, like GMTSAR, we can use nearest-neighbor interpolation on the interferogram stack to fill NaN values:

sbas.interpolate_nearest(intf.where(...))

@SteffanDavies
Copy link
Author

So is it preferred to use interpolation or 0 filling? How does it affect the results and speed?

@AlexeyPechnikov
Copy link
Owner

Masked values in the unwrapped phase lead to disconnected regions. Interpolation helps in connecting these regions for cases without phase jumps. In areas with high coherence, both masking and interpolation yield similar results. However, in low-coherence areas, the outcomes are unpredictable, and it's necessary to experiment to determine which method is more effective.

@SteffanDavies
Copy link
Author

I was wondering because I am processing an area divided by a river. So maybe interpolation makes sense.

@SteffanDavies
Copy link
Author

image
Interpolation seems to be a lot faster.

@AlexeyPechnikov
Copy link
Owner

Interpolation works effectively when there are no significant phase jumps for the interpolated pixels. If your river area doesn't encompass vastly different topographies, interpolation should be a viable approach. Additionally, SNAPHU processes zero-gradient interpolated pixels quickly, as these do not necessitate complex change computations.

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

No branches or pull requests

2 participants