@Test public void testPointByReference_lph2xyz() throws Exception { Point t1 = orbit_ACTUAL.lph2xyz(1, 1, 0, slcimage); Point t2 = orbit_ACTUAL.lph2xyz(1, 1, 1, slcimage); Assert.assertFalse(t1 == t2); }
public Point lph2xyz(final double line, final double pixel, final double height, final SLCImage slcimage) throws Exception { logger.setLevel(Level.OFF); Point satellitePosition; Point satelliteVelocity; Point ellipsoidPosition; double[] equationSet = new double[3]; double[][] partialsXYZ = new double[3][3]; double azTime = slcimage.line2ta(line); double rgTime = slcimage.pix2tr(pixel); satellitePosition = getXYZ(azTime); satelliteVelocity = getXYZDot(azTime); ellipsoidPosition = slcimage.getApproxXYZCentreOriginal(); for (int iter = 0; iter <= MAXITER; iter++) { Point dsat_P = ellipsoidPosition.min(satellitePosition); equationSet[0] = -eq1_Doppler(satelliteVelocity, dsat_P); equationSet[1] = -eq2_Range(dsat_P, rgTime); equationSet[2] = -eq3_Ellipsoid(ellipsoidPosition, height); partialsXYZ[0][0] = satelliteVelocity.x; partialsXYZ[0][1] = satelliteVelocity.y; partialsXYZ[0][2] = satelliteVelocity.z; partialsXYZ[1][0] = 2 * dsat_P.x; partialsXYZ[1][1] = 2 * dsat_P.y; partialsXYZ[1][2] = 2 * dsat_P.z; partialsXYZ[2][0] = (2 * ellipsoidPosition.x) / (Math.pow(ell_a + height, 2)); partialsXYZ[2][1] = (2 * ellipsoidPosition.y) / (Math.pow(ell_a + height, 2)); partialsXYZ[2][2] = (2 * ellipsoidPosition.z) / (Math.pow(ell_b + height, 2)); double[] ellipsoidPositionSolution = LinearAlgebraUtils.solve33(partialsXYZ, equationSet); ellipsoidPosition.x += ellipsoidPositionSolution[0]; ellipsoidPosition.y += ellipsoidPositionSolution[1]; ellipsoidPosition.z += ellipsoidPositionSolution[2]; logger.debug("ellipsoidPosition.x = " + ellipsoidPosition.x); logger.debug("ellipsoidPosition.y = " + ellipsoidPosition.y); logger.debug("ellipsoidPosition.z = " + ellipsoidPosition.z); if (Math.abs(ellipsoidPositionSolution[0]) < CRITERPOS && Math.abs(ellipsoidPositionSolution[1]) < CRITERPOS && Math.abs(ellipsoidPositionSolution[2]) < CRITERPOS) { logger.info("INFO: ellipsoidPosition (converged): {} ", ellipsoidPosition); break; } else if (iter >= MAXITER) { logger.warn("line, pix -> x,y,z: maximum iterations ( {} ) reached.", MAXITER); logger.warn("Criterium (m): {} dx,dy,dz = {}", CRITERPOS, ArrayUtils.toString(ellipsoidPositionSolution)); if (MAXITER > 10) { logger.error("lp2xyz : MAXITER limit reached! lp2xyz() estimation is diverging?!"); throw new Exception("Orbit.lp2xyz : MAXITER limit reached! lp2xyz() estimation is diverging?!"); } } } return new Point(ellipsoidPosition); }
Orbit { public Point lph2xyz(final double line, final double pixel, final double height, final SLCImage slcimage) throws Exception { logger.setLevel(Level.OFF); Point satellitePosition; Point satelliteVelocity; Point ellipsoidPosition; double[] equationSet = new double[3]; double[][] partialsXYZ = new double[3][3]; double azTime = slcimage.line2ta(line); double rgTime = slcimage.pix2tr(pixel); satellitePosition = getXYZ(azTime); satelliteVelocity = getXYZDot(azTime); ellipsoidPosition = slcimage.getApproxXYZCentreOriginal(); for (int iter = 0; iter <= MAXITER; iter++) { Point dsat_P = ellipsoidPosition.min(satellitePosition); equationSet[0] = -eq1_Doppler(satelliteVelocity, dsat_P); equationSet[1] = -eq2_Range(dsat_P, rgTime); equationSet[2] = -eq3_Ellipsoid(ellipsoidPosition, height); partialsXYZ[0][0] = satelliteVelocity.x; partialsXYZ[0][1] = satelliteVelocity.y; partialsXYZ[0][2] = satelliteVelocity.z; partialsXYZ[1][0] = 2 * dsat_P.x; partialsXYZ[1][1] = 2 * dsat_P.y; partialsXYZ[1][2] = 2 * dsat_P.z; partialsXYZ[2][0] = (2 * ellipsoidPosition.x) / (Math.pow(ell_a + height, 2)); partialsXYZ[2][1] = (2 * ellipsoidPosition.y) / (Math.pow(ell_a + height, 2)); partialsXYZ[2][2] = (2 * ellipsoidPosition.z) / (Math.pow(ell_b + height, 2)); double[] ellipsoidPositionSolution = LinearAlgebraUtils.solve33(partialsXYZ, equationSet); ellipsoidPosition.x += ellipsoidPositionSolution[0]; ellipsoidPosition.y += ellipsoidPositionSolution[1]; ellipsoidPosition.z += ellipsoidPositionSolution[2]; logger.debug("ellipsoidPosition.x = " + ellipsoidPosition.x); logger.debug("ellipsoidPosition.y = " + ellipsoidPosition.y); logger.debug("ellipsoidPosition.z = " + ellipsoidPosition.z); if (Math.abs(ellipsoidPositionSolution[0]) < CRITERPOS && Math.abs(ellipsoidPositionSolution[1]) < CRITERPOS && Math.abs(ellipsoidPositionSolution[2]) < CRITERPOS) { logger.info("INFO: ellipsoidPosition (converged): {} ", ellipsoidPosition); break; } else if (iter >= MAXITER) { logger.warn("line, pix -> x,y,z: maximum iterations ( {} ) reached.", MAXITER); logger.warn("Criterium (m): {} dx,dy,dz = {}", CRITERPOS, ArrayUtils.toString(ellipsoidPositionSolution)); if (MAXITER > 10) { logger.error("lp2xyz : MAXITER limit reached! lp2xyz() estimation is diverging?!"); throw new Exception("Orbit.lp2xyz : MAXITER limit reached! lp2xyz() estimation is diverging?!"); } } } return new Point(ellipsoidPosition); } }
Orbit { public Point lph2xyz(final double line, final double pixel, final double height, final SLCImage slcimage) throws Exception { logger.setLevel(Level.OFF); Point satellitePosition; Point satelliteVelocity; Point ellipsoidPosition; double[] equationSet = new double[3]; double[][] partialsXYZ = new double[3][3]; double azTime = slcimage.line2ta(line); double rgTime = slcimage.pix2tr(pixel); satellitePosition = getXYZ(azTime); satelliteVelocity = getXYZDot(azTime); ellipsoidPosition = slcimage.getApproxXYZCentreOriginal(); for (int iter = 0; iter <= MAXITER; iter++) { Point dsat_P = ellipsoidPosition.min(satellitePosition); equationSet[0] = -eq1_Doppler(satelliteVelocity, dsat_P); equationSet[1] = -eq2_Range(dsat_P, rgTime); equationSet[2] = -eq3_Ellipsoid(ellipsoidPosition, height); partialsXYZ[0][0] = satelliteVelocity.x; partialsXYZ[0][1] = satelliteVelocity.y; partialsXYZ[0][2] = satelliteVelocity.z; partialsXYZ[1][0] = 2 * dsat_P.x; partialsXYZ[1][1] = 2 * dsat_P.y; partialsXYZ[1][2] = 2 * dsat_P.z; partialsXYZ[2][0] = (2 * ellipsoidPosition.x) / (Math.pow(ell_a + height, 2)); partialsXYZ[2][1] = (2 * ellipsoidPosition.y) / (Math.pow(ell_a + height, 2)); partialsXYZ[2][2] = (2 * ellipsoidPosition.z) / (Math.pow(ell_b + height, 2)); double[] ellipsoidPositionSolution = LinearAlgebraUtils.solve33(partialsXYZ, equationSet); ellipsoidPosition.x += ellipsoidPositionSolution[0]; ellipsoidPosition.y += ellipsoidPositionSolution[1]; ellipsoidPosition.z += ellipsoidPositionSolution[2]; logger.debug("ellipsoidPosition.x = " + ellipsoidPosition.x); logger.debug("ellipsoidPosition.y = " + ellipsoidPosition.y); logger.debug("ellipsoidPosition.z = " + ellipsoidPosition.z); if (Math.abs(ellipsoidPositionSolution[0]) < CRITERPOS && Math.abs(ellipsoidPositionSolution[1]) < CRITERPOS && Math.abs(ellipsoidPositionSolution[2]) < CRITERPOS) { logger.info("INFO: ellipsoidPosition (converged): {} ", ellipsoidPosition); break; } else if (iter >= MAXITER) { logger.warn("line, pix -> x,y,z: maximum iterations ( {} ) reached.", MAXITER); logger.warn("Criterium (m): {} dx,dy,dz = {}", CRITERPOS, ArrayUtils.toString(ellipsoidPositionSolution)); if (MAXITER > 10) { logger.error("lp2xyz : MAXITER limit reached! lp2xyz() estimation is diverging?!"); throw new Exception("Orbit.lp2xyz : MAXITER limit reached! lp2xyz() estimation is diverging?!"); } } } return new Point(ellipsoidPosition); } Orbit();  Orbit(double[] timeVector, double[] xVector, double[] yVector, double[] zVector, int degree);  Orbit(double[][] stateVectors, int degree);  Orbit(MetadataElement nestMetadataElement, int degree); }
Orbit { public Point lph2xyz(final double line, final double pixel, final double height, final SLCImage slcimage) throws Exception { logger.setLevel(Level.OFF); Point satellitePosition; Point satelliteVelocity; Point ellipsoidPosition; double[] equationSet = new double[3]; double[][] partialsXYZ = new double[3][3]; double azTime = slcimage.line2ta(line); double rgTime = slcimage.pix2tr(pixel); satellitePosition = getXYZ(azTime); satelliteVelocity = getXYZDot(azTime); ellipsoidPosition = slcimage.getApproxXYZCentreOriginal(); for (int iter = 0; iter <= MAXITER; iter++) { Point dsat_P = ellipsoidPosition.min(satellitePosition); equationSet[0] = -eq1_Doppler(satelliteVelocity, dsat_P); equationSet[1] = -eq2_Range(dsat_P, rgTime); equationSet[2] = -eq3_Ellipsoid(ellipsoidPosition, height); partialsXYZ[0][0] = satelliteVelocity.x; partialsXYZ[0][1] = satelliteVelocity.y; partialsXYZ[0][2] = satelliteVelocity.z; partialsXYZ[1][0] = 2 * dsat_P.x; partialsXYZ[1][1] = 2 * dsat_P.y; partialsXYZ[1][2] = 2 * dsat_P.z; partialsXYZ[2][0] = (2 * ellipsoidPosition.x) / (Math.pow(ell_a + height, 2)); partialsXYZ[2][1] = (2 * ellipsoidPosition.y) / (Math.pow(ell_a + height, 2)); partialsXYZ[2][2] = (2 * ellipsoidPosition.z) / (Math.pow(ell_b + height, 2)); double[] ellipsoidPositionSolution = LinearAlgebraUtils.solve33(partialsXYZ, equationSet); ellipsoidPosition.x += ellipsoidPositionSolution[0]; ellipsoidPosition.y += ellipsoidPositionSolution[1]; ellipsoidPosition.z += ellipsoidPositionSolution[2]; logger.debug("ellipsoidPosition.x = " + ellipsoidPosition.x); logger.debug("ellipsoidPosition.y = " + ellipsoidPosition.y); logger.debug("ellipsoidPosition.z = " + ellipsoidPosition.z); if (Math.abs(ellipsoidPositionSolution[0]) < CRITERPOS && Math.abs(ellipsoidPositionSolution[1]) < CRITERPOS && Math.abs(ellipsoidPositionSolution[2]) < CRITERPOS) { logger.info("INFO: ellipsoidPosition (converged): {} ", ellipsoidPosition); break; } else if (iter >= MAXITER) { logger.warn("line, pix -> x,y,z: maximum iterations ( {} ) reached.", MAXITER); logger.warn("Criterium (m): {} dx,dy,dz = {}", CRITERPOS, ArrayUtils.toString(ellipsoidPositionSolution)); if (MAXITER > 10) { logger.error("lp2xyz : MAXITER limit reached! lp2xyz() estimation is diverging?!"); throw new Exception("Orbit.lp2xyz : MAXITER limit reached! lp2xyz() estimation is diverging?!"); } } } return new Point(ellipsoidPosition); } Orbit();  Orbit(double[] timeVector, double[] xVector, double[] yVector, double[] zVector, int degree);  Orbit(double[][] stateVectors, int degree);  Orbit(MetadataElement nestMetadataElement, int degree); void parseOrbit(File file); void setOrbit(double[][] stateVectors); void computeCoefficients(int degree); Point lph2xyz(final double line, final double pixel, final double height, final SLCImage slcimage); synchronized Point lp2xyz(final Point sarPixel, final SLCImage slcimage); synchronized Point lp2xyz(final double line, final double pixel, final SLCImage slcimage); synchronized Point xyz2orb(final Point pointOnEllips, final SLCImage slcimage); synchronized Point lp2orb(final Point sarPixel, final SLCImage slcimage); synchronized Point xyz2t(final Point pointOnEllips, final SLCImage slcimage); synchronized Point xyz2lp(final Point pointOnEllips, final SLCImage slcimage); synchronized Point ell2lp(final double[] phi_lam_height, final SLCImage slcimage); synchronized double[] lp2ell(final Point sarPixel, final SLCImage slcimage); synchronized double[] lph2ell(final double line, final double pixel, final double height, final SLCImage slcimage); synchronized double[] lph2ell(final Point sarPixel, final SLCImage slcimage); synchronized double[] lph2ell(final Point sarPixel, final double height, final SLCImage slcimage); @Deprecated void computeBaseline(); Point getXYZ(final double azTime); Point getXYZDot(double azTime); Point getXYZDotDot(final double azTime); double eq1_Doppler(final Point satVelocity, final Point pointOnEllips); double eq2_Range(final Point pointEllipsSat, final double rgTime); double eq3_Ellipsoid(final Point pointOnEllips, final double height); double eq3_Ellipsoid(final Point pointOnEllips); double eq3_Ellipsoid(final Point pointOnEllips, final double semiMajorA, final double semiMinorB, final double height); Point[][] dumpOrbit(); void showOrbit(); int getNumStateVectors(); double[] getTime(); double[] getData_X(); double[] getData_Y(); double[] getData_Z(); double[] getCoeff_X(); double[] getCoeff_Y(); double[] getCoeff_Z(); int getPoly_degree(); void setPoly_degree(int degree); boolean isInterpolated(); double computeEarthRadius(Point p, SLCImage metadata); double computeOrbitRadius(Point p, SLCImage metadata); double computeAzimuthDelta(Point sarPixel, SLCImage metadata); double computeAzimuthResolution(Point sarPixel, SLCImage metadata); }
Orbit { public Point lph2xyz(final double line, final double pixel, final double height, final SLCImage slcimage) throws Exception { logger.setLevel(Level.OFF); Point satellitePosition; Point satelliteVelocity; Point ellipsoidPosition; double[] equationSet = new double[3]; double[][] partialsXYZ = new double[3][3]; double azTime = slcimage.line2ta(line); double rgTime = slcimage.pix2tr(pixel); satellitePosition = getXYZ(azTime); satelliteVelocity = getXYZDot(azTime); ellipsoidPosition = slcimage.getApproxXYZCentreOriginal(); for (int iter = 0; iter <= MAXITER; iter++) { Point dsat_P = ellipsoidPosition.min(satellitePosition); equationSet[0] = -eq1_Doppler(satelliteVelocity, dsat_P); equationSet[1] = -eq2_Range(dsat_P, rgTime); equationSet[2] = -eq3_Ellipsoid(ellipsoidPosition, height); partialsXYZ[0][0] = satelliteVelocity.x; partialsXYZ[0][1] = satelliteVelocity.y; partialsXYZ[0][2] = satelliteVelocity.z; partialsXYZ[1][0] = 2 * dsat_P.x; partialsXYZ[1][1] = 2 * dsat_P.y; partialsXYZ[1][2] = 2 * dsat_P.z; partialsXYZ[2][0] = (2 * ellipsoidPosition.x) / (Math.pow(ell_a + height, 2)); partialsXYZ[2][1] = (2 * ellipsoidPosition.y) / (Math.pow(ell_a + height, 2)); partialsXYZ[2][2] = (2 * ellipsoidPosition.z) / (Math.pow(ell_b + height, 2)); double[] ellipsoidPositionSolution = LinearAlgebraUtils.solve33(partialsXYZ, equationSet); ellipsoidPosition.x += ellipsoidPositionSolution[0]; ellipsoidPosition.y += ellipsoidPositionSolution[1]; ellipsoidPosition.z += ellipsoidPositionSolution[2]; logger.debug("ellipsoidPosition.x = " + ellipsoidPosition.x); logger.debug("ellipsoidPosition.y = " + ellipsoidPosition.y); logger.debug("ellipsoidPosition.z = " + ellipsoidPosition.z); if (Math.abs(ellipsoidPositionSolution[0]) < CRITERPOS && Math.abs(ellipsoidPositionSolution[1]) < CRITERPOS && Math.abs(ellipsoidPositionSolution[2]) < CRITERPOS) { logger.info("INFO: ellipsoidPosition (converged): {} ", ellipsoidPosition); break; } else if (iter >= MAXITER) { logger.warn("line, pix -> x,y,z: maximum iterations ( {} ) reached.", MAXITER); logger.warn("Criterium (m): {} dx,dy,dz = {}", CRITERPOS, ArrayUtils.toString(ellipsoidPositionSolution)); if (MAXITER > 10) { logger.error("lp2xyz : MAXITER limit reached! lp2xyz() estimation is diverging?!"); throw new Exception("Orbit.lp2xyz : MAXITER limit reached! lp2xyz() estimation is diverging?!"); } } } return new Point(ellipsoidPosition); } Orbit();  Orbit(double[] timeVector, double[] xVector, double[] yVector, double[] zVector, int degree);  Orbit(double[][] stateVectors, int degree);  Orbit(MetadataElement nestMetadataElement, int degree); void parseOrbit(File file); void setOrbit(double[][] stateVectors); void computeCoefficients(int degree); Point lph2xyz(final double line, final double pixel, final double height, final SLCImage slcimage); synchronized Point lp2xyz(final Point sarPixel, final SLCImage slcimage); synchronized Point lp2xyz(final double line, final double pixel, final SLCImage slcimage); synchronized Point xyz2orb(final Point pointOnEllips, final SLCImage slcimage); synchronized Point lp2orb(final Point sarPixel, final SLCImage slcimage); synchronized Point xyz2t(final Point pointOnEllips, final SLCImage slcimage); synchronized Point xyz2lp(final Point pointOnEllips, final SLCImage slcimage); synchronized Point ell2lp(final double[] phi_lam_height, final SLCImage slcimage); synchronized double[] lp2ell(final Point sarPixel, final SLCImage slcimage); synchronized double[] lph2ell(final double line, final double pixel, final double height, final SLCImage slcimage); synchronized double[] lph2ell(final Point sarPixel, final SLCImage slcimage); synchronized double[] lph2ell(final Point sarPixel, final double height, final SLCImage slcimage); @Deprecated void computeBaseline(); Point getXYZ(final double azTime); Point getXYZDot(double azTime); Point getXYZDotDot(final double azTime); double eq1_Doppler(final Point satVelocity, final Point pointOnEllips); double eq2_Range(final Point pointEllipsSat, final double rgTime); double eq3_Ellipsoid(final Point pointOnEllips, final double height); double eq3_Ellipsoid(final Point pointOnEllips); double eq3_Ellipsoid(final Point pointOnEllips, final double semiMajorA, final double semiMinorB, final double height); Point[][] dumpOrbit(); void showOrbit(); int getNumStateVectors(); double[] getTime(); double[] getData_X(); double[] getData_Y(); double[] getData_Z(); double[] getCoeff_X(); double[] getCoeff_Y(); double[] getCoeff_Z(); int getPoly_degree(); void setPoly_degree(int degree); boolean isInterpolated(); double computeEarthRadius(Point p, SLCImage metadata); double computeOrbitRadius(Point p, SLCImage metadata); double computeAzimuthDelta(Point sarPixel, SLCImage metadata); double computeAzimuthResolution(Point sarPixel, SLCImage metadata);  }