Snaphu-unwarping path error

Hello,

Following the TOPS Interferometry Tutorial, I installed the “snaphu” plugin on my SNAP 8.0 (Linux).
Now I have a snaphu file it in the adress bellow:

/home/sina/.snap/auxdata/snaphu-v2.0.4_linux/bin

(when I try to open the file with vim, the content is unreadable ascci characters. I am not sure if this is a sign of problem or not)

Now, when I try to do the unwarping on the folder created by the export step of the wrapped phase, which is the one bellow:

/home/sina/Documents/LIVE/SNAP/CEN-Lorraine/Change Detection/SLC/subset_0_of_S1A_IW_SLC__1SDV_20200528T054257_20200528T054325_032761_03CB7F_615A_split_Orb_Stack_esd_ifg_deb

I will get a path does not exist error (please see the image attached here):

Now when I open the snaphu in the manage external tools to edit the addresses, to the best of my knowledge, the addresses are set correctly:

Should I add any of these addresses to the PATH variable? hasn’t it done automatically when the plugin is installed on SNAP? Or maybe the address of the folder that I am using is too long?

I appreciate any hint on this

grafik

please add bin at the end of this path and try again

Thank you very much for your response.
Unfortunately the same error is being produced (this time by a duplicate /bin/ folder within the address)!
Please see the image attached here:

you’re right - bin\snaphu is added automatically…
Is it an option to run it from the command line?

well certainly I would love to have direct access to the SNAP commands through the commandline (and even better from Python). However I do not know how to call these Java function from outside the SNAP environment. Do you think It is possible?

snaphu is not an official part of SNAP, that’s why it is installed separately as a plugin. To use it for unwrapping via the command line you have to add the snaphu\bin folder to your system’s PATH, then you can simply execute the command inside the snaphu.conf file in the folder where you exported the data.

an example is given here: https://www.youtube.com/watch?v=w6ilV74r2RQ (starting at around 43 minutes)

1 Like

Please tell us your linux distro and version as there are differences in the security policies and included libraries that may explain your problem. With luck, someone with the same linux version may already have a solution.

This could a permission problem (typically due to inappropriate use of the sudo command), an “invisible character” hiding in the path, a unicode look-alike character, or something like a library needed by the snaphu program that is missing.

Problems like this are more easily solved using the terminal. The ls -l command shows file ownership and permissions. The ldd command lists the libraries that a program requires.

Please paste (as text) the terminal output from:

ls -l /home/sina/.snap/auxdata/snaphu-v2.0.4_linux/bin/snaphu
and
ldd /home/sina/.snap/auxdata/snaphu-v2.0.4_linux/bin/snaphu

in your post. This not only makes it easier to use the text in a response but can reveal “invisible character” problems that we can’t see in a screen capture.

2 Likes

Dear gnwii thank you very much for your insights.
You were right. The respective executable snaphu was not actually an executable and the dll command warned me about it. after doing :

sudo chmod +x snaphu

This problem solved. and I could run the snaphu-unwarping directly from the SNAP GUI.
Now another issue appeared :
The unwarping starts (the progress bar appears for a second) and nothing happens … no error and no new files in the target directory. I think I will try the suggestion of @ABraun and call the sanphu directly from the comandline and will update you with the results.

In the meanwhile I use Fedora 32 (64x) and here is the result of the ldd command after making the snaphu executable :

1 Like

Yaaay, It works :man_dancing:
Thanks a lot to your comments and insight in a Sunday afternoon @ABraun @gnwiii

With regards,
sina

1 Like

Glad you got it working. Actually the ls -l command shows whether a file has executable permissions. You will find it worth spending some time learning linux command-line basics. SNAP and related tools are not polished fully graphical programs, so it is very common to encounter issues such as the one you encountered. See the links in this advice .

1 Like

Hello @Sinooshka,

When you say “It works”, you mean using the command line? as @ABraun suggested?

Thank you,
Oded

Yes, It works smoothly through command-line. You just need to make sure that the snaphu is already executable.

Sina

1 Like

I use linux too (debian 10, 64bit), and I followed the same steps as Sinooshka did, with the same results: snaphu works perfectly from command line (in snaphu.conf I found the exact command to use), but it does not from within snap. As Sinooshka reported, a pop up shows up for one second, but no output shows up in the “Display execution output” window, and no .img file is created. I checked all the directories in the “system variables” tab of the snaphu-unwrapping external tool configuration window.
I’d like to debug it myself, but there is no way to catch the errors in the execution of snaphu from within SNAP. Not even the snaphu log file is created. I’d like to receive some hints.
Thanks

With linux you can often capture error messages using a “wrapper” shell script that runs the offending command with output redirected to a file using “tee”: How to use tee and script commands.

This does require some command-line expertise, so if you are avoiding the command-line workaround because you aren’t comfortable using the command line you will find it helpful in the long run to spend time getting comfortable with the command line. A previous post in this thread points to a post with links to linux command-line documents. There are many online tutorials and courses to help users learn to use command-line tools.

Hi gnwiii,
I’ll try to compose a wrapping command to intercept snaphu commands and see what the error could be.
thanks for the hint
Francesco