Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terrain-Correction operator error #19

Open
tpilz opened this issue Apr 14, 2022 · 2 comments
Open

Terrain-Correction operator error #19

tpilz opened this issue Apr 14, 2022 · 2 comments

Comments

@tpilz
Copy link

tpilz commented Apr 14, 2022

Hi,

the Terrain-Correction operator is not working properly. One thing is a non-existent element in the Graph leading to

Error: [NodeId: terrain-correction] Operator 'RangeDopplerGeocodingOp': Unknown element 'outputComplex'

However, when removing element outputComplex from the graph (I exported it into a file and run with gpt) the next error occurs which I did not further investigate:

java.lang.ArithmeticException: / by zero
        at javax.media.jai.PlanarImage.XToTileX(PlanarImage.java:832)
        at org.esa.snap.core.gpf.internal.OperatorImageTileStack.createLocks(OperatorImageTileStack.java:190)
        at org.esa.snap.core.gpf.internal.OperatorContext.setTargetImages(OperatorContext.java:750)
        at org.esa.snap.core.gpf.internal.OperatorContext.initializeOperator(OperatorContext.java:531)
        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.initNodeContext(GraphContext.java:182)
        at org.esa.snap.core.gpf.graph.GraphContext.initOutput(GraphContext.java:166)
        at org.esa.snap.core.gpf.graph.GraphContext.<init>(GraphContext.java:85)
        at org.esa.snap.core.gpf.graph.GraphContext.<init>(GraphContext.java:58)
        at org.esa.snap.core.gpf.graph.GraphProcessor.executeGraph(GraphProcessor.java:118)
        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:60)
        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)

When I re-create the workflow with SNAP GUI it runs fine. So, I guess there is a version conflict when building the graph as elements of the operator seem to be outdated? I'm using snapista version 0.2.0 and snap version 8.0.0 with Python 3.7 installed with conda from terradue repo.

@fabricebrito
Copy link
Member

can you save the graphs with snapista and with the GUI and post them here?

@tpilz
Copy link
Author

tpilz commented Apr 22, 2022

Sure, here are the graphs, only the Terrain-Correction node (don't worry about differences in map projection).

Generated with Snap 8.0.0 GUI:

<graph id="Graph">
  <version>1.0</version>
  <node id="Terrain-Correction">
    <operator>Terrain-Correction</operator>
    <sources>
      <sourceProduct refid="read"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <sourceBands/>
      <demName>SRTM 3Sec</demName>
      <externalDEMFile/>
      <externalDEMNoDataValue>0.0</externalDEMNoDataValue>
      <externalDEMApplyEGM>true</externalDEMApplyEGM>
      <demResamplingMethod>BILINEAR_INTERPOLATION</demResamplingMethod>
      <imgResamplingMethod>BILINEAR_INTERPOLATION</imgResamplingMethod>
      <pixelSpacingInMeter>20.0</pixelSpacingInMeter>
      <pixelSpacingInDegree>8.983152841195215E-5</pixelSpacingInDegree>
      <mapProjection>GEOGCS[&quot;WGS84(DD)&quot;, 
  DATUM[&quot;WGS84&quot;, 
    SPHEROID[&quot;WGS84&quot;, 6378137.0, 298.257223563]], 
  PRIMEM[&quot;Greenwich&quot;, 0.0], 
  UNIT[&quot;degree&quot;, 0.017453292519943295], 
  AXIS[&quot;Geodetic longitude&quot;, EAST], 
  AXIS[&quot;Geodetic latitude&quot;, NORTH]]</mapProjection>
      <alignToStandardGrid>false</alignToStandardGrid>
      <standardGridOriginX>0.0</standardGridOriginX>
      <standardGridOriginY>0.0</standardGridOriginY>
      <nodataValueAtSea>true</nodataValueAtSea>
      <saveDEM>false</saveDEM>
      <saveLatLon>false</saveLatLon>
      <saveIncidenceAngleFromEllipsoid>false</saveIncidenceAngleFromEllipsoid>
      <saveLocalIncidenceAngle>false</saveLocalIncidenceAngle>
      <saveProjectedLocalIncidenceAngle>false</saveProjectedLocalIncidenceAngle>
      <saveSelectedSourceBand>true</saveSelectedSourceBand>
      <saveLayoverShadowMask>false</saveLayoverShadowMask>
      <applyRadiometricNormalization>false</applyRadiometricNormalization>
      <saveSigmaNought>false</saveSigmaNought>
      <saveGammaNought>false</saveGammaNought>
      <saveBetaNought>false</saveBetaNought>
      <incidenceAngleForSigma0>Use projected local incidence angle from DEM</incidenceAngleForSigma0>
      <incidenceAngleForGamma0>Use projected local incidence angle from DEM</incidenceAngleForGamma0>
      <auxFile>Latest Auxiliary File</auxFile>
      <externalAuxFile/>
    </parameters>
  </node>
</graph>

Generated with Snapista:

<graph>
  <version>1.0</version>
  <node id="terrain-correction">
    <operator>Terrain-Correction</operator>
    <sources>
      <sourceProduct refid="read"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <alignToStandardGrid>false</alignToStandardGrid>
      <applyRadiometricNormalization>false</applyRadiometricNormalization>
      <auxFile>Latest Auxiliary File</auxFile>
      <demName>SRTM 3Sec</demName>
      <demResamplingMethod>BILINEAR_INTERPOLATION</demResamplingMethod>
      <externalAuxFile/>
      <externalDEMApplyEGM>true</externalDEMApplyEGM>
      <externalDEMFile/>
      <externalDEMNoDataValue>0</externalDEMNoDataValue>
      <imgResamplingMethod>BILINEAR_INTERPOLATION</imgResamplingMethod>
      <incidenceAngleForGamma0>Use projected local incidence angle from DEM</incidenceAngleForGamma0>
      <incidenceAngleForSigma0>Use projected local incidence angle from DEM</incidenceAngleForSigma0>
      <mapProjection>EPSG:9822</mapProjection>
      <nodataValueAtSea>true</nodataValueAtSea>
      <outputComplex>false</outputComplex>
      <pixelSpacingInDegree>0</pixelSpacingInDegree>
      <pixelSpacingInMeter>20.0</pixelSpacingInMeter>
      <saveBetaNought>false</saveBetaNought>
      <saveDEM>false</saveDEM>
      <saveGammaNought>false</saveGammaNought>
      <saveIncidenceAngleFromEllipsoid>false</saveIncidenceAngleFromEllipsoid>
      <saveLatLon>false</saveLatLon>
      <saveLocalIncidenceAngle>false</saveLocalIncidenceAngle>
      <saveProjectedLocalIncidenceAngle>false</saveProjectedLocalIncidenceAngle>
      <saveSelectedSourceBand>true</saveSelectedSourceBand>
      <saveSigmaNought>false</saveSigmaNought>
      <sourceBandNames/>
      <standardGridOriginX>0</standardGridOriginX>
      <standardGridOriginY>0</standardGridOriginY>
    </parameters>
  </node>
</graph>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants