pygmtsar icon indicating copy to clipboard operation
pygmtsar copied to clipboard

Is the grid being interpolated before snaphu?

Open SteffanDavies opened this issue 1 year ago • 6 comments

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.

SteffanDavies avatar Jan 27 '24 01:01 SteffanDavies

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(...))

AlexeyPechnikov avatar Jan 27 '24 02:01 AlexeyPechnikov

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

SteffanDavies avatar Jan 27 '24 02:01 SteffanDavies

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.

AlexeyPechnikov avatar Jan 27 '24 02:01 AlexeyPechnikov

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

SteffanDavies avatar Jan 27 '24 02:01 SteffanDavies

image Interpolation seems to be a lot faster.

SteffanDavies avatar Jan 27 '24 02:01 SteffanDavies

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.

AlexeyPechnikov avatar Jan 27 '24 02:01 AlexeyPechnikov