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 com.sun.media.jai.util.SunTileScheduler@18494f27
org.esa.snap.core.gpf.OperatorException
at org.jlinda.nest.dataio.SnaphuExportOp.computeTile(SnaphuExportOp.java:199)
at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:82)
at javax.media.jai.SourcelessOpImage.computeTile(Unknown Source)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(Unknown Source)
at javax.media.jai.OpImage.getTile(Unknown Source)
at com.sun.media.jai.util.RequestJob.compute(Unknown Source)
at com.sun.media.jai.util.WorkerThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at org.jlinda.nest.dataio.SnaphuWriter.createSnaphuConfFile(SnaphuWriter.java:419)
at org.jlinda.nest.dataio.SnaphuWriter.writeProductNodesImpl(SnaphuWriter.java:89)
at org.esa.snap.core.dataio.AbstractProductWriter.writeProductNodes(AbstractProductWriter.java:111)
at org.jlinda.nest.dataio.SnaphuExportOp.writeHeader(SnaphuExportOp.java:207)
at org.jlinda.nest.dataio.SnaphuExportOp.computeTile(SnaphuExportOp.java:187)
… 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.

Hello,
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