Java exception using CoarseFineCoregOp

I’m using snappy to do CoarseFine Coregistration (part of InSAR processing). I ran all the InSAR steps using the SNAP UI, and now trying the same steps using snappy. I have ApplyOrbit working, and I think I have CreateStack working, but getting stuck on Coregistration with an exception.

I see this in my terminal window:
CoarseFine-Coregistration: -1
Exception in thread “Thread-4” org.esa.snap.core.gpf.OperatorException: CoarseFine-Coregistration: -1
at org.esa.snap.engine_utilities.gpf.OperatorUtils.catchOperatorException(OperatorUtils.java:386)
at org.jlinda.nest.gpf.coregistration.CoarseFineCoregOp.getFineOffsets(CoarseFineCoregOp.java:651)
at org.jlinda.nest.gpf.coregistration.CoarseFineCoregOp.access$300(CoarseFineCoregOp.java:68)
at org.jlinda.nest.gpf.coregistration.CoarseFineCoregOp$1.run(CoarseFineCoregOp.java:502)
CoarseFine-Coregistration: -1

… and then I see what looks like the actual error:

Exception in thread “Thread-35” org.esa.snap.core.gpf.OperatorException: CoarseFine-Coregistration: -1
at org.esa.snap.engine_utilities.gpf.OperatorUtils.catchOperatorException(OperatorUtils.java:386)
at org.jlinda.nest.gpf.coregistration.CoarseFineCoregOp.getFineOffsets(CoarseFineCoregOp.java:651)
at org.jlinda.nest.gpf.coregistration.CoarseFineCoregOp.access$300(CoarseFineCoregOp.java:68)
at org.jlinda.nest.gpf.coregistration.CoarseFineCoregOp$1.run(CoarseFineCoregOp.java:502)
CoarseFine-Coregistration: java.lang.ArrayIndexOutOfBoundsException

But I can’t set breakpoints in Java because I"m calling it via Python (snappy) so unsure exactly what is failing now. I checked the parameters against the java file, and I think I have set what I wanted that wasn’t already set as defaults.

Any ideas?

Moving to “problem reports” as I’ve been unable to get past it. It actually goes ahead and moves to the next step in the InSAR process, but the resulting product is incorrect.
_CS

Are you using S1 data?

Yes, and what’s weird is, I ran these same steps in the UI and they work fine - same granules, same steps.

I’m using these 2 granules:
S1A_S1_SLC__1SSV_20141006T142338_20141006T142403_002710_003084_4D44.zip
S1A_S1_SLC__1SSV_20141018T142338_20141018T142403_002885_003443_6545.zip

Thanks,
CS

I can also reproduce using gpt from the command line. From my /Applications/snap/bin directory, I ran:

./gpt “//myInSARGraph.xml”

It generates the same CoarseFine Error as above.

The graph XML was one that I created in the SNAP UI and runs without error in the UI:

