masking based on coherency before phase unwrapping

Hello everyone!!
I have some questions. I hope someone have some ideas!
1- masking interferogram based on coherency; is same (in terms of phase unwrapping quality; not processing time) before and after phase unwrapping?
2- if we want to mask low coherence regions before phase unwrapping; what is the best method?How can we do it in SNAP or any other approved solution?

coherence stays the same, but if you manage to exclude the low coherence areas before unwrapping, there will be less unwrapping errors induced by noisy interferogram parts.

Please check here: Is it the right way to create mask for phase unwrapping?

Thanks ABraun. Your replies have always been helpful for me.

1 - I’m still a bit confused!. If I don’t mask invalid parts of interferogram (according to the low values of Coherency); am I going to miss accuracy?!
I mean the necessity of masking before Phase unwrapping. If we want to have higher quality results is it requirement?
Or it is something that sometimes help and sometimes not.

2- the linked solution was a nice workaround to solve the problem in SNAP.
three steps of the procedure of INSAR processing require Dem (registration,phase2elevation and Terrain correction). as i understand by your answer we only have to mask Dem for the registration step and it doesn’t necessary to use same masked Dem for other two steps.
I am using Sentinel-1 images for DSM generation.
I tested it against control points(ICESAT2 data) and the results became worse surprisingly relative to the case; applying phase unwrapping to whole scene.
I will try to investigate it more.

masking is not mandatory, but if snaphu tries to unwrap noisy parts, the result is just random. In the worst case, it will negatively affect the good parts. It completely depends on the proportion of good and bad parts in the interferograms. At a certain point, masking will no longer help, but if there are a couple of bad areas between nice fringes it is worth to give it a try.

yes, the example uses a DEM (masking water areas), but you could also try to replicate the no-data areas based on the coherence. I have never tried it, but it should work the same, as long as the interferogram has a null value at the areas of low coherence.

Thanks a lot for your helpful comments.

I will investigate it more.

But another question rises. What is the vertical datum for generated DSM(based on Sentinel-1 INSAR)? Ellipsoidal height (WGS84,…?) or Orthometric height (MSL; EGM96 or EGM 2008?)? Where should we set it?