johntruckenbrodt / pyroSAR

framework for large-scale SAR satellite data processing
MIT License
513 stars 112 forks source link

Additional workflow on ENVI file output from geocode #284

Closed SpontaneousDuck closed 11 months ago

SpontaneousDuck commented 11 months ago

Not sure if this is a pyrosar problem or SNAP but I am trying to run additional SNAP Operations after preparing the SENTINEL-1 GRD file using geocode. The code used to build the new test graph is below. On trying to open the resulting ENVI file, it looks like a NullPointerException is thrown when trying to read the input ENVI file generated from geocode. Thanks for the help!

read = parse_node('Read') read.parameters['file'] = 'input.tif' read.parameters['formatName'] = 'ENVI' workflow.insert_node(read)

write = parse_node('Write') write.parameters['file'] = 'output.tif' write.parameters['formatName'] = 'ENVI' workflow.insert_node(write, before=read.id)

workflow.write('output.xml')

execute(out_file+'.xml', cleanup=True, gpt_exceptions=None, gpt_args=None)

- if applicable, which version of SNAP or GAMMA are you using in pyroSAR?
SNAP 9.0.8
- the full error message

RuntimeError: Executing processing graph done. INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience. java.lang.NullPointerException at org.esa.snap.dataio.envi.HeaderParser.parse(HeaderParser.java:47) at org.esa.snap.dataio.envi.Header.(Header.java:25) at org.esa.snap.dataio.envi.EnviProductReader.innerReadProductNodes(EnviProductReader.java:116) at org.esa.snap.dataio.envi.EnviProductReader.readProductNodesImpl(EnviProductReader.java:94) at org.esa.snap.core.dataio.AbstractProductReader.readProductNodes(AbstractProductReader.java:178) at org.esa.snap.core.gpf.common.ReadOp.initialize(ReadOp.java:170) at org.esa.snap.core.gpf.internal.OperatorContext.initializeOperator(OperatorContext.java:528) at org.esa.snap.core.gpf.internal.OperatorContext.getTargetProduct(OperatorContext.java:298) at org.esa.snap.core.gpf.Operator.getTargetProduct(Operator.java:385) at org.esa.snap.core.gpf.graph.NodeContext.initTargetProduct(NodeContext.java:77) at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:199) at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:182) at org.esa.snap.core.gpf.graph.GraphContext.initOutput(GraphContext.java:166) at org.esa.snap.core.gpf.graph.GraphContext.(GraphContext.java:85) at org.esa.snap.core.gpf.graph.GraphContext.(GraphContext.java:58) at org.esa.snap.core.gpf.graph.GraphProcessor.executeGraph(GraphProcessor.java:127) at org.esa.snap.core.gpf.main.DefaultCommandLineContext.executeGraph(DefaultCommandLineContext.java:86) at org.esa.snap.core.gpf.main.CommandLineTool.executeGraph(CommandLineTool.java:547) at org.esa.snap.core.gpf.main.CommandLineTool.runGraph(CommandLineTool.java:391) at org.esa.snap.core.gpf.main.CommandLineTool.runGraphOrOperator(CommandLineTool.java:287) at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:188) at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:121) at org.esa.snap.core.gpf.main.GPT.run(GPT.java:59) at org.esa.snap.core.gpf.main.GPT.main(GPT.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.esa.snap.runtime.Launcher.lambda$run$0(Launcher.java:55) at org.esa.snap.runtime.Engine.runClientCode(Engine.java:189) at org.esa.snap.runtime.Launcher.run(Launcher.java:51) at org.esa.snap.runtime.Launcher.main(Launcher.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:84) at com.install4j.runtime.launcher.UnixLauncher.start(UnixLauncher.java:66) at install4j.org.esa.snap.runtime.Launcher_gpt.main(Unknown Source)

Error: java.lang.NullPointerException

[output.xml] failed with return code 1

SpontaneousDuck commented 11 months ago

Ok, sorry about that. I was being an idiot and using the tif output in stead of the actual ENVI files. Once I changed to using the correct files, the Read op works

johntruckenbrodt commented 11 months ago

Great 😀 Happy processing @SpontaneousDuck