Error: java.lang.NullPointerException during Snaphu Unwrapping

Hello everyone,
I’m working on Sentinel -1 data and I’m trying to execute the phase unwrapping in order to obtain informations on the elevation. I’ve already tried to do this operation in SNAP, but it seems that the software actually has a problem with the unwrapping. To solve this problem, I tried to replay the same workflow on Python using snappy, but the same problem occurs with the unwrapping, giving the error “java.lang.NullPointerException”. As I understood, the new version of SNAPHU has a problem with the export and the unwrapping. At this point, the only solution seems to write an unwrapping algorithm. Does anyone know where (and if is possible) to find the SNAPHU algorithm? And if anyone else has my same problem, how can I solve it?
Thanks a lot to who will help me

1 Like

The easiest way to execute snaphu without compilation errors is to run it from the command line. You can download and call the snaphu.exe from the windows power shell (or any other command line tool) by inserting the command which is stored in the config file after exporting the data.


About execute snaphu through command line, can you help me to write the correct command line for the unwrapping? I successfully exported the product with snaphuExport command but I found some problem with the unwrapping command explanation

as result of gpt -h snaphu-unwrapping i obtained:

Source Options:
-SsourceProduct= Sets source ‘sourceProduct’ to .
This is a mandatory source.

Parameter Options:
-PcopyFilesTemplate= Sets parameter ‘copyFilesTemplate’ to .
Default value is ‘Snaphu-unwrapping-before.vm’.
-PcopyOutputAndDelete= Sets parameter ‘copyOutputAndDelete’ to .
Default value is ‘Snaphu-unwrapping-after.vm’.
-PtargetProductFile= Output file
Default value is ‘’.

So i wrote in my python code:
os.system(‘gpt Snaphu-unwrapping -SsourceProduct=’+output_path_of_product_before_snaphu_export+’ -PtargetProductFile=’+output_path_of_hdr_file_created_by_snaphuExport_command)

After i run this part of the code I recive this error: java.lang.NullPointerException

What am I doing wrong? Did I misunderstood what is the source/target product needed?
PS: the file i exported through command line in my python code can be unwrapped with the GUI of SNAP where the source is the output_path_of_product_before_snaphu_export and in the parameters i select the directory where I exported with snaphuExport command line


I have never done the export with the command line, sorry.
Actually, I meant to run snaphu.exe on the already exported phase. The command to call is inside snaphu.conf

1 Like

It’s working! Thanks!