One way to get pricise unwrapping

Dear all,
When I am doing unwrapping, it gives to me some errors in noisy places because of this, I should delete noisy places. I tried to delete low coherence parts by SNAP but as you know there is not any proper way in SNAP because of this I think it can be better, if I cut fringes from my phase picture, then do unwrapping.

  1. Is this good way? Is there any tools in SNAP for cutting fringe area and then do unwrapping (image1)?
  2. If you look at my fringes, any part is going to one direction and I do not think so, unwrapping works good on it. If we can divide (cut) whole fringes in three parts like part1, part2,part3 in image2 and then do unwrapping, we can have better result. Am I right? Is there any cutting tools in SNAP?




You can define a valid pixel expression based on coherence. As you said, this is not used when exporting to SNAPHU. But you can generate a new band with the band maths operator using conditions like marpet demonstrated here:

Another way would be clipping by a vector as you suggested:

  1. Digitize a polygon around your area of interest and save your product
  2. Use the Land/Sea mask module to clip out this area: Instead of masking the land or sea, use the third option where your geometry is used as the mask extent.

I am however not sure if this preserves the metadata as required by SNAPHU

Dear ABraun
I used ‘Polyline drawing tool’ and select area in below image and then I used
Layers……Masks…….Land/Sea Mask and I did what you told me and Instead of masking the land or sea, use the third option where your geometry is used as the mask extent but I did not use ‘SRTM3sec’, as I am working on +60 latitude.

But unfortunately, the area that I chose, did not cut and I have a picture like below.



Don’t use line drawing but a polygon.
No inversion of the vector is needed, DEMs also play no role for geometry-based masking.

Yes Thanks. It works very well for extracting but I think it does not work in unwrapping. Any suggestion for that?:smirk:
image1 (extracted area, phase image):

image2 (after unwrapping)

looks unwrapped to me actually.

Hint: You can disable the vector data in the layer manager to inspect the rasters underneath.

did you have a look at the maskfile option?

I didn’t try it so far but maybe it removes the bad quality areas as you originally intended.

-g maskfile
Grow a connected component mask for the unwrapped solution and write the mask to the file maskfile. A connected component is a region of pixels in the solution that is believed to have been unwrapped in a relative, internally self-consistent manner according to the statistical costs used. Regions that are smaller than a preselected threshold are masked out. Parameters for this option can be set in the configuration file. The connected component file is composed of unsigned characters, with all pixels of the same value belonging to the same connected component and zero corresponding to masked pixels.

Thanks. I will try it tomorrow and let u know.

Hi @ABraun,

I am trying to do the phase unwrapping but I get the error ‘Unexpected or abnormal exit of child process 25229’. You mentioned about -g maskfile. What format of mask file does snaphu requires? should it be a shapefile or a raster format ?


I never tried it, so I can’t tell you much about it, sorry.

Does this help?

cool, thanks.
I am still in the process of doing experiments about that to see what works and what does not.
I though you might had tried that already.

I also run into this problem. It is not clear in what format to feed snaphu the mask file. Has anyone managed to solve this?

Snaphu version 2.0.0 is available (at some places like Ubuntu 19.10) - with it you can create the connected component mask file even when tiling by using the -g option. Snaphu export usually adds tiles and previously -g wasn’t allowed with tiles.

Time series InSAR software, such as Mintpy, can use the Connected component mask. However, I am also struggling to determine in what format the mask is written by Snaphu and how to import it into SNAP again for terrain correction.

Has anyone worked with the mask file?