<graph id="Graph">
  <version>1.0</version>
  <node id="Read">
    <operator>Read</operator>
    <sources/>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <file>/S1A_S1_SLC__1SSV_20141006T142338_20141006T142403_002710_003084_4D44.zip</file>
    </parameters>
  </node>
  <node id="Apply-Orbit-File">
    <operator>Apply-Orbit-File</operator>
    <sources>
      <sourceProduct refid="Read"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <orbitType>Sentinel Precise (Auto Download)</orbitType>
      <polyDegree>3</polyDegree>
      <continueOnFail>false</continueOnFail>
    </parameters>
  </node>
  <node id="Read(2)">
    <operator>Read</operator>
    <sources/>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <file>/S1A_S1_SLC__1SSV_20141018T142338_20141018T142403_002885_003443_6545.zip</file>
    </parameters>
  </node>
  <node id="Apply-Orbit-File(2)">
    <operator>Apply-Orbit-File</operator>
    <sources>
      <sourceProduct refid="Read(2)"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <orbitType>Sentinel Precise (Auto Download)</orbitType>
      <polyDegree>3</polyDegree>
      <continueOnFail>false</continueOnFail>
    </parameters>
  </node>
  <node id="CreateStack">
    <operator>CreateStack</operator>
    <sources>
      <sourceProduct refid="Apply-Orbit-File"/>
      <sourceProduct.1 refid="Apply-Orbit-File(2)"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <masterBands/>
      <sourceBands/>
      <resamplingType>NONE</resamplingType>
      <extent>Master</extent>
      <initialOffsetMethod>Orbit</initialOffsetMethod>
    </parameters>
  </node>
  <node id="CoarseFine-Coregistration">
    <operator>CoarseFine-Coregistration</operator>
    <sources>
      <sourceProduct refid="CreateStack"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <numWindows>2000</numWindows>
      <coarseRegistrationWindowWidth>128</coarseRegistrationWindowWidth>
      <coarseRegistrationWindowHeight>128</coarseRegistrationWindowHeight>
      <coarseRegistrationWindowAccAzimuth>2</coarseRegistrationWindowAccAzimuth>
      <coarseRegistrationWindowAccRange>2</coarseRegistrationWindowAccRange>
      <fineMethod>Frequency Domain</fineMethod>
      <fineRegistrationWindowWidth>32</fineRegistrationWindowWidth>
      <fineRegistrationWindowHeight>32</fineRegistrationWindowHeight>
      <fineRegistrationWindowAccAzimuth>16</fineRegistrationWindowAccAzimuth>
      <fineRegistrationWindowAccRange>16</fineRegistrationWindowAccRange>
      <fineRegistrationOversampling>16</fineRegistrationOversampling>
      <coherenceThreshold>0.4</coherenceThreshold>
      <onlyGCPsOnLand>true</onlyGCPsOnLand>
    </parameters>
  </node>
  <node id="Resample">
    <operator>Resample</operator>
    <sources>
      <sourceProduct refid="CoarseFine-Coregistration"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <cpmDegree>1</cpmDegree>
      <cpmInterpKernel>Cubic convolution (6 points)</cpmInterpKernel>
      <cpmMaxIterations>20</cpmMaxIterations>
      <cpmAlphaValue>0.05</cpmAlphaValue>
      <cpmDemRefinement>false</cpmDemRefinement>
      <demName>SRTM 3Sec</demName>
      <openResidualsFile>false</openResidualsFile>
    </parameters>
  </node>
  <node id="Interferogram">
    <operator>Interferogram</operator>
    <sources>
      <sourceProduct refid="Resample"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <subtractFlatEarthPhase>true</subtractFlatEarthPhase>
      <srpPolynomialDegree>5</srpPolynomialDegree>
      <srpNumberPoints>501</srpNumberPoints>
      <orbitDegree>3</orbitDegree>
      <includeCoherence>true</includeCoherence>
      <outputCoherencePhase>false</outputCoherencePhase>
      <cohWinAz>10</cohWinAz>
      <cohWinRg>10</cohWinRg>
    </parameters>
  </node>
  <node id="GoldsteinPhaseFiltering">
    <operator>GoldsteinPhaseFiltering</operator>
    <sources>
      <sourceProduct refid="TopoPhaseRemoval"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <alpha>1.0</alpha>
      <FFTSizeString>64</FFTSizeString>
      <windowSizeString>3</windowSizeString>
    </parameters>
  </node>
  <node id="TopoPhaseRemoval">
    <operator>TopoPhaseRemoval</operator>
    <sources>
      <sourceProduct refid="Interferogram"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <orbitDegree>3</orbitDegree>
      <demName>SRTM 3Sec</demName>
      <externalDEMFile/>
      <externalDEMNoDataValue>0.0</externalDEMNoDataValue>
      <tileExtensionPercent>100</tileExtensionPercent>
      <topoPhaseBandName>topo_phase</topoPhaseBandName>
    </parameters>
  </node>
  <node id="Write">
    <operator>Write</operator>
    <sources>
      <sourceProduct refid="GoldsteinPhaseFiltering"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <file>/deformation-INSAR_test.dim</file>
      <formatName>BEAM-DIMAP</formatName>
    </parameters>
  </node>
  <applicationData id="Presentation">
    <Description/>
    <node id="Read">
      <displayPosition x="37.0" y="6.0"/>
    </node>
    <node id="Apply-Orbit-File">
      <displayPosition x="20.0" y="54.0"/>
    </node>
    <node id="Read(2)">
      <displayPosition x="38.0" y="189.0"/>
    </node>
    <node id="Apply-Orbit-File(2)">
      <displayPosition x="14.0" y="137.0"/>
    </node>
    <node id="CreateStack">
      <displayPosition x="85.0" y="94.0"/>
    </node>
    <node id="CoarseFine-Coregistration">
      <displayPosition x="184.0" y="93.0"/>
    </node>
    <node id="Resample">
      <displayPosition x="368.0" y="94.0"/>
    </node>
    <node id="Interferogram">
      <displayPosition x="357.0" y="134.0"/>
    </node>
    <node id="GoldsteinPhaseFiltering">
      <displayPosition x="330.0" y="222.0"/>
    </node>
    <node id="TopoPhaseRemoval">
      <displayPosition x="365.0" y="178.0"/>
    </node>
    <node id="Write">
      <displayPosition x="372.0" y="261.0"/>
    </node>
  </applicationData>
</graph>