From 66349a3e7853d81d92926e0d835d77935ded89f8 Mon Sep 17 00:00:00 2001 From: Luc Maisonobe <luc@orekit.org> Date: Wed, 17 Aug 2016 11:23:40 +0200 Subject: [PATCH] Updated tutorials after API changes. --- .../markdown/tutorials/direct-location-with-DEM.md | 2 +- src/site/markdown/tutorials/direct-location.md | 5 ++--- .../java/fr/cs/examples/DirectLocation.java | 5 ++--- .../java/fr/cs/examples/DirectLocationWithDEM.java | 13 ++++++------- .../java/fr/cs/examples/InverseLocation.java | 11 +++++------ 5 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/site/markdown/tutorials/direct-location-with-DEM.md b/src/site/markdown/tutorials/direct-location-with-DEM.md index 60e5cb6d..0ce8751e 100644 --- a/src/site/markdown/tutorials/direct-location-with-DEM.md +++ b/src/site/markdown/tutorials/direct-location-with-DEM.md @@ -142,7 +142,7 @@ In a similar way as in the first tutorial [DirectLocation](./direct-location.htm // Call to direct localization on current line Vector3D position = lineSensor.getPosition(); AbsoluteDate currentLineDate = lineSensor.getDate(currentLine); - Vector3D los = lineSensor.getLos(absDate, currentPx); + Vector3D los = lineSensor.getLOS(absDate, currentPx); pointList.add(rugged.directLocation(currentLineDate, position, los)); } for (GeodeticPoint point : pointList) { diff --git a/src/site/markdown/tutorials/direct-location.md b/src/site/markdown/tutorials/direct-location.md index 8eca894b..0866e25b 100644 --- a/src/site/markdown/tutorials/direct-location.md +++ b/src/site/markdown/tutorials/direct-location.md @@ -49,7 +49,6 @@ For this we need the following packages import org.orekit.rugged.los.LOSBuilder; import org.orekit.rugged.los.FixedRotation; import org.orekit.rugged.los.TimeDependentLOS; - import org.orekit.rugged.utils.ParameterType; The raw viewing direction of pixel i with respect to the instrument is defined by the vector: @@ -65,7 +64,7 @@ The instrument is oriented 10° off nadir around the X-axis, we need to rotate t direction to obtain the line of sight in the satellite frame LOSBuilder losBuilder = new LOSBuilder(rawDirs); - losBuilder.addTransform(new FixedRotation(ParameterType.FIXED, Vector3D.PLUS_I, FastMath.toRadians(10))); + losBuilder.addTransform(new FixedRotation("10-degrees-rotation", Vector3D.PLUS_I, FastMath.toRadians(10))); Here we have considered that the viewing directions are constant with time, it is also possible to have time-dependent lines-of-sight by using other transforms. It is also possible to append several @@ -310,7 +309,7 @@ for upper left point (first line, first pixel): import org.orekit.bodies.GeodeticPoint; Vector3D position = lineSensor.getPosition(); // This returns a zero vector since we set the relative position of the sensor w.r.T the satellite to 0. AbsoluteDate firstLineDate = lineSensor.getDate(0); - Vector3D los = lineSensor.getLos(firstLineDate, 0); + Vector3D los = lineSensor.getLOS(firstLineDate, 0); GeodeticPoint upLeftPoint = rugged.directLocation(firstLineDate, position, los); ## Source code diff --git a/src/tutorials/java/fr/cs/examples/DirectLocation.java b/src/tutorials/java/fr/cs/examples/DirectLocation.java index 3ef44796..6e9fa96f 100644 --- a/src/tutorials/java/fr/cs/examples/DirectLocation.java +++ b/src/tutorials/java/fr/cs/examples/DirectLocation.java @@ -43,7 +43,6 @@ import org.orekit.rugged.linesensor.LinearLineDatation; import org.orekit.rugged.los.LOSBuilder; import org.orekit.rugged.los.FixedRotation; import org.orekit.rugged.los.TimeDependentLOS; -import org.orekit.rugged.utils.ParameterType; import org.orekit.time.AbsoluteDate; import org.orekit.time.TimeScale; import org.orekit.time.TimeScalesFactory; @@ -75,7 +74,7 @@ public class DirectLocation { // The instrument is oriented 10° off nadir around the X-axis, we need to rotate the viewing // direction to obtain the line of sight in the satellite frame LOSBuilder losBuilder = new LOSBuilder(rawDirs); - losBuilder.addTransform(new FixedRotation(ParameterType.FIXED, Vector3D.PLUS_I, FastMath.toRadians(10))); + losBuilder.addTransform(new FixedRotation("10-degrees-rotation", Vector3D.PLUS_I, FastMath.toRadians(10))); TimeDependentLOS lineOfSight = losBuilder.build(); @@ -132,7 +131,7 @@ public class DirectLocation { Vector3D position = lineSensor.getPosition(); // This returns a zero vector since we set the relative position of the sensor w.r.T the satellite to 0. AbsoluteDate firstLineDate = lineSensor.getDate(0); - Vector3D los = lineSensor.getLos(firstLineDate, 0); + Vector3D los = lineSensor.getLOS(firstLineDate, 0); GeodeticPoint upLeftPoint = rugged.directLocation(firstLineDate, position, los); System.out.format(Locale.US, "upper left point: φ = %8.3f °, λ = %8.3f °, h = %8.3f m%n", FastMath.toDegrees(upLeftPoint.getLatitude()), diff --git a/src/tutorials/java/fr/cs/examples/DirectLocationWithDEM.java b/src/tutorials/java/fr/cs/examples/DirectLocationWithDEM.java index 1cfee486..ebbddc73 100644 --- a/src/tutorials/java/fr/cs/examples/DirectLocationWithDEM.java +++ b/src/tutorials/java/fr/cs/examples/DirectLocationWithDEM.java @@ -16,14 +16,14 @@ */ package fr.cs.examples; -import org.hipparchus.geometry.euclidean.threed.Rotation; -import org.hipparchus.geometry.euclidean.threed.Vector3D; -import org.hipparchus.util.FastMath; import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Locale; +import org.hipparchus.geometry.euclidean.threed.Rotation; +import org.hipparchus.geometry.euclidean.threed.Vector3D; +import org.hipparchus.util.FastMath; import org.orekit.bodies.GeodeticPoint; import org.orekit.data.DataProvidersManager; import org.orekit.data.DirectoryCrawler; @@ -40,12 +40,11 @@ import org.orekit.rugged.api.RuggedBuilder; import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.linesensor.LineSensor; import org.orekit.rugged.linesensor.LinearLineDatation; -import org.orekit.rugged.los.LOSBuilder; import org.orekit.rugged.los.FixedRotation; +import org.orekit.rugged.los.LOSBuilder; import org.orekit.rugged.los.TimeDependentLOS; import org.orekit.rugged.raster.TileUpdater; import org.orekit.rugged.raster.UpdatableTile; -import org.orekit.rugged.utils.ParameterType; import org.orekit.time.AbsoluteDate; import org.orekit.time.TimeScale; import org.orekit.time.TimeScalesFactory; @@ -78,7 +77,7 @@ public class DirectLocationWithDEM { // The instrument is oriented 10° off nadir around the X-axis, we need to rotate the viewing // direction to obtain the line of sight in the satellite frame LOSBuilder losBuilder = new LOSBuilder(rawDirs); - losBuilder.addTransform(new FixedRotation(ParameterType.FIXED, Vector3D.PLUS_I, FastMath.toRadians(10))); + losBuilder.addTransform(new FixedRotation("10-degrees-rotation", Vector3D.PLUS_I, FastMath.toRadians(10))); TimeDependentLOS lineOfSight = losBuilder.build(); @@ -142,7 +141,7 @@ public class DirectLocationWithDEM { Vector3D position = lineSensor.getPosition(); // This returns a zero vector since we set the relative position of the sensor w.r.T the satellite to 0. AbsoluteDate firstLineDate = lineSensor.getDate(0); - Vector3D los = lineSensor.getLos(firstLineDate, 0); + Vector3D los = lineSensor.getLOS(firstLineDate, 0); GeodeticPoint upLeftPoint = rugged.directLocation(firstLineDate, position, los); System.out.format(Locale.US, "upper left point: φ = %8.3f °, λ = %8.3f °, h = %8.3f m%n", FastMath.toDegrees(upLeftPoint.getLatitude()), diff --git a/src/tutorials/java/fr/cs/examples/InverseLocation.java b/src/tutorials/java/fr/cs/examples/InverseLocation.java index 9828f9ce..e8c2df5a 100644 --- a/src/tutorials/java/fr/cs/examples/InverseLocation.java +++ b/src/tutorials/java/fr/cs/examples/InverseLocation.java @@ -16,14 +16,14 @@ */ package fr.cs.examples; -import org.hipparchus.geometry.euclidean.threed.Rotation; -import org.hipparchus.geometry.euclidean.threed.Vector3D; -import org.hipparchus.util.FastMath; import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Locale; +import org.hipparchus.geometry.euclidean.threed.Rotation; +import org.hipparchus.geometry.euclidean.threed.Vector3D; +import org.hipparchus.util.FastMath; import org.orekit.bodies.GeodeticPoint; import org.orekit.data.DataProvidersManager; import org.orekit.data.DirectoryCrawler; @@ -41,10 +41,9 @@ import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.linesensor.LineSensor; import org.orekit.rugged.linesensor.LinearLineDatation; import org.orekit.rugged.linesensor.SensorPixel; -import org.orekit.rugged.los.LOSBuilder; import org.orekit.rugged.los.FixedRotation; +import org.orekit.rugged.los.LOSBuilder; import org.orekit.rugged.los.TimeDependentLOS; -import org.orekit.rugged.utils.ParameterType; import org.orekit.time.AbsoluteDate; import org.orekit.time.TimeScale; import org.orekit.time.TimeScalesFactory; @@ -76,7 +75,7 @@ public class InverseLocation { // The instrument is oriented 10° off nadir around the X-axis, we need to rotate the viewing // direction to obtain the line of sight in the satellite frame LOSBuilder losBuilder = new LOSBuilder(rawDirs); - losBuilder.addTransform(new FixedRotation(ParameterType.FIXED, Vector3D.PLUS_I, FastMath.toRadians(10))); + losBuilder.addTransform(new FixedRotation("10-degrees-rotation", Vector3D.PLUS_I, FastMath.toRadians(10))); TimeDependentLOS lineOfSight = losBuilder.build(); -- GitLab