From 830732dbc954c95a381d17314e8d42645de6cecd Mon Sep 17 00:00:00 2001 From: Luc Maisonobe <luc@orekit.org> Date: Wed, 23 Apr 2014 11:36:08 +0200 Subject: [PATCH] Renamed ligth travel time compensation into light time correction. This better matches physics naming conventions. --- .../java/org/orekit/rugged/api/Rugged.java | 51 ++++++++++--------- .../org/orekit/rugged/api/RuggedTest.java | 12 ++--- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/main/java/org/orekit/rugged/api/Rugged.java b/src/main/java/org/orekit/rugged/api/Rugged.java index 89d8e96c..2091f5c2 100644 --- a/src/main/java/org/orekit/rugged/api/Rugged.java +++ b/src/main/java/org/orekit/rugged/api/Rugged.java @@ -72,14 +72,14 @@ public class Rugged { /** DEM intersection algorithm. */ private final IntersectionAlgorithm algorithm; - /** Flag for fixing light travel time. */ - private boolean lightTravelTimeCompensated; + /** Flag for light time correction. */ + private boolean lightTimeCorrection; /** Build a configured instance. * <p> - * By default, the instance compensates light travel time, an explicit call - * to {@link #setLightTravelTimeCompensated(boolean) setLightTravelTimeCompensated} - * can be made after construction if it should not be compensated. + * By default, the instance performs light time correction, an explicit call + * to {@link #setLightTimeCorrection(boolean) setLightTimeCorrection} + * can be made after construction if light time should not be corrected. * </p> * @param referenceDate reference date from which all other dates are computed * @param updater updater used to load Digital Elevation Model tiles @@ -120,7 +120,7 @@ public class Rugged { algorithm = selectAlgorithm(algorithmID, updater, maxCachedTiles); sensors = new HashMap<String, Sensor>(); - setLightTravelTimeCompensated(true); + setLightTimeCorrection(true); } catch (OrekitException oe) { throw new RuggedException(oe, oe.getSpecifier(), oe.getParts().clone()); @@ -129,9 +129,9 @@ public class Rugged { /** Build a configured instance. * <p> - * By default, the instance compensates light travel time, an explicit call - * to {@link #setLightTravelTimeCompensated(boolean) setLightTravelTimeCompensated} - * can be made after construction if it should not be compensated. + * By default, the instance performs light time correction, an explicit call + * to {@link #setLightTimeCorrection(boolean) setLightTimeCorrection} + * can be made after construction if light time should not be corrected. * </p> * @param newReferenceDate reference date from which all other dates are computed * @param updater updater used to load Digital Elevation Model tiles @@ -166,7 +166,7 @@ public class Rugged { algorithm = selectAlgorithm(algorithmID, updater, maxCachedTiles); sensors = new HashMap<String, Sensor>(); - setLightTravelTimeCompensated(true); + setLightTimeCorrection(true); } catch (OrekitException oe) { throw new RuggedException(oe, oe.getSpecifier(), oe.getParts().clone()); @@ -180,28 +180,28 @@ public class Rugged { return referenceDate; } - /** Set flag for compensating light travel time. + /** Set flag for light time correction. * <p> - * This methods set the flag for compensating or not light travel time - * between ground and spacecraft. Compensating this delay improves localization + * This methods set the flag for compensating or not light time between + * ground and spacecraft. Compensating this delay improves localization * accuracy and is enabled by default. Not compensating it is mainly useful * for validation purposes against system that do not compensate it. * </p> - * @param lightTravelTimeCompensated if true, the light travel time between ground + * @param lightTimeCorrection if true, the light travel time between ground * and spacecraft is compensated for more accurate localization - * @see #isLightTravelTimeCompensated() + * @see #isLightTimeCorrected() */ - public void setLightTravelTimeCompensated(final boolean lightTravelTimeCompensated) { - this.lightTravelTimeCompensated = lightTravelTimeCompensated; + public void setLightTimeCorrection(final boolean lightTimeCorrection) { + this.lightTimeCorrection = lightTimeCorrection; } - /** Get flag for compensating light travel time. - * @return true if the light travel time between ground - * and spacecraft is compensated for more accurate localization - * @see #setLightTravelTimeCompensated(boolean) + /** Get flag for light time correction. + * @return true if the light time between ground and spacecraft is + * compensated for more accurate localization + * @see #setLightTimeCorrection(boolean) */ - public boolean isLightTravelTimeCompensated() { - return lightTravelTimeCompensated; + public boolean isLightTimeCorrected() { + return lightTimeCorrection; } /** Set up line sensor model. @@ -404,14 +404,15 @@ public class Rugged { for (int i = 0; i < gp.length; ++i) { final Transform fixed; - if (lightTravelTimeCompensated) { - // fix light travel time + if (lightTimeCorrection) { + // compensate light travel time final Vector3D sP = approximate.transformPosition(sensor.getPosition(i)); final Vector3D sL = approximate.transformVector(sensor.getLos(i)); final Vector3D eP = ellipsoid.transform(ellipsoid.pointOnGround(sP, sL)); final double deltaT = eP.distance(sP) / Constants.SPEED_OF_LIGHT; fixed = new Transform(date, scToInert, inertToBody.shiftedBy(-deltaT)); } else { + // don't compensate light travel time fixed = new Transform(date, scToInert, inertToBody); } diff --git a/src/test/java/org/orekit/rugged/api/RuggedTest.java b/src/test/java/org/orekit/rugged/api/RuggedTest.java index 8cbb7de8..2d326895 100644 --- a/src/test/java/org/orekit/rugged/api/RuggedTest.java +++ b/src/test/java/org/orekit/rugged/api/RuggedTest.java @@ -152,9 +152,9 @@ public class RuggedTest { Assert.assertEquals(new AbsoluteDate("2012-01-01T00:00:00", TimeScalesFactory.getUTC()), rugged.getReferenceDate()); - Assert.assertTrue(rugged.isLightTravelTimeCompensated()); - rugged.setLightTravelTimeCompensated(false); - Assert.assertFalse(rugged.isLightTravelTimeCompensated()); + Assert.assertTrue(rugged.isLightTimeCorrected()); + rugged.setLightTimeCorrection(false); + Assert.assertFalse(rugged.isLightTimeCorrected()); } @@ -182,9 +182,9 @@ public class RuggedTest { propagator); Assert.assertEquals(propagator.getInitialState().getDate(), rugged.getReferenceDate()); - Assert.assertTrue(rugged.isLightTravelTimeCompensated()); - rugged.setLightTravelTimeCompensated(false); - Assert.assertFalse(rugged.isLightTravelTimeCompensated()); + Assert.assertTrue(rugged.isLightTimeCorrected()); + rugged.setLightTimeCorrection(false); + Assert.assertFalse(rugged.isLightTimeCorrected()); } -- GitLab