Skip to content
Snippets Groups Projects
Commit 90b320fc authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Fixing light travel time or not is now a user setting.

parent 418b1259
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,9 @@ public class Rugged {
/** DEM intersection algorithm. */
private final IntersectionAlgorithm algorithm;
/** Flag for fixing light travel time. */
private final boolean fixLightTravelTime;
/** Build a configured instance.
* <p>
* This method is the first one that must be called, otherwise the
......@@ -85,6 +88,8 @@ public class Rugged {
* @param ellipsoidID identifier of reference ellipsoid
* @param inertialFrameID identifier of inertial frame
* @param bodyRotatingFrameID identifier of body rotating frame
* @param fixLightTravelTime if true, light travel time should be fixed when computing
* direct and inverse localization
* @param positionsVelocities satellite position and velocity
* @param pvInterpolationOrder order to use for position/velocity interpolation
* @param quaternions satellite quaternions
......@@ -95,6 +100,7 @@ public class Rugged {
final TileUpdater updater, final int maxCachedTiles,
final AlgorithmId algorithmID, final EllipsoidId ellipsoidID,
final InertialFrameId inertialFrameID, final BodyRotatingFrameId bodyRotatingFrameID,
final boolean fixLightTravelTime,
final List<Pair<AbsoluteDate, PVCoordinates>> positionsVelocities, final int pvInterpolationOrder,
final List<Pair<AbsoluteDate, Rotation>> quaternions, final int aInterpolationOrder)
throws RuggedException {
......@@ -114,6 +120,7 @@ public class Rugged {
// intersection algorithm
algorithm = selectAlgorithm(algorithmID, updater, maxCachedTiles);
this.fixLightTravelTime = fixLightTravelTime;
sensors = new HashMap<String, Sensor>();
......@@ -134,6 +141,8 @@ public class Rugged {
* @param ellipsoidID identifier of reference ellipsoid
* @param inertialFrameID identifier of inertial frame
* @param bodyRotatingFrameID identifier of body rotating frame
* @param fixLightTravelTime if true, light travel time should be fixed when computing
* direct and inverse localization
* @param propagator global propagator
* @exception RuggedException if data needed for some frame cannot be loaded
*/
......@@ -141,6 +150,7 @@ public class Rugged {
final TileUpdater updater, final int maxCachedTiles,
final AlgorithmId algorithmID, final EllipsoidId ellipsoidID,
final InertialFrameId inertialFrameID, final BodyRotatingFrameId bodyRotatingFrameID,
final boolean fixLightTravelTime,
final Propagator propagator)
throws RuggedException {
try {
......@@ -158,6 +168,7 @@ public class Rugged {
// intersection algorithm
algorithm = selectAlgorithm(algorithmID, updater, maxCachedTiles);
this.fixLightTravelTime = fixLightTravelTime;
sensors = new HashMap<String, Sensor>();
......@@ -372,12 +383,17 @@ public class Rugged {
final GeodeticPoint[] gp = new GeodeticPoint[sensor.getNbPixels()];
for (int i = 0; i < gp.length; ++i) {
// fix 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;
final Transform fixed = new Transform(date, scToInert, inertToBody.shiftedBy(-deltaT));
final Transform fixed;
if (fixLightTravelTime) {
// fix 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 {
fixed = new Transform(date, scToInert, inertToBody);
}
gp[i] = algorithm.intersection(ellipsoid,
fixed.transformPosition(sensor.getPosition(i)),
......
......@@ -148,7 +148,7 @@ public class RuggedTest {
EllipsoidId.WGS84,
InertialFrameId.EME2000,
BodyRotatingFrameId.ITRF,
pv, 8, q, 8);
true, pv, 8, q, 8);
Assert.assertEquals(new AbsoluteDate("2012-01-01T00:00:00", TimeScalesFactory.getUTC()),
rugged.getReferenceDate());
......@@ -176,7 +176,7 @@ public class RuggedTest {
EllipsoidId.WGS84,
InertialFrameId.EME2000,
BodyRotatingFrameId.ITRF,
propagator);
true, propagator);
Assert.assertEquals(propagator.getInitialState().getDate(), rugged.getReferenceDate());
......@@ -226,7 +226,7 @@ public class RuggedTest {
EllipsoidId.WGS84,
InertialFrameId.EME2000,
BodyRotatingFrameId.ITRF,
ephemeris);
true, ephemeris);
rugged.setLineSensor("line", los, lineDatation);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment