The SNAPHU export operation creates a snaphu.conf file which references the inputs. It also has a useful snippet informing the user how to manually run snaphu, e.g.:
That’s fine, but assuming someone really tries to run that command, they might be surprised to see that snaphu crashes. The issue is that the path to CORRFILE is relative to the snaphu.conf directory. snaphu tries to open it, fails, but logs the error in a file called snaphu_tiles_$PID/tmptilelog_$X_$Y, which might not be obvious to the user.
In my case, yes. Note that I’m only using the export functionality in SNAP.
strace -f output:
[pid 14583] openat(AT_FDCWD, "coh_IW3_VV_15Aug2016_27Aug2016.snaphu.img", O_RDONLY <unfinished ...>
[pid 14581] read(5, <unfinished ...>
[pid 14583] <... openat resumed> ) = -1 ENOENT (No such file or directory)
It works if I run it from the expected directory, but this thread is about making life easier for users that don’t or can’t follow the expected workflow (because e.g. running snaphu from SNAP doesn’t work for them).
$ cat snaphu_tiles_17423/tmptilelog_0_0
snaphu (pid 17424): unwrapping tile at row 0, column 0
Current working directory is ~/snaphu/bin
Reading wrapped phase from file ~/snaphu_test/Phase_VV_15Aug2016_27Aug2016.snaphu.img
No weight file specified. Assuming uniform weights
Reading correlation data from file coh_IW3_VV_15Aug2016_27Aug2016.snaphu.img
Can't open file coh_IW3_VV_15Aug2016_27Aug2016.snaphu.img
Abort
I agree. But this is the case for any scripting language, right? If no full path is given, the file is expected in the current working directory.
On the other hand, I see no downside of adding the full path when the conf file is generated by SNAP.
The not so obvious issue is that ~/snaphu_test/snaphu.conf contains references to other files, and if the user doesn’t notice this and happens to run shaphu from some other directory, it will fail with a not-quite-useful error message.