### Question:
CrossGeometry { public void computeCoeffsFromOffsets() { constructGrids(); DoubleMatrix sourceY = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix sourceX = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix offsetY = new DoubleMatrix(numberOfWindows, 1); DoubleMatrix offsetX = new DoubleMatrix(numberOfWindows, 1); for (int i = 0; i < numberOfWindows; i++) { if (normalizeFlag) { sourceY.put(i, PolyUtils.normalize2(sourceGrid[i][0], dataWindow.linelo, dataWindow.linehi)); sourceX.put(i, PolyUtils.normalize2(sourceGrid[i][1], dataWindow.pixlo, dataWindow.pixhi)); } else { sourceY.put(i, sourceGrid[i][0]); sourceX.put(i, sourceGrid[i][1]); } offsetY.put(i, offsetGrid[i][0]); offsetX.put(i, offsetGrid[i][1]); } coeffsAz = PolyUtils.polyFit2D(sourceX, sourceY, offsetY, polyDegree); coeffsRg = PolyUtils.polyFit2D(sourceX, sourceY, offsetX, polyDegree); logger.debug("coeffsAZ (offsets): estimated with PolyUtils.polyFit2D : {}", ArrayUtils.toString(coeffsAz)); logger.debug("coeffsRg (offsets): estimated with PolyUtils.polyFit2D : {}", ArrayUtils.toString(coeffsRg)); } CrossGeometry();  CrossGeometry(double prfOriginal, double prfTarget, double rsrOriginal, double rsrSlave, Window window);  CrossGeometry(SLCImage masterMeta, SLCImage slaveMeta); int getNumberOfWindows(); void setNumberOfWindows(int numberOfWindows); void setDataWindow(Window dataWindow); void setPrfOriginal(double prfOriginal); void setPrfTarget(double prfTarget); void setRsrOriginal(double rsrOriginal); void setRsrTarget(double rsrTarget); int getPolyDegree(); void setPolyDegree(int polyDegree); double getRatioPRF(); double getRatioRSR(); double[] getCoeffsAz(); double[] getCoeffsRg(); double[][] getSourceGrid(); double[][] getTargetGrid(); double[][] getOffsetGrid(); void setNormalizeFlag(boolean normalizeFlag); void constructGrids(); void computeCoeffsFromOffsets(); void computeCoeffsFromCoords_JAI();  }### Answer:
@Test public void testComputeCoeffsFromOffsets() { CrossGeometry crossGeometry = new CrossGeometry(); crossGeometry.setPrfOriginal(prfERS); crossGeometry.setRsrOriginal(rsrERS); crossGeometry.setPrfTarget(prfASAR); crossGeometry.setRsrTarget(rsrASAR); crossGeometry.setDataWindow(new Window(lineLo, lineHi, pixelLo, pixelHi)); crossGeometry.setNumberOfWindows(NUM_OF_WINDOWS); crossGeometry.setPolyDegree(POLY_DEGREE); crossGeometry.setNormalizeFlag(true); crossGeometry.computeCoeffsFromOffsets(); double[] coeffsAz = crossGeometry.getCoeffsAz(); double[] coeffsRg = crossGeometry.getCoeffsRg(); logger.debug("coeffsAZ (from offsets): estimated with PolyUtils.polyFit2D : {}", ArrayUtils.toString(coeffsAz)); logger.debug("coeffsRg (from offsets): estimated with PolyUtils.polyFit2D : {}", ArrayUtils.toString(coeffsRg)); logger.debug("-----"); }