Snaphu Export error with Subset products

Hello everyone,
I’m trying to perform Snaphu Export on a subset, obtained with “Subset” operator on Python with snappy, but I receive this error:

SEVERE: org.esa.snap.core.util.SystemUtils$SnapImagingListener: JAI error occurred: ‘Problem occurs when computing a tile by the owner.’ at
at org.jlinda.nest.dataio.SnaphuExportOp.computeTile(
at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(
at Source)
at Source)
at Source)
at Source)
at Source)
Caused by: java.lang.NullPointerException
at org.jlinda.nest.dataio.SnaphuWriter.createSnaphuConfFile(
at org.jlinda.nest.dataio.SnaphuWriter.writeProductNodesImpl(
at org.esa.snap.core.dataio.AbstractProductWriter.writeProductNodes(
at org.jlinda.nest.dataio.SnaphuExportOp.writeHeader(
at org.jlinda.nest.dataio.SnaphuExportOp.computeTile(
… 6 more

However, if I reproduce the Subset operator in SNAP software, and then Snaphu Export on Python, there are no errors. Does anyone know why with products obtained with snappy on Python there is this problem?
Thank you in advance

Maybe post your Python code? I’ve tried this with Python, but I’ve switched methods since I’ve run into problems in other places,

  1. Create a Graph with GraphBuilder, save it as an XML.
  2. Edit the XML with Python and on the line numbers with the file input, file output, and subset WKT, I edit them as desired.
  3. Run GPT commandline tool with subprocess.

I’ve found this simpler than discovering obscure and mostly hidden gotchas in snappy. Band export is still handy in snappy though. There are some things that are bulky in GPT.

Thank you for your answer. The option to create a Graph in GraphBuilder seems good but I don’t know if it fits with my purpose: in fact, my objective is to write a Python code using snappy to perform DInSAR, in order to avoid any type of interaction with the software and the graphic interface. For this reason, I cannot insert a XML part on the code. I attach you the subset part of my code just to understand the form of the code. It’s important to remind that is just a part of the code, and not the entire code (the entire one is like 2000 lines since it contains the processing for both ascending and descending orbits and also the processing to perform if the area of interest is on two subswaths instead of one)

The product I obtain with the writing exists and it’s ok, but the export fails. If I do the Subset on SNAP software, it doesn’t fail