From 7148aedc2e5253a6e7c03aac71dadf7704fe2236 Mon Sep 17 00:00:00 2001 From: Guylaine Prat <guylaine.prat@c-s.fr> Date: Fri, 14 Dec 2018 15:02:30 +0100 Subject: [PATCH] Remove throws RuggedException (and OrekitExcepotion), cleanup javadoc Fixes #373 --- .../rugged/adjustment/AdjustmentContext.java | 4 +- .../GroundOptimizationProblemBuilder.java | 1 - .../java/org/orekit/rugged/api/Rugged.java | 2 +- .../org/orekit/rugged/api/RuggedBuilder.java | 12 +---- .../org/orekit/rugged/errors/DumpManager.java | 3 -- .../orekit/rugged/errors/DumpReplayer.java | 5 +- .../orekit/rugged/errors/RuggedException.java | 2 +- .../orekit/rugged/errors/RuggedMessages.java | 2 +- .../intersection/BasicScanAlgorithm.java | 8 ++- .../ConstantElevationAlgorithm.java | 4 +- .../intersection/IgnoreDEMAlgorithm.java | 1 - .../intersection/IntersectionAlgorithm.java | 2 +- .../duvenhage/DuvenhageAlgorithm.java | 3 +- .../orekit/rugged/linesensor/LineSensor.java | 2 - .../org/orekit/rugged/los/FixedRotation.java | 4 +- .../orekit/rugged/los/FixedZHomothety.java | 4 +- .../org/orekit/rugged/los/LOSBuilder.java | 4 +- .../orekit/rugged/los/PolynomialRotation.java | 4 +- .../java/org/orekit/rugged/raster/Tile.java | 13 ++--- .../org/orekit/rugged/raster/TileUpdater.java | 6 +-- .../org/orekit/rugged/raster/TilesCache.java | 4 +- .../orekit/rugged/raster/UpdatableTile.java | 10 +--- .../AtmosphericComputationParameters.java | 6 +-- .../refraction/AtmosphericRefraction.java | 17 ++----- .../rugged/refraction/MultiLayerModel.java | 15 ++---- .../rugged/utils/ExtendedEllipsoid.java | 18 ++----- .../utils/RoughVisibilityEstimator.java | 11 ++-- .../utils/SpacecraftToObservedBody.java | 21 +++----- .../java/org/orekit/rugged/TestUtils.java | 14 +++-- .../adjustment/AdjustmentContextTest.java | 4 +- .../GroundOptimizationProblemBuilderTest.java | 10 ++-- ...rSensorOptimizationProblemBuilderTest.java | 19 +++---- .../util/InitGroundRefiningTest.java | 10 ++-- .../util/InitInterRefiningTest.java | 24 +++------ .../adjustment/util/PleiadesOrbitModel.java | 15 ++---- .../adjustment/util/PleiadesViewingModel.java | 14 ++--- .../util/RefiningParametersDriver.java | 29 ++++------- .../orekit/rugged/api/RuggedBuilderTest.java | 30 +++++------ .../org/orekit/rugged/api/RuggedTest.java | 51 +++++++------------ .../orekit/rugged/errors/DumpManagerTest.java | 11 ++-- .../rugged/errors/DumpReplayerTest.java | 1 - .../intersection/AbstractAlgorithmTest.java | 22 ++++---- .../ConstantElevationAlgorithmTest.java | 13 ++--- .../duvenhage/DuvenhageAlgorithmTest.java | 4 +- .../duvenhage/MinMaxTreeTileTest.java | 5 +- .../rugged/linesensor/FixedRotationTest.java | 2 - .../linesensor/PolynomialRotationTest.java | 2 - .../SensorMeanPlaneCrossingTest.java | 12 ++--- .../CheckedPatternElevationUpdater.java | 1 - .../rugged/raster/CliffsElevationUpdater.java | 1 - .../rugged/raster/RandomLandscapeUpdater.java | 5 +- .../orekit/rugged/raster/TilesCacheTest.java | 3 -- .../raster/VolcanicConeElevationUpdater.java | 1 - .../refraction/MultiLayerModelTest.java | 11 ++-- .../utils/RoughVisibilityEstimatorTest.java | 5 +- .../examples/refiningPleiades/Refining.java | 7 ++- .../GroundMeasurementGenerator.java | 5 +- .../generators/InterMeasurementGenerator.java | 1 - .../metrics/LocalisationMetrics.java | 5 +- .../refiningPleiades/models/OrbitModel.java | 1 - .../models/PleiadesViewingModel.java | 18 +++---- 61 files changed, 177 insertions(+), 367 deletions(-) diff --git a/src/main/java/org/orekit/rugged/adjustment/AdjustmentContext.java b/src/main/java/org/orekit/rugged/adjustment/AdjustmentContext.java index da495fe8..bea9eb7b 100644 --- a/src/main/java/org/orekit/rugged/adjustment/AdjustmentContext.java +++ b/src/main/java/org/orekit/rugged/adjustment/AdjustmentContext.java @@ -25,13 +25,11 @@ import java.util.Map; import org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresOptimizer.Optimum; import org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem; -import org.orekit.errors.OrekitException; +import org.orekit.rugged.adjustment.measurements.Observables; import org.orekit.rugged.api.Rugged; import org.orekit.rugged.errors.RuggedException; -import org.orekit.rugged.errors.RuggedExceptionWrapper; import org.orekit.rugged.errors.RuggedMessages; import org.orekit.rugged.linesensor.LineSensor; -import org.orekit.rugged.adjustment.measurements.Observables; /** Create adjustment context for viewing model refining. * @author Lucie LabatAllee diff --git a/src/main/java/org/orekit/rugged/adjustment/GroundOptimizationProblemBuilder.java b/src/main/java/org/orekit/rugged/adjustment/GroundOptimizationProblemBuilder.java index f816658f..dcbec62d 100644 --- a/src/main/java/org/orekit/rugged/adjustment/GroundOptimizationProblemBuilder.java +++ b/src/main/java/org/orekit/rugged/adjustment/GroundOptimizationProblemBuilder.java @@ -38,7 +38,6 @@ import org.orekit.rugged.adjustment.measurements.Observables; import org.orekit.rugged.adjustment.measurements.SensorToGroundMapping; import org.orekit.rugged.api.Rugged; import org.orekit.rugged.errors.RuggedException; -import org.orekit.rugged.errors.RuggedExceptionWrapper; import org.orekit.rugged.errors.RuggedMessages; import org.orekit.rugged.linesensor.LineSensor; import org.orekit.rugged.linesensor.SensorPixel; diff --git a/src/main/java/org/orekit/rugged/api/Rugged.java b/src/main/java/org/orekit/rugged/api/Rugged.java index e0bd10cb..10c3af12 100644 --- a/src/main/java/org/orekit/rugged/api/Rugged.java +++ b/src/main/java/org/orekit/rugged/api/Rugged.java @@ -1169,9 +1169,9 @@ public class Rugged { /** Get a sensor. * @param sensorName sensor name * @return selected sensor - * @exception RuggedException if sensor is not known */ public LineSensor getLineSensor(final String sensorName) { + final LineSensor sensor = sensors.get(sensorName); if (sensor == null) { throw new RuggedException(RuggedMessages.UNKNOWN_SENSOR, sensorName); diff --git a/src/main/java/org/orekit/rugged/api/RuggedBuilder.java b/src/main/java/org/orekit/rugged/api/RuggedBuilder.java index e1351a3a..7b8eac7d 100644 --- a/src/main/java/org/orekit/rugged/api/RuggedBuilder.java +++ b/src/main/java/org/orekit/rugged/api/RuggedBuilder.java @@ -29,7 +29,6 @@ import org.hipparchus.exception.LocalizedCoreFormats; import org.hipparchus.geometry.euclidean.threed.Rotation; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.orekit.bodies.OneAxisEllipsoid; -import org.orekit.errors.OrekitException; import org.orekit.frames.Frame; import org.orekit.frames.FramesFactory; import org.orekit.propagation.Propagator; @@ -575,8 +574,6 @@ public class RuggedBuilder { * @param storageStream stream from where to read previous instance {@link #storeInterpolator(OutputStream) * stored interpolator} (caller opened it and remains responsible for closing it) * @return the builder instance - * @exception RuggedException if storage stream cannot be parsed - * or if frames do not match the ones referenced in the storage stream * @see #setTrajectory(InertialFrameId, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter) * @see #setTrajectory(Frame, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter) * @see #setTrajectory(double, int, CartesianDerivativesFilter, AngularDerivativesFilter, Propagator) @@ -625,7 +622,6 @@ public class RuggedBuilder { * </p> * @param storageStream stream where to store the interpolator * (caller opened it and remains responsible for closing it) - * @exception RuggedException if interpolator cannot be written to stream * @see #setEllipsoid(EllipsoidId, BodyRotatingFrameId) * @see #setEllipsoid(OneAxisEllipsoid) * @see #setTrajectory(InertialFrameId, List, int, CartesianDerivativesFilter, List, int, AngularDerivativesFilter) @@ -643,21 +639,17 @@ public class RuggedBuilder { } /** Check frames consistency. - * @exception RuggedException if frames have been set both by direct calls and by - * deserializing an interpolator dump and a mismatch occurs */ private void checkFramesConsistency() { if (ellipsoid != null && scToBody != null && !ellipsoid.getBodyFrame().getName().equals(scToBody.getBodyFrame().getName())) { + // if frames have been set both by direct calls and by deserializing an interpolator dump and a mismatch occurs throw new RuggedException(RuggedMessages.FRAMES_MISMATCH_WITH_INTERPOLATOR_DUMP, ellipsoid.getBodyFrame().getName(), scToBody.getBodyFrame().getName()); } } /** Create a transform interpolator if needed. - * @exception RuggedException if data needed for some frame cannot be loaded or if position - * or attitude samples do not fully cover the [{@code minDate}, {@code maxDate}] search time span, - * or propagator fails. */ private void createInterpolatorIfNeeded() { @@ -972,8 +964,6 @@ public class RuggedBuilder { /** Build a {@link Rugged} instance. * @return built instance - * @exception RuggedException if the builder is not properly configured - * or if some internal elements cannot be built (frames, ephemerides, ...) */ public Rugged build() { diff --git a/src/main/java/org/orekit/rugged/errors/DumpManager.java b/src/main/java/org/orekit/rugged/errors/DumpManager.java index d351d511..a63a0a10 100644 --- a/src/main/java/org/orekit/rugged/errors/DumpManager.java +++ b/src/main/java/org/orekit/rugged/errors/DumpManager.java @@ -56,8 +56,6 @@ public class DumpManager { /** Activate debug dump. * @param file dump file - * @exception RuggedException if debug dump is already active for this thread - * or if debug file cannot be opened */ public static void activate(final File file) { if (isActive()) { @@ -73,7 +71,6 @@ public class DumpManager { } /** Deactivate debug dump. - * @exception RuggedException if debug dump is already active for this thread */ public static void deactivate() { if (isActive()) { diff --git a/src/main/java/org/orekit/rugged/errors/DumpReplayer.java b/src/main/java/org/orekit/rugged/errors/DumpReplayer.java index c8a7cb22..085abcf8 100644 --- a/src/main/java/org/orekit/rugged/errors/DumpReplayer.java +++ b/src/main/java/org/orekit/rugged/errors/DumpReplayer.java @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 CS Systèmes d'Information +/* Copyright 2013-2018 CS Systèmes d'Information * Licensed to CS Systèmes d'Information (CS) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -45,7 +45,6 @@ import org.hipparchus.util.OpenIntToDoubleHashMap; import org.hipparchus.util.Pair; import org.orekit.bodies.GeodeticPoint; import org.orekit.bodies.OneAxisEllipsoid; -import org.orekit.errors.OrekitException; import org.orekit.frames.Frame; import org.orekit.frames.FramesFactory; import org.orekit.frames.Predefined; @@ -271,7 +270,6 @@ public class DumpReplayer { /** Parse a dump file. * @param file dump file to parse - * @exception RuggedException if file cannot be parsed */ public void parse(final File file) { try { @@ -289,7 +287,6 @@ public class DumpReplayer { /** Create a Rugged instance from parsed data. * @return rugged instance - * @exception RuggedException if some data are inconsistent or incomplete */ public Rugged createRugged() { try { diff --git a/src/main/java/org/orekit/rugged/errors/RuggedException.java b/src/main/java/org/orekit/rugged/errors/RuggedException.java index 7f3a09f0..d4a6059d 100644 --- a/src/main/java/org/orekit/rugged/errors/RuggedException.java +++ b/src/main/java/org/orekit/rugged/errors/RuggedException.java @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 CS Systèmes d'Information +/* Copyright 2013-2018 CS Systèmes d'Information * Licensed to CS Systèmes d'Information (CS) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. diff --git a/src/main/java/org/orekit/rugged/errors/RuggedMessages.java b/src/main/java/org/orekit/rugged/errors/RuggedMessages.java index 34515e6b..63467a7e 100644 --- a/src/main/java/org/orekit/rugged/errors/RuggedMessages.java +++ b/src/main/java/org/orekit/rugged/errors/RuggedMessages.java @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 CS Systèmes d'Information +/* Copyright 2013-2018 CS Systèmes d'Information * Licensed to CS Systèmes d'Information (CS) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. diff --git a/src/main/java/org/orekit/rugged/intersection/BasicScanAlgorithm.java b/src/main/java/org/orekit/rugged/intersection/BasicScanAlgorithm.java index 0ff21228..c32a9fb9 100644 --- a/src/main/java/org/orekit/rugged/intersection/BasicScanAlgorithm.java +++ b/src/main/java/org/orekit/rugged/intersection/BasicScanAlgorithm.java @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 CS Systèmes d'Information +/* Copyright 2013-2018 CS Systèmes d'Information * Licensed to CS Systèmes d'Information (CS) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -16,16 +16,14 @@ */ package org.orekit.rugged.intersection; -import org.hipparchus.geometry.euclidean.threed.Vector3D; -import org.hipparchus.util.FastMath; import java.util.ArrayList; import java.util.List; +import org.hipparchus.geometry.euclidean.threed.Vector3D; +import org.hipparchus.util.FastMath; import org.orekit.bodies.GeodeticPoint; -import org.orekit.errors.OrekitException; import org.orekit.rugged.api.AlgorithmId; import org.orekit.rugged.errors.DumpManager; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.raster.SimpleTile; import org.orekit.rugged.raster.SimpleTileFactory; import org.orekit.rugged.raster.Tile; diff --git a/src/main/java/org/orekit/rugged/intersection/ConstantElevationAlgorithm.java b/src/main/java/org/orekit/rugged/intersection/ConstantElevationAlgorithm.java index af339229..e7a77fd1 100644 --- a/src/main/java/org/orekit/rugged/intersection/ConstantElevationAlgorithm.java +++ b/src/main/java/org/orekit/rugged/intersection/ConstantElevationAlgorithm.java @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 CS Systèmes d'Information +/* Copyright 2013-2018 CS Systèmes d'Information * Licensed to CS Systèmes d'Information (CS) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -18,10 +18,8 @@ package org.orekit.rugged.intersection; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.orekit.bodies.GeodeticPoint; -import org.orekit.errors.OrekitException; import org.orekit.rugged.api.AlgorithmId; import org.orekit.rugged.errors.DumpManager; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.utils.ExtendedEllipsoid; import org.orekit.rugged.utils.NormalizedGeodeticPoint; diff --git a/src/main/java/org/orekit/rugged/intersection/IgnoreDEMAlgorithm.java b/src/main/java/org/orekit/rugged/intersection/IgnoreDEMAlgorithm.java index 8c03e200..7c3e6587 100644 --- a/src/main/java/org/orekit/rugged/intersection/IgnoreDEMAlgorithm.java +++ b/src/main/java/org/orekit/rugged/intersection/IgnoreDEMAlgorithm.java @@ -19,7 +19,6 @@ package org.orekit.rugged.intersection; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.orekit.rugged.api.AlgorithmId; import org.orekit.rugged.errors.DumpManager; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.utils.ExtendedEllipsoid; import org.orekit.rugged.utils.NormalizedGeodeticPoint; diff --git a/src/main/java/org/orekit/rugged/intersection/IntersectionAlgorithm.java b/src/main/java/org/orekit/rugged/intersection/IntersectionAlgorithm.java index e3e00c4c..41f67a36 100644 --- a/src/main/java/org/orekit/rugged/intersection/IntersectionAlgorithm.java +++ b/src/main/java/org/orekit/rugged/intersection/IntersectionAlgorithm.java @@ -17,7 +17,7 @@ package org.orekit.rugged.intersection; import org.hipparchus.geometry.euclidean.threed.Vector3D; -import org.orekit.rugged.errors.RuggedException; +import org.orekit.bodies.GeodeticPoint; import org.orekit.rugged.utils.ExtendedEllipsoid; import org.orekit.rugged.utils.NormalizedGeodeticPoint; diff --git a/src/main/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithm.java b/src/main/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithm.java index f76e6b76..b88a52f0 100644 --- a/src/main/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithm.java +++ b/src/main/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithm.java @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 CS Systèmes d'Information +/* Copyright 2013-2018 CS Systèmes d'Information * Licensed to CS Systèmes d'Information (CS) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -19,7 +19,6 @@ package org.orekit.rugged.intersection.duvenhage; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; import org.orekit.bodies.GeodeticPoint; -import org.orekit.errors.OrekitException; import org.orekit.rugged.api.AlgorithmId; import org.orekit.rugged.errors.DumpManager; import org.orekit.rugged.errors.RuggedException; diff --git a/src/main/java/org/orekit/rugged/linesensor/LineSensor.java b/src/main/java/org/orekit/rugged/linesensor/LineSensor.java index 132f0631..abecdad9 100644 --- a/src/main/java/org/orekit/rugged/linesensor/LineSensor.java +++ b/src/main/java/org/orekit/rugged/linesensor/LineSensor.java @@ -23,7 +23,6 @@ import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; import org.orekit.rugged.errors.DumpManager; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.los.TimeDependentLOS; import org.orekit.rugged.utils.DSGenerator; import org.orekit.time.AbsoluteDate; @@ -101,7 +100,6 @@ public class LineSensor { * @param date current date * @param i pixel index (must be between 0 and {@link #getNbPixels()} - 1 * @return pixel normalized line-of-sight - * @exception RuggedException if date cannot be handled * @since 2.0 */ public Vector3D getLOS(final AbsoluteDate date, final double i) { diff --git a/src/main/java/org/orekit/rugged/los/FixedRotation.java b/src/main/java/org/orekit/rugged/los/FixedRotation.java index 8f79e7ab..0035ae89 100644 --- a/src/main/java/org/orekit/rugged/los/FixedRotation.java +++ b/src/main/java/org/orekit/rugged/los/FixedRotation.java @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 CS Systèmes d'Information +/* Copyright 2013-2018 CS Systèmes d'Information * Licensed to CS Systèmes d'Information (CS) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -25,8 +25,6 @@ import org.hipparchus.geometry.euclidean.threed.Rotation; import org.hipparchus.geometry.euclidean.threed.RotationConvention; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; -import org.orekit.errors.OrekitException; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.utils.DSGenerator; import org.orekit.utils.ParameterDriver; import org.orekit.utils.ParameterObserver; diff --git a/src/main/java/org/orekit/rugged/los/FixedZHomothety.java b/src/main/java/org/orekit/rugged/los/FixedZHomothety.java index 429da97c..a00406ae 100644 --- a/src/main/java/org/orekit/rugged/los/FixedZHomothety.java +++ b/src/main/java/org/orekit/rugged/los/FixedZHomothety.java @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 CS Systèmes d'Information +/* Copyright 2013-2018 CS Systèmes d'Information * Licensed to CS Systèmes d'Information (CS) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -22,8 +22,6 @@ import org.hipparchus.analysis.differentiation.DerivativeStructure; import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; -import org.orekit.errors.OrekitException; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.utils.DSGenerator; import org.orekit.utils.ParameterDriver; import org.orekit.utils.ParameterObserver; diff --git a/src/main/java/org/orekit/rugged/los/LOSBuilder.java b/src/main/java/org/orekit/rugged/los/LOSBuilder.java index 57e630b2..66daf936 100644 --- a/src/main/java/org/orekit/rugged/los/LOSBuilder.java +++ b/src/main/java/org/orekit/rugged/los/LOSBuilder.java @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 CS Systèmes d'Information +/* Copyright 2013-2018 CS Systèmes d'Information * Licensed to CS Systèmes d'Information (CS) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -24,8 +24,6 @@ import java.util.stream.Stream; import org.hipparchus.analysis.differentiation.DerivativeStructure; import org.hipparchus.geometry.euclidean.threed.FieldVector3D; import org.hipparchus.geometry.euclidean.threed.Vector3D; -import org.orekit.errors.OrekitException; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.utils.DSGenerator; import org.orekit.time.AbsoluteDate; import org.orekit.utils.ParameterDriver; diff --git a/src/main/java/org/orekit/rugged/los/PolynomialRotation.java b/src/main/java/org/orekit/rugged/los/PolynomialRotation.java index d7c6e965..80c2fb58 100644 --- a/src/main/java/org/orekit/rugged/los/PolynomialRotation.java +++ b/src/main/java/org/orekit/rugged/los/PolynomialRotation.java @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 CS Systèmes d'Information +/* Copyright 2013-2018 CS Systèmes d'Information * Licensed to CS Systèmes d'Information (CS) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -26,8 +26,6 @@ import org.hipparchus.geometry.euclidean.threed.Rotation; import org.hipparchus.geometry.euclidean.threed.RotationConvention; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; -import org.orekit.errors.OrekitException; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.utils.DSGenerator; import org.orekit.time.AbsoluteDate; import org.orekit.utils.ParameterDriver; diff --git a/src/main/java/org/orekit/rugged/raster/Tile.java b/src/main/java/org/orekit/rugged/raster/Tile.java index 2756ac0c..81de1b64 100644 --- a/src/main/java/org/orekit/rugged/raster/Tile.java +++ b/src/main/java/org/orekit/rugged/raster/Tile.java @@ -18,7 +18,6 @@ package org.orekit.rugged.raster; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.orekit.bodies.GeodeticPoint; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.utils.NormalizedGeodeticPoint; /** Interface representing a raster tile. @@ -238,10 +237,8 @@ public interface Tile extends UpdatableTile { * @param latitudeIndex grid point index along latitude * @param longitudeIndex grid point index along longitude * @return elevation at grid point - * @exception RuggedException if indices are out of bound */ - double getElevationAtIndices(int latitudeIndex, int longitudeIndex) - throws RuggedException; + double getElevationAtIndices(int latitudeIndex, int longitudeIndex); /** Interpolate elevation. * <p> @@ -255,10 +252,8 @@ public interface Tile extends UpdatableTile { * @param latitude ground point latitude * @param longitude ground point longitude * @return interpolated elevation - * @exception RuggedException if point is farthest from the tile than the tolerance */ - double interpolateElevation(double latitude, double longitude) - throws RuggedException; + double interpolateElevation(double latitude, double longitude); /** Find the intersection of a line-of-sight and a Digital Elevation Model cell. * @param p point on the line @@ -268,11 +263,9 @@ public interface Tile extends UpdatableTile { * @param longitudeIndex longitude index of the Digital Elevation Model cell * @return point corresponding to line-of-sight crossing the Digital Elevation Model surface * if it lies within the cell, null otherwise - * @exception RuggedException if intersection point cannot be computed */ NormalizedGeodeticPoint cellIntersection(GeodeticPoint p, Vector3D los, - int latitudeIndex, int longitudeIndex) - throws RuggedException; + int latitudeIndex, int longitudeIndex); /** Check if a tile covers a ground point. * @param latitude ground point latitude diff --git a/src/main/java/org/orekit/rugged/raster/TileUpdater.java b/src/main/java/org/orekit/rugged/raster/TileUpdater.java index c76c96a8..089a0885 100644 --- a/src/main/java/org/orekit/rugged/raster/TileUpdater.java +++ b/src/main/java/org/orekit/rugged/raster/TileUpdater.java @@ -16,8 +16,6 @@ */ package org.orekit.rugged.raster; -import org.orekit.rugged.errors.RuggedException; - /** Interface used to update Digital Elevation Model tiles. * <p> * Implementations of this interface are must be provided by @@ -80,9 +78,7 @@ public interface TileUpdater { * @param latitude latitude that must be covered by the tile (rad) * @param longitude longitude that must be covered by the tile (rad) * @param tile to update - * @exception RuggedException if tile cannot be updated */ - void updateTile(double latitude, double longitude, UpdatableTile tile) - throws RuggedException; + void updateTile(double latitude, double longitude, UpdatableTile tile); } diff --git a/src/main/java/org/orekit/rugged/raster/TilesCache.java b/src/main/java/org/orekit/rugged/raster/TilesCache.java index 11712412..c970779d 100644 --- a/src/main/java/org/orekit/rugged/raster/TilesCache.java +++ b/src/main/java/org/orekit/rugged/raster/TilesCache.java @@ -57,10 +57,8 @@ public class TilesCache<T extends Tile> { * @param latitude ground point latitude * @param longitude ground point longitude * @return tile covering the ground point - * @exception RuggedException if newly created tile cannot be updated */ - public T getTile(final double latitude, final double longitude) - throws RuggedException { + public T getTile(final double latitude, final double longitude) { for (int i = 0; i < tiles.length; ++i) { final T tile = tiles[i]; diff --git a/src/main/java/org/orekit/rugged/raster/UpdatableTile.java b/src/main/java/org/orekit/rugged/raster/UpdatableTile.java index 606aec1b..4f5dbc9b 100644 --- a/src/main/java/org/orekit/rugged/raster/UpdatableTile.java +++ b/src/main/java/org/orekit/rugged/raster/UpdatableTile.java @@ -16,8 +16,6 @@ */ package org.orekit.rugged.raster; -import org.orekit.rugged.errors.RuggedException; - /** Interface representing one tile of a raster Digital Elevation Model. * @author Luc Maisonobe * @author Guylaine Prat @@ -31,12 +29,10 @@ public interface UpdatableTile { * @param longitudeStep step in longitude (size of one raster element) (rad) * @param latitudeRows number of latitude rows * @param longitudeColumns number of longitude columns - * @exception RuggedException if tile is empty (zero rows or columns) */ void setGeometry(double minLatitude, double minLongitude, double latitudeStep, double longitudeStep, - int latitudeRows, int longitudeColumns) - throws RuggedException; + int latitudeRows, int longitudeColumns); /** Set the elevation for one raster element. * <p> @@ -52,9 +48,7 @@ public interface UpdatableTile { * @param latitudeIndex index of latitude (row index) * @param longitudeIndex index of longitude (column index) * @param elevation elevation (m) - * @exception RuggedException if indices are out of bound */ - void setElevation(int latitudeIndex, int longitudeIndex, double elevation) - throws RuggedException; + void setElevation(int latitudeIndex, int longitudeIndex, double elevation); } diff --git a/src/main/java/org/orekit/rugged/refraction/AtmosphericComputationParameters.java b/src/main/java/org/orekit/rugged/refraction/AtmosphericComputationParameters.java index 0ca61c4d..257eec8b 100644 --- a/src/main/java/org/orekit/rugged/refraction/AtmosphericComputationParameters.java +++ b/src/main/java/org/orekit/rugged/refraction/AtmosphericComputationParameters.java @@ -74,9 +74,8 @@ public class AtmosphericComputationParameters { * @param sensor line sensor * @param minLine min line defined for the inverse location * @param maxLine max line defined for the inverse location - * @throws RuggedException if invalid range for lines */ - public void configureCorrectionGrid(final LineSensor sensor, final int minLine, final int maxLine) throws RuggedException { + public void configureCorrectionGrid(final LineSensor sensor, final int minLine, final int maxLine) { // Keep information about the sensor and the required search lines. // Needed to test if the grid is initialized with this context. @@ -110,9 +109,8 @@ public class AtmosphericComputationParameters { * Overwrite the default values, for time optimization if necessary. * @param gridPixelStep grid pixel step for the inverse location computation * @param gridLineStep grid line step for the inverse location computation - * @throws RuggedException if invalid steps */ - public void setGridSteps(final int gridPixelStep, final int gridLineStep) throws RuggedException { + public void setGridSteps(final int gridPixelStep, final int gridLineStep) { if (gridPixelStep <= 0) { final String reason = " pixelStep <= 0"; diff --git a/src/main/java/org/orekit/rugged/refraction/AtmosphericRefraction.java b/src/main/java/org/orekit/rugged/refraction/AtmosphericRefraction.java index 961db64f..af4ea0bf 100644 --- a/src/main/java/org/orekit/rugged/refraction/AtmosphericRefraction.java +++ b/src/main/java/org/orekit/rugged/refraction/AtmosphericRefraction.java @@ -74,13 +74,11 @@ public abstract class AtmosphericRefraction { * @param rawIntersection intersection point before refraction correction * @param algorithm intersection algorithm * @return corrected point with the effect of atmospheric refraction - * @throws RuggedException if there is no refraction data at altitude of rawIntersection or see * {@link org.orekit.rugged.utils.ExtendedEllipsoid#pointAtAltitude(Vector3D, Vector3D, double)} or see * {@link org.orekit.rugged.intersection.IntersectionAlgorithm#refineIntersection(org.orekit.rugged.utils.ExtendedEllipsoid, Vector3D, Vector3D, NormalizedGeodeticPoint)} */ public abstract NormalizedGeodeticPoint applyCorrection(Vector3D satPos, Vector3D satLos, NormalizedGeodeticPoint rawIntersection, - IntersectionAlgorithm algorithm) - throws RuggedException; + IntersectionAlgorithm algorithm); /** Apply correction to the intersected point with an atmospheric refraction model, * using a time optimized algorithm. @@ -91,15 +89,13 @@ public abstract class AtmosphericRefraction { * @param rawIntersection intersection point before refraction correction * @param algorithm intersection algorithm * @return corrected point with the effect of atmospheric refraction - * @throws RuggedException if there is no refraction data at altitude of rawIntersection or see * {@link org.orekit.rugged.utils.ExtendedEllipsoid#pointAtAltitude(Vector3D, Vector3D, double)} or see * {@link org.orekit.rugged.intersection.IntersectionAlgorithm#refineIntersection(org.orekit.rugged.utils.ExtendedEllipsoid, Vector3D, Vector3D, NormalizedGeodeticPoint)} * @since 3.0 */ public abstract NormalizedGeodeticPoint applyCorrection(LineSensor lineSensor, SensorPixel sensorPixel, Vector3D satPos, Vector3D satLos, NormalizedGeodeticPoint rawIntersection, - IntersectionAlgorithm algorithm) - throws RuggedException; + IntersectionAlgorithm algorithm); /** Deactivate computation (needed for the inverse location computation). * @since 3.0 @@ -136,9 +132,8 @@ public abstract class AtmosphericRefraction { * @param sensor line sensor * @param minLine min line defined for the inverse location * @param maxLine max line defined for the inverse location - * @throws RuggedException if invalid range for lines */ - public void configureCorrectionGrid(final LineSensor sensor, final int minLine, final int maxLine) throws RuggedException { + public void configureCorrectionGrid(final LineSensor sensor, final int minLine, final int maxLine) { atmosphericParams.configureCorrectionGrid(sensor, minLine, maxLine); } @@ -167,9 +162,8 @@ public abstract class AtmosphericRefraction { * Overwrite the default values, for time optimization for instance. * @param pixelStep pixel step for the inverse location computation * @param lineStep line step for the inverse location computation - * @throws RuggedException if invalid steps */ - public void setGridSteps(final int pixelStep, final int lineStep) throws RuggedException { + public void setGridSteps(final int pixelStep, final int lineStep) { atmosphericParams.setGridSteps(pixelStep, lineStep); } @@ -180,9 +174,8 @@ public abstract class AtmosphericRefraction { * The bilinear interpolating functions are then computed for pixel and for line. * Need to be computed only once for a given sensor with the same minLine and maxLine. * @param sensorPixelGridInverseWithout inverse location grid WITHOUT atmospheric refraction - * @throws RuggedException if invalid range for lines */ - public void computeGridCorrectionFunctions(final SensorPixel[][] sensorPixelGridInverseWithout) throws RuggedException { + public void computeGridCorrectionFunctions(final SensorPixel[][] sensorPixelGridInverseWithout) { // Compute for a sensor grid, the associated ground grid, WITH atmospheric effect // (for interpolations we need a regular grid) diff --git a/src/main/java/org/orekit/rugged/refraction/MultiLayerModel.java b/src/main/java/org/orekit/rugged/refraction/MultiLayerModel.java index db8bd800..7b8b7f14 100644 --- a/src/main/java/org/orekit/rugged/refraction/MultiLayerModel.java +++ b/src/main/java/org/orekit/rugged/refraction/MultiLayerModel.java @@ -54,9 +54,8 @@ public class MultiLayerModel extends AtmosphericRefraction { * This model uses a built-in set of layers. * </p> * @param ellipsoid the ellipsoid to be used. - * @throws RuggedException if problem at layers construction */ - public MultiLayerModel(final ExtendedEllipsoid ellipsoid) throws RuggedException { + public MultiLayerModel(final ExtendedEllipsoid ellipsoid) { super(); @@ -86,10 +85,8 @@ public class MultiLayerModel extends AtmosphericRefraction { /** Simple constructor. * @param ellipsoid the ellipsoid to be used. * @param refractionLayers the refraction layers to be used with this model (layers can be in any order). - * @throws RuggedException if problem at layers construction */ - public MultiLayerModel(final ExtendedEllipsoid ellipsoid, final List<ConstantRefractionLayer> refractionLayers) - throws RuggedException { + public MultiLayerModel(final ExtendedEllipsoid ellipsoid, final List<ConstantRefractionLayer> refractionLayers) { super(); // at this stage no optimization is set up: no optimization grid is defined @@ -110,12 +107,11 @@ public class MultiLayerModel extends AtmosphericRefraction { * @param satLos satellite line of sight, in body frame * @param rawIntersection intersection point without refraction correction * @return the intersection position and LOS with the lowest atmospheric layer - * @throws RuggedException if no layer data at asked altitude * @since 3.0 */ private IntersectionLOS computeToLowestAtmosphereLayer( final Vector3D satPos, final Vector3D satLos, - final NormalizedGeodeticPoint rawIntersection) throws RuggedException { + final NormalizedGeodeticPoint rawIntersection) { if (rawIntersection.getAltitude() < atmosphereLowestAltitude) { throw new RuggedException(RuggedMessages.NO_LAYER_DATA, rawIntersection.getAltitude(), @@ -241,7 +237,7 @@ public class MultiLayerModel extends AtmosphericRefraction { public NormalizedGeodeticPoint applyCorrection(final Vector3D satPos, final Vector3D satLos, final NormalizedGeodeticPoint rawIntersection, final IntersectionAlgorithm algorithm) - throws RuggedException { + { final IntersectionLOS intersectionLOS = computeToLowestAtmosphereLayer(satPos, satLos, rawIntersection); final Vector3D pos = intersectionLOS.getIntersectionPos(); @@ -258,8 +254,7 @@ public class MultiLayerModel extends AtmosphericRefraction { public NormalizedGeodeticPoint applyCorrection(final LineSensor lineSensor, final SensorPixel sensorPixel, final Vector3D satPos, final Vector3D satLos, final NormalizedGeodeticPoint rawIntersection, - final IntersectionAlgorithm algorithm) - throws RuggedException { + final IntersectionAlgorithm algorithm) { // TODO to be done throw new RuggedException(RuggedMessages.UNINITIALIZED_CONTEXT, "Atmospheric optimization for direct loc"); diff --git a/src/main/java/org/orekit/rugged/utils/ExtendedEllipsoid.java b/src/main/java/org/orekit/rugged/utils/ExtendedEllipsoid.java index 81b8a8d7..c95060af 100644 --- a/src/main/java/org/orekit/rugged/utils/ExtendedEllipsoid.java +++ b/src/main/java/org/orekit/rugged/utils/ExtendedEllipsoid.java @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 CS Systèmes d'Information +/* Copyright 2013-2018 CS Systèmes d'Information * Licensed to CS Systèmes d'Information (CS) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -22,7 +22,6 @@ import org.hipparchus.util.FastMath; import org.hipparchus.util.MathArrays; import org.orekit.bodies.GeodeticPoint; import org.orekit.bodies.OneAxisEllipsoid; -import org.orekit.errors.OrekitException; import org.orekit.frames.Frame; import org.orekit.rugged.errors.DumpManager; import org.orekit.rugged.errors.RuggedException; @@ -68,8 +67,7 @@ public class ExtendedEllipsoid extends OneAxisEllipsoid { /** {@inheritDoc} */ @Override - public GeodeticPoint transform(final Vector3D point, final Frame frame, final AbsoluteDate date) - throws OrekitException { + public GeodeticPoint transform(final Vector3D point, final Frame frame, final AbsoluteDate date) { DumpManager.dumpEllipsoid(this); return super.transform(point, frame, date); } @@ -82,11 +80,9 @@ public class ExtendedEllipsoid extends OneAxisEllipsoid { * when there are two points at the desired latitude along the line, it should * be close to los surface intersection (m) * @return point at latitude (m) - * @exception RuggedException if no such point exists */ public Vector3D pointAtLatitude(final Vector3D position, final Vector3D los, - final double latitude, final Vector3D closeReference) - throws RuggedException { + final double latitude, final Vector3D closeReference) { DumpManager.dumpEllipsoid(this); @@ -165,10 +161,8 @@ public class ExtendedEllipsoid extends OneAxisEllipsoid { * @param los pixel line-of-sight, not necessarily normalized (in body frame) * @param longitude longitude with respect to ellipsoid (rad) * @return point at longitude (m) - * @exception RuggedException if no such point exists */ - public Vector3D pointAtLongitude(final Vector3D position, final Vector3D los, final double longitude) - throws RuggedException { + public Vector3D pointAtLongitude(final Vector3D position, final Vector3D los, final double longitude) { DumpManager.dumpEllipsoid(this); @@ -307,11 +301,9 @@ public class ExtendedEllipsoid extends OneAxisEllipsoid { * @param centralLongitude reference longitude lc such that the point longitude will * be normalized between lc-π and lc+π (rad) * @return point at the same location but as a surface-relative point - * @exception OrekitException if point cannot be converted to body frame */ public NormalizedGeodeticPoint transform(final Vector3D point, final Frame frame, final AbsoluteDate date, - final double centralLongitude) - throws OrekitException { + final double centralLongitude) { final GeodeticPoint gp = transform(point, frame, date); return new NormalizedGeodeticPoint(gp.getLatitude(), gp.getLongitude(), gp.getAltitude(), centralLongitude); diff --git a/src/main/java/org/orekit/rugged/utils/RoughVisibilityEstimator.java b/src/main/java/org/orekit/rugged/utils/RoughVisibilityEstimator.java index 300ab31d..a47cf4c5 100644 --- a/src/main/java/org/orekit/rugged/utils/RoughVisibilityEstimator.java +++ b/src/main/java/org/orekit/rugged/utils/RoughVisibilityEstimator.java @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 CS Systèmes d'Information +/* Copyright 2013-2018 CS Systèmes d'Information * Licensed to CS Systèmes d'Information (CS) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -16,14 +16,13 @@ */ package org.orekit.rugged.utils; -import org.hipparchus.geometry.euclidean.threed.Vector3D; -import org.hipparchus.util.FastMath; import java.util.ArrayList; import java.util.List; +import org.hipparchus.geometry.euclidean.threed.Vector3D; +import org.hipparchus.util.FastMath; import org.orekit.bodies.GeodeticPoint; import org.orekit.bodies.OneAxisEllipsoid; -import org.orekit.errors.OrekitException; import org.orekit.frames.Frame; import org.orekit.frames.Transform; import org.orekit.time.AbsoluteDate; @@ -64,11 +63,9 @@ public class RoughVisibilityEstimator { * @param ellipsoid ground ellipsoid * @param frame frame in which position and velocity are defined (may be inertial or body frame) * @param positionsVelocities satellite position and velocity (m and m/s in specified frame) - * @exception OrekitException if position-velocity cannot be converted to body frame */ public RoughVisibilityEstimator(final OneAxisEllipsoid ellipsoid, final Frame frame, - final List<TimeStampedPVCoordinates> positionsVelocities) - throws OrekitException { + final List<TimeStampedPVCoordinates> positionsVelocities) { this.ellipsoid = ellipsoid; diff --git a/src/main/java/org/orekit/rugged/utils/SpacecraftToObservedBody.java b/src/main/java/org/orekit/rugged/utils/SpacecraftToObservedBody.java index 0ffb7479..3d4c61ba 100644 --- a/src/main/java/org/orekit/rugged/utils/SpacecraftToObservedBody.java +++ b/src/main/java/org/orekit/rugged/utils/SpacecraftToObservedBody.java @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 CS Systèmes d'Information +/* Copyright 2013-2018 CS Systèmes d'Information * Licensed to CS Systèmes d'Information (CS) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -16,13 +16,12 @@ */ package org.orekit.rugged.utils; -import org.hipparchus.util.FastMath; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -import org.orekit.errors.OrekitException; +import org.hipparchus.util.FastMath; import org.orekit.frames.Frame; import org.orekit.frames.Transform; import org.orekit.rugged.errors.DumpManager; @@ -253,30 +252,24 @@ public class SpacecraftToObservedBody implements Serializable { /** Get transform from spacecraft to inertial frame. * @param date date of the transform * @return transform from spacecraft to inertial frame - * @exception RuggedException if frames cannot be computed at date */ - public Transform getScToInertial(final AbsoluteDate date) - throws RuggedException { + public Transform getScToInertial(final AbsoluteDate date) { return interpolate(date, scToInertial); } /** Get transform from inertial frame to observed body frame. * @param date date of the transform * @return transform from inertial frame to observed body frame - * @exception RuggedException if frames cannot be computed at date */ - public Transform getInertialToBody(final AbsoluteDate date) - throws RuggedException { + public Transform getInertialToBody(final AbsoluteDate date) { return interpolate(date, inertialToBody); } /** Get transform from observed body frame to inertial frame. * @param date date of the transform * @return transform from observed body frame to inertial frame - * @exception RuggedException if frames cannot be computed at date */ - public Transform getBodyToInertial(final AbsoluteDate date) - throws RuggedException { + public Transform getBodyToInertial(final AbsoluteDate date) { return interpolate(date, bodyToInertial); } @@ -284,10 +277,8 @@ public class SpacecraftToObservedBody implements Serializable { * @param date date of the transform * @param list transforms list to interpolate from * @return interpolated transform - * @exception RuggedException if frames cannot be computed at date */ - private Transform interpolate(final AbsoluteDate date, final List<Transform> list) - throws RuggedException { + private Transform interpolate(final AbsoluteDate date, final List<Transform> list) { // check date range if (!isInRange(date)) { diff --git a/src/test/java/org/orekit/rugged/TestUtils.java b/src/test/java/org/orekit/rugged/TestUtils.java index 39e8ea6d..fbef4fc3 100644 --- a/src/test/java/org/orekit/rugged/TestUtils.java +++ b/src/test/java/org/orekit/rugged/TestUtils.java @@ -17,13 +17,6 @@ package org.orekit.rugged; -import org.hipparchus.geometry.euclidean.threed.Rotation; -import org.hipparchus.geometry.euclidean.threed.RotationConvention; -import org.hipparchus.geometry.euclidean.threed.Vector3D; -import org.hipparchus.ode.nonstiff.DormandPrince853Integrator; -import org.hipparchus.util.FastMath; -import org.junit.Assert; - import static org.junit.Assert.assertEquals; import java.lang.reflect.Field; @@ -32,6 +25,12 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import org.hipparchus.geometry.euclidean.threed.Rotation; +import org.hipparchus.geometry.euclidean.threed.RotationConvention; +import org.hipparchus.geometry.euclidean.threed.Vector3D; +import org.hipparchus.ode.nonstiff.DormandPrince853Integrator; +import org.hipparchus.util.FastMath; +import org.junit.Assert; import org.orekit.attitudes.AttitudeProvider; import org.orekit.attitudes.NadirPointing; import org.orekit.attitudes.YawCompensation; @@ -40,7 +39,6 @@ import org.orekit.bodies.CelestialBodyFactory; import org.orekit.bodies.GeodeticPoint; import org.orekit.bodies.OneAxisEllipsoid; import org.orekit.data.DataProvidersManager; -import org.orekit.errors.OrekitException; import org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel; import org.orekit.forces.gravity.ThirdBodyAttraction; import org.orekit.forces.gravity.potential.GravityFieldFactory; diff --git a/src/test/java/org/orekit/rugged/adjustment/AdjustmentContextTest.java b/src/test/java/org/orekit/rugged/adjustment/AdjustmentContextTest.java index e897ecdf..f7dd7482 100644 --- a/src/test/java/org/orekit/rugged/adjustment/AdjustmentContextTest.java +++ b/src/test/java/org/orekit/rugged/adjustment/AdjustmentContextTest.java @@ -62,7 +62,7 @@ public class AdjustmentContextTest { } @Test - public void testAdjustmentContext() throws RuggedException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { + public void testAdjustmentContext() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { AdjustmentContext adjustmentContext = new AdjustmentContext(ruggedList, measurements); @@ -86,7 +86,7 @@ public class AdjustmentContextTest { } @Test - public void testEstimateFreeParameters() throws RuggedException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { + public void testEstimateFreeParameters() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { AdjustmentContext adjustmentContext = new AdjustmentContext(ruggedList, measurements); diff --git a/src/test/java/org/orekit/rugged/adjustment/GroundOptimizationProblemBuilderTest.java b/src/test/java/org/orekit/rugged/adjustment/GroundOptimizationProblemBuilderTest.java index 00e50fab..be7ad216 100644 --- a/src/test/java/org/orekit/rugged/adjustment/GroundOptimizationProblemBuilderTest.java +++ b/src/test/java/org/orekit/rugged/adjustment/GroundOptimizationProblemBuilderTest.java @@ -1,7 +1,6 @@ package org.orekit.rugged.adjustment; import java.lang.reflect.Field; - import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -11,14 +10,11 @@ import java.util.Map.Entry; import java.util.Set; import org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresOptimizer.Optimum; - import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; - import org.orekit.bodies.GeodeticPoint; -import org.orekit.errors.OrekitException; import org.orekit.rugged.TestUtils; import org.orekit.rugged.adjustment.measurements.Observables; import org.orekit.rugged.adjustment.measurements.SensorToGroundMapping; @@ -53,7 +49,7 @@ public class GroundOptimizationProblemBuilderTest { } @Test - public void testEstimateFreeParameters() throws RuggedException { + public void testEstimateFreeParameters() { AdjustmentContext adjustmentContext = new AdjustmentContext(Collections.singletonList(rugged), measurements); final int maxIterations = 50; @@ -88,7 +84,7 @@ public class GroundOptimizationProblemBuilderTest { } @Test - public void testNoParametersSelected() throws RuggedException, OrekitException { + public void testNoParametersSelected() { try { RefiningParametersDriver.unselectRoll(rugged, sensorName); RefiningParametersDriver.unselectPitch(rugged, sensorName); @@ -131,7 +127,7 @@ public class GroundOptimizationProblemBuilderTest { } @Test - public void testDefaultRuggedName() throws RuggedException { + public void testDefaultRuggedName(){ // Get the measurements as computed in other tests Collection<SensorToGroundMapping> sensorToGroundMapping = measurements.getGroundMappings(); diff --git a/src/test/java/org/orekit/rugged/adjustment/InterSensorOptimizationProblemBuilderTest.java b/src/test/java/org/orekit/rugged/adjustment/InterSensorOptimizationProblemBuilderTest.java index 6018cda9..5a56cc1f 100644 --- a/src/test/java/org/orekit/rugged/adjustment/InterSensorOptimizationProblemBuilderTest.java +++ b/src/test/java/org/orekit/rugged/adjustment/InterSensorOptimizationProblemBuilderTest.java @@ -17,7 +17,6 @@ package org.orekit.rugged.adjustment; import java.lang.reflect.Field; - import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; @@ -32,14 +31,12 @@ import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; - import org.orekit.rugged.TestUtils; import org.orekit.rugged.adjustment.measurements.Observables; import org.orekit.rugged.adjustment.measurements.SensorToSensorMapping; import org.orekit.rugged.adjustment.util.InitInterRefiningTest; import org.orekit.rugged.api.Rugged; import org.orekit.rugged.errors.RuggedException; -import org.orekit.rugged.errors.RuggedExceptionWrapper; import org.orekit.rugged.errors.RuggedMessages; import org.orekit.rugged.linesensor.LineSensor; import org.orekit.rugged.linesensor.SensorPixel; @@ -66,7 +63,7 @@ public class InterSensorOptimizationProblemBuilderTest { } @Test - public void testEstimateFreeParameters() throws RuggedException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { + public void testEstimateFreeParameters() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { AdjustmentContext adjustmentContext = new AdjustmentContext(ruggedList, measurements); @@ -108,7 +105,7 @@ public class InterSensorOptimizationProblemBuilderTest { } @Test - public void testEarthConstraintPostponed() throws RuggedException { + public void testEarthConstraintPostponed() { // Get the measurements as computed in other tests Collection<SensorToSensorMapping> sensorToSensorMapping = measurements.getInterMappings(); @@ -190,7 +187,7 @@ public class InterSensorOptimizationProblemBuilderTest { } @Test - public void testDefaultRuggedNames() throws RuggedException { + public void testDefaultRuggedNames() { // In that case there are no body distance set at construction @@ -286,7 +283,7 @@ public class InterSensorOptimizationProblemBuilderTest { } @Test - public void testInvalidRuggedNames() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, RuggedException { + public void testInvalidRuggedNames() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { final int maxIterations = 120; final double convergenceThreshold = 1.e-7; @@ -314,8 +311,8 @@ public class InterSensorOptimizationProblemBuilderTest { adjuster.optimize(theProblem); Assert.fail("An exception should have been thrown"); - } catch (RuggedExceptionWrapper re) { - Assert.assertEquals(RuggedMessages.INVALID_RUGGED_NAME,re.getException().getSpecifier()); + } catch (RuggedException re) { + Assert.assertEquals(RuggedMessages.INVALID_RUGGED_NAME,re.getSpecifier()); } // Then set RuggedA to null to get the right exception ... @@ -329,8 +326,8 @@ public class InterSensorOptimizationProblemBuilderTest { adjuster.optimize(theProblem); Assert.fail("An exception should have been thrown"); - } catch (RuggedExceptionWrapper re) { - Assert.assertEquals(RuggedMessages.INVALID_RUGGED_NAME,re.getException().getSpecifier()); + } catch (RuggedException re) { + Assert.assertEquals(RuggedMessages.INVALID_RUGGED_NAME,re.getSpecifier()); } } diff --git a/src/test/java/org/orekit/rugged/adjustment/util/InitGroundRefiningTest.java b/src/test/java/org/orekit/rugged/adjustment/util/InitGroundRefiningTest.java index 4cdb8be5..ce0739a6 100644 --- a/src/test/java/org/orekit/rugged/adjustment/util/InitGroundRefiningTest.java +++ b/src/test/java/org/orekit/rugged/adjustment/util/InitGroundRefiningTest.java @@ -25,7 +25,6 @@ import org.orekit.rugged.api.EllipsoidId; import org.orekit.rugged.api.InertialFrameId; import org.orekit.rugged.api.Rugged; import org.orekit.rugged.api.RuggedBuilder; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.linesensor.LineSensor; import org.orekit.rugged.linesensor.SensorPixel; import org.orekit.time.AbsoluteDate; @@ -65,9 +64,8 @@ public class InitGroundRefiningTest { /** * Initialize ground refining tests with default values for disruptions on sensors characteristics - * @throws RuggedException */ - public void initGroundRefiningTest() throws RuggedException { + public void initGroundRefiningTest() { initGroundRefiningTest(defaultRollDisruption, defaultPitchDisruption, defaultFactorDisruption); } @@ -76,9 +74,8 @@ public class InitGroundRefiningTest { * @param rollDisruption disruption to apply to roll angle for sensor (deg) * @param pitchDisruption disruption to apply to pitch angle for sensor (deg) * @param factorDisruption disruption to apply to homothety factor for sensor - * @throws RuggedException */ - public void initGroundRefiningTest(double rollDisruption, double pitchDisruption, double factorDisruption) throws RuggedException { + public void initGroundRefiningTest(double rollDisruption, double pitchDisruption, double factorDisruption) { try { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); @@ -177,9 +174,8 @@ public class InitGroundRefiningTest { * @param lineSampling line sampling * @param pixelSampling pixel sampling * @param flag to tell if the Rugged name used is the default one (true) or not (false) - * @throws RuggedException */ - public Observables generateNoisyPoints(final int lineSampling, final int pixelSampling, boolean defaultRuggedName) throws RuggedException { + public Observables generateNoisyPoints(final int lineSampling, final int pixelSampling, boolean defaultRuggedName) { // Generate reference mapping SensorToGroundMapping groundMapping; diff --git a/src/test/java/org/orekit/rugged/adjustment/util/InitInterRefiningTest.java b/src/test/java/org/orekit/rugged/adjustment/util/InitInterRefiningTest.java index 68bb5c96..ecb5679f 100644 --- a/src/test/java/org/orekit/rugged/adjustment/util/InitInterRefiningTest.java +++ b/src/test/java/org/orekit/rugged/adjustment/util/InitInterRefiningTest.java @@ -31,7 +31,6 @@ import org.orekit.rugged.api.EllipsoidId; import org.orekit.rugged.api.InertialFrameId; import org.orekit.rugged.api.Rugged; import org.orekit.rugged.api.RuggedBuilder; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.linesensor.LineSensor; import org.orekit.rugged.linesensor.SensorPixel; import org.orekit.rugged.utils.DSGenerator; @@ -86,9 +85,8 @@ public class InitInterRefiningTest { /** * Initialize refining tests with default values for disruptions on sensors characteristics - * @throws RuggedException */ - public void initRefiningTest() throws RuggedException { + public void initRefiningTest() { initRefiningTest(defaultRollDisruptionA, defaultPitchDisruptionA, defaultFactorDisruptionA, defaultRollDisruptionB, defaultPitchDisruptionB); @@ -100,10 +98,9 @@ public class InitInterRefiningTest { * @param factorDisruptionA disruption to apply to homothety factor for sensor A * @param rollDisruptionB disruption to apply to roll angle for sensor B (deg) * @param pitchDisruptionB disruption to apply to pitch angle for sensor B (deg) - * @throws RuggedException */ public void initRefiningTest(double rollDisruptionA, double pitchDisruptionA, double factorDisruptionA, - double rollDisruptionB, double pitchDisruptionB) throws RuggedException { + double rollDisruptionB, double pitchDisruptionB) { try { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); @@ -251,9 +248,8 @@ public class InitInterRefiningTest { * @param realPixelA real pixel from sensor A * @param realPixelB real pixel from sensor B * @return the distances of two real pixels computed between LOS and to the ground - * @throws RuggedException */ - public double[] computeDistancesBetweenLOS(final SensorPixel realPixelA, final SensorPixel realPixelB) throws RuggedException { + public double[] computeDistancesBetweenLOS(final SensorPixel realPixelA, final SensorPixel realPixelB) { final SpacecraftToObservedBody scToBodyA = ruggedA.getScToBody(); @@ -272,16 +268,10 @@ public class InitInterRefiningTest { * @param realPixelA real pixel from sensor A * @param realPixelB real pixel from sensor B * @return the distances of two real pixels computed between LOS and to the ground - * @throws RuggedException - * @throws SecurityException - * @throws NoSuchMethodException - * @throws InvocationTargetException - * @throws IllegalArgumentException - * @throws IllegalAccessException */ public DerivativeStructure[] computeDistancesBetweenLOSDerivatives(final SensorPixel realPixelA, final SensorPixel realPixelB, double losDistance, double earthDistance) - throws RuggedException, NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { final SpacecraftToObservedBody scToBodyA = ruggedA.getScToBody(); @@ -327,9 +317,8 @@ public class InitInterRefiningTest { * @param pixelSampling pixel sampling * @param earthConstraintWeight the earth constrint weight * @param earthConstraintPostponed flag to tell if the earth constraint weight is set at construction (false) or after (true) - For JUnit coverage purpose - * @throws RuggedException */ - public Observables generateNoisyPoints(final int lineSampling, final int pixelSampling, final double earthConstraintWeight, final boolean earthConstraintPostponed) throws RuggedException { + public Observables generateNoisyPoints(final int lineSampling, final int pixelSampling, final double earthConstraintWeight, final boolean earthConstraintPostponed) { // Outliers control final double outlierValue = 1.e+2; @@ -437,9 +426,8 @@ public class InitInterRefiningTest { * @param pixelSampling pixel sampling * @param earthConstraintWeight the earth constrint weight * @param earthConstraintPostponed flag to tell if the earth constraint weight is set at construction (false) or after (true) - For JUnit coverage purpose - * @throws RuggedException */ - public Observables generateSimpleInterMapping(final int lineSampling, final int pixelSampling, final double earthConstraintWeight, final boolean earthConstraintPostponed) throws RuggedException { + public Observables generateSimpleInterMapping(final int lineSampling, final int pixelSampling, final double earthConstraintWeight, final boolean earthConstraintPostponed) { // Outliers control final double outlierValue = 1.e+2; diff --git a/src/test/java/org/orekit/rugged/adjustment/util/PleiadesOrbitModel.java b/src/test/java/org/orekit/rugged/adjustment/util/PleiadesOrbitModel.java index bd7ef95e..5f76ebb8 100644 --- a/src/test/java/org/orekit/rugged/adjustment/util/PleiadesOrbitModel.java +++ b/src/test/java/org/orekit/rugged/adjustment/util/PleiadesOrbitModel.java @@ -14,7 +14,6 @@ import org.orekit.attitudes.NadirPointing; import org.orekit.attitudes.TabulatedLofOffset; import org.orekit.attitudes.YawCompensation; import org.orekit.bodies.BodyShape; -import org.orekit.errors.OrekitException; import org.orekit.frames.Frame; import org.orekit.frames.FramesFactory; import org.orekit.frames.LOFType; @@ -57,7 +56,7 @@ public class PleiadesOrbitModel { /** Create a circular orbit. */ - public Orbit createOrbit(final double mu, final AbsoluteDate date) throws OrekitException { + public Orbit createOrbit(final double mu, final AbsoluteDate date) { // the following orbital parameters have been computed using // Orekit tutorial about phasing, using the following configuration: @@ -109,8 +108,7 @@ public class PleiadesOrbitModel { /** Get the offset. */ - private Rotation getOffset(final BodyShape earth, final Orbit orbit, final double shift) - throws OrekitException { + private Rotation getOffset(final BodyShape earth, final Orbit orbit, final double shift) { final LOFType type = LOFType.VVLH; final double roll = getPoly(lofTransformRollPoly, shift); @@ -133,8 +131,7 @@ public class PleiadesOrbitModel { /** Create the attitude provider. */ - public AttitudeProvider createAttitudeProvider(final BodyShape earth, final Orbit orbit) - throws OrekitException { + public AttitudeProvider createAttitudeProvider(final BodyShape earth, final Orbit orbit) { if (userDefinedLOFTransform) { final LOFType type = LOFType.VVLH; @@ -161,8 +158,7 @@ public class PleiadesOrbitModel { */ public List<TimeStampedPVCoordinates> orbitToPV(final Orbit orbit, final BodyShape earth, final AbsoluteDate minDate, final AbsoluteDate maxDate, - final double step) - throws OrekitException { + final double step) { final Propagator propagator = new KeplerianPropagator(orbit); @@ -185,8 +181,7 @@ public class PleiadesOrbitModel { */ public List<TimeStampedAngularCoordinates> orbitToQ(final Orbit orbit, final BodyShape earth, final AbsoluteDate minDate, final AbsoluteDate maxDate, - final double step) - throws OrekitException { + final double step) { final Propagator propagator = new KeplerianPropagator(orbit); propagator.setAttitudeProvider(createAttitudeProvider(earth, orbit)); diff --git a/src/test/java/org/orekit/rugged/adjustment/util/PleiadesViewingModel.java b/src/test/java/org/orekit/rugged/adjustment/util/PleiadesViewingModel.java index 244258a3..ab7561bb 100644 --- a/src/test/java/org/orekit/rugged/adjustment/util/PleiadesViewingModel.java +++ b/src/test/java/org/orekit/rugged/adjustment/util/PleiadesViewingModel.java @@ -7,7 +7,6 @@ import org.hipparchus.geometry.euclidean.threed.Rotation; import org.hipparchus.geometry.euclidean.threed.RotationConvention; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.linesensor.LineDatation; import org.orekit.rugged.linesensor.LineSensor; import org.orekit.rugged.linesensor.LinearLineDatation; @@ -15,8 +14,6 @@ import org.orekit.rugged.los.FixedRotation; import org.orekit.rugged.los.FixedZHomothety; import org.orekit.rugged.los.LOSBuilder; import org.orekit.rugged.los.TimeDependentLOS; - -import org.orekit.errors.OrekitException; import org.orekit.time.AbsoluteDate; import org.orekit.time.TimeScale; import org.orekit.time.TimeScalesFactory; @@ -41,8 +38,7 @@ public class PleiadesViewingModel { * @param incidenceAngle incidence angle * @param referenceDate reference date */ - public PleiadesViewingModel(final String sensorName, final double incidenceAngle, final String referenceDate) - throws RuggedException, OrekitException { + public PleiadesViewingModel(final String sensorName, final double incidenceAngle, final String referenceDate) { this.sensorName = sensorName; this.referenceDate = referenceDate; @@ -83,7 +79,7 @@ public class PleiadesViewingModel { /** Get the reference date. */ - public AbsoluteDate getDatationReference() throws OrekitException { + public AbsoluteDate getDatationReference() { // We use Orekit for handling time and dates, and Rugged for defining the datation model: final TimeScale utc = TimeScalesFactory.getUTC(); @@ -93,13 +89,13 @@ public class PleiadesViewingModel { /** Get the min date. */ - public AbsoluteDate getMinDate() throws RuggedException { + public AbsoluteDate getMinDate() { return lineSensor.getDate(0); } /** Get the max date. */ - public AbsoluteDate getMaxDate() throws RuggedException { + public AbsoluteDate getMaxDate() { return lineSensor.getDate(DIMENSION); } @@ -124,7 +120,7 @@ public class PleiadesViewingModel { /** Create the line sensor. */ - private void createLineSensor() throws RuggedException, OrekitException { + private void createLineSensor() { // Offset of the MSI from center of mass of satellite // one line sensor diff --git a/src/test/java/org/orekit/rugged/adjustment/util/RefiningParametersDriver.java b/src/test/java/org/orekit/rugged/adjustment/util/RefiningParametersDriver.java index dae8fb87..d4d89bb5 100644 --- a/src/test/java/org/orekit/rugged/adjustment/util/RefiningParametersDriver.java +++ b/src/test/java/org/orekit/rugged/adjustment/util/RefiningParametersDriver.java @@ -1,8 +1,6 @@ package org.orekit.rugged.adjustment.util; -import org.orekit.errors.OrekitException; import org.orekit.rugged.api.Rugged; -import org.orekit.rugged.errors.RuggedException; import org.orekit.utils.ParameterDriver; @@ -21,8 +19,7 @@ public class RefiningParametersDriver { * @param sensorName line sensor name * @param rollValue rotation on roll value */ - public static void applyDisruptionsRoll(final Rugged rugged, final String sensorName, final double rollValue) - throws OrekitException, RuggedException { + public static void applyDisruptionsRoll(final Rugged rugged, final String sensorName, final double rollValue) { rugged. getLineSensor(sensorName). @@ -36,8 +33,7 @@ public class RefiningParametersDriver { * @param sensorName line sensor name * @param pitchValue rotation on pitch value */ - public static void applyDisruptionsPitch(final Rugged rugged, final String sensorName, final double pitchValue) - throws OrekitException, RuggedException { + public static void applyDisruptionsPitch(final Rugged rugged, final String sensorName, final double pitchValue) { rugged. getLineSensor(sensorName). @@ -51,8 +47,7 @@ public class RefiningParametersDriver { * @param sensorName line sensor name * @param factorValue scale factor */ - public static void applyDisruptionsFactor(final Rugged rugged, final String sensorName, final double factorValue) - throws OrekitException, RuggedException { + public static void applyDisruptionsFactor(final Rugged rugged, final String sensorName, final double factorValue) { rugged. getLineSensor(sensorName). @@ -64,9 +59,8 @@ public class RefiningParametersDriver { /** Select roll angle to adjust * @param rugged Rugged instance * @param sensorName line sensor name - * @throws OrekitException, RuggedException */ - public static void setSelectedRoll(final Rugged rugged, final String sensorName) throws OrekitException, RuggedException { + public static void setSelectedRoll(final Rugged rugged, final String sensorName) { ParameterDriver rollDriver = rugged.getLineSensor(sensorName).getParametersDrivers(). @@ -77,9 +71,8 @@ public class RefiningParametersDriver { /** Select pitch angle to adjust * @param rugged Rugged instance * @param sensorName line sensor name - * @throws OrekitException, RuggedException */ - public static void setSelectedPitch(final Rugged rugged, final String sensorName) throws OrekitException, RuggedException { + public static void setSelectedPitch(final Rugged rugged, final String sensorName) { ParameterDriver pitchDriver = rugged.getLineSensor(sensorName).getParametersDrivers(). @@ -90,9 +83,8 @@ public class RefiningParametersDriver { /** Select scale factor to adjust * @param rugged Rugged instance * @param sensorName line sensor name - * @throws OrekitException, RuggedException */ - public static void setSelectedFactor(final Rugged rugged, final String sensorName) throws OrekitException, RuggedException { + public static void setSelectedFactor(final Rugged rugged, final String sensorName) { ParameterDriver factorDriver = rugged.getLineSensor(sensorName).getParametersDrivers(). @@ -103,9 +95,8 @@ public class RefiningParametersDriver { /** Unselect roll angle to adjust (for test coverage purpose) * @param rugged Rugged instance * @param sensorName line sensor name - * @throws OrekitException, RuggedException */ - public static void unselectRoll(final Rugged rugged, final String sensorName) throws OrekitException, RuggedException { + public static void unselectRoll(final Rugged rugged, final String sensorName) { ParameterDriver rollDriver = rugged.getLineSensor(sensorName).getParametersDrivers(). @@ -116,9 +107,8 @@ public class RefiningParametersDriver { /** Unselect pitch angle to adjust (for test coverage purpose) * @param rugged Rugged instance * @param sensorName line sensor name - * @throws OrekitException, RuggedException */ - public static void unselectPitch(final Rugged rugged, final String sensorName) throws OrekitException, RuggedException { + public static void unselectPitch(final Rugged rugged, final String sensorName) { ParameterDriver pitchDriver = rugged.getLineSensor(sensorName).getParametersDrivers(). @@ -129,9 +119,8 @@ public class RefiningParametersDriver { /** Unselect factor angle to adjust (for test coverage purpose) * @param rugged Rugged instance * @param sensorName line sensor name - * @throws OrekitException, RuggedException */ - public static void unselectFactor(final Rugged rugged, final String sensorName) throws OrekitException, RuggedException { + public static void unselectFactor(final Rugged rugged, final String sensorName) { ParameterDriver factorDriver = rugged.getLineSensor(sensorName).getParametersDrivers(). diff --git a/src/test/java/org/orekit/rugged/api/RuggedBuilderTest.java b/src/test/java/org/orekit/rugged/api/RuggedBuilderTest.java index 6617c818..3f4c8130 100644 --- a/src/test/java/org/orekit/rugged/api/RuggedBuilderTest.java +++ b/src/test/java/org/orekit/rugged/api/RuggedBuilderTest.java @@ -17,12 +17,6 @@ package org.orekit.rugged.api; -import org.hipparchus.geometry.euclidean.threed.Rotation; -import org.hipparchus.geometry.euclidean.threed.RotationConvention; -import org.hipparchus.geometry.euclidean.threed.Vector3D; -import org.hipparchus.ode.nonstiff.DormandPrince853Integrator; -import org.hipparchus.util.FastMath; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.EOFException; @@ -36,6 +30,11 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.hipparchus.geometry.euclidean.threed.Rotation; +import org.hipparchus.geometry.euclidean.threed.RotationConvention; +import org.hipparchus.geometry.euclidean.threed.Vector3D; +import org.hipparchus.ode.nonstiff.DormandPrince853Integrator; +import org.hipparchus.util.FastMath; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; @@ -49,7 +48,6 @@ import org.orekit.bodies.GeodeticPoint; import org.orekit.bodies.OneAxisEllipsoid; import org.orekit.data.DataProvidersManager; import org.orekit.data.DirectoryCrawler; -import org.orekit.errors.OrekitException; import org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel; import org.orekit.forces.gravity.ThirdBodyAttraction; import org.orekit.forces.gravity.potential.GravityFieldFactory; @@ -98,7 +96,7 @@ public class RuggedBuilderTest { @Test public void testSetContextWithEphemerides() - throws RuggedException, OrekitException, URISyntaxException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { + throws URISyntaxException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); @@ -314,7 +312,7 @@ public class RuggedBuilderTest { @Test public void testSetContextWithPropagator() - throws RuggedException, OrekitException, URISyntaxException { + throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); @@ -359,7 +357,7 @@ public class RuggedBuilderTest { @Test public void testOutOfTimeRange() - throws RuggedException, OrekitException, URISyntaxException { + throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); @@ -461,7 +459,7 @@ public class RuggedBuilderTest { @Test public void testInterpolatorDump() - throws RuggedException, OrekitException, URISyntaxException { + throws URISyntaxException { int dimension = 200; @@ -530,7 +528,7 @@ public class RuggedBuilderTest { @Test public void testInterpolatorCannotDump() - throws RuggedException, OrekitException, URISyntaxException, IOException { + throws URISyntaxException, IOException { int dimension = 200; @@ -580,7 +578,7 @@ public class RuggedBuilderTest { @Test public void testInterpolatorDumpWrongFrame() - throws RuggedException, OrekitException, URISyntaxException { + throws URISyntaxException { int dimension = 200; @@ -641,7 +639,7 @@ public class RuggedBuilderTest { @Test public void testInterpolatorNotADump() - throws RuggedException, OrekitException, URISyntaxException { + throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); @@ -841,8 +839,8 @@ public class RuggedBuilderTest { private List<TimeStampedAngularCoordinates> orbitToQ(Orbit orbit, BodyShape earth, AbsoluteDate minDate, AbsoluteDate maxDate, - double step) - throws OrekitException { + double step) { + Propagator propagator = new KeplerianPropagator(orbit); propagator.setAttitudeProvider(new YawCompensation(orbit.getFrame(), new NadirPointing(orbit.getFrame(), earth))); propagator.propagate(minDate); diff --git a/src/test/java/org/orekit/rugged/api/RuggedTest.java b/src/test/java/org/orekit/rugged/api/RuggedTest.java index e72f88cd..5bd77c9a 100644 --- a/src/test/java/org/orekit/rugged/api/RuggedTest.java +++ b/src/test/java/org/orekit/rugged/api/RuggedTest.java @@ -64,7 +64,6 @@ import org.orekit.rugged.adjustment.GroundOptimizationProblemBuilder; import org.orekit.rugged.adjustment.measurements.Observables; import org.orekit.rugged.adjustment.util.InitInterRefiningTest; import org.orekit.rugged.errors.RuggedException; -import org.orekit.rugged.errors.RuggedExceptionWrapper; import org.orekit.rugged.errors.RuggedMessages; import org.orekit.rugged.linesensor.LineDatation; import org.orekit.rugged.linesensor.LineSensor; @@ -388,7 +387,7 @@ public class RuggedTest { } // end loop on pixel i } - private RuggedBuilder initRuggedForAtmosphericTests(final int dimension, final String sensorName) throws URISyntaxException, RuggedException { + private RuggedBuilder initRuggedForAtmosphericTests(final int dimension, final String sensorName) throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); @@ -817,7 +816,7 @@ public class RuggedTest { @Test - public void testInverseLocNearLineEnd() throws OrekitException, RuggedException, URISyntaxException { + public void testInverseLocNearLineEnd() throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); @@ -919,7 +918,7 @@ public class RuggedTest { } @Test - public void testInverseLoc() throws OrekitException, RuggedException, URISyntaxException { + public void testInverseLoc() throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); @@ -1309,52 +1308,36 @@ public class RuggedTest { UnivariateDifferentiableFunction lineVSroll = differentiator.differentiate((double roll) -> { - try { - rollDriver.setValue(roll); - pitchDriver.setValue(0); - return rugged.inverseLocation("line", gp[referencePixel], 0, dimension).getLineNumber(); - } catch (RuggedException e) { - throw new RuggedExceptionWrapper(e); - } + rollDriver.setValue(roll); + pitchDriver.setValue(0); + return rugged.inverseLocation("line", gp[referencePixel], 0, dimension).getLineNumber(); }); double dLdR = lineVSroll.value(factory.variable(0, 0.0)).getPartialDerivative(1); Assert.assertEquals(dLdR, result[0].getPartialDerivative(1, 0), dLdR * lineDerivativeRelativeTolerance); UnivariateDifferentiableFunction lineVSpitch = differentiator.differentiate((double pitch) -> { - try { - rollDriver.setValue(0); - pitchDriver.setValue(pitch); - return rugged.inverseLocation("line", gp[referencePixel], 0, dimension).getLineNumber(); - } catch (RuggedException e) { - throw new RuggedExceptionWrapper(e); - } + rollDriver.setValue(0); + pitchDriver.setValue(pitch); + return rugged.inverseLocation("line", gp[referencePixel], 0, dimension).getLineNumber(); }); double dLdP = lineVSpitch.value(factory.variable(0, 0.0)).getPartialDerivative(1); Assert.assertEquals(dLdP, result[0].getPartialDerivative(0, 1), dLdP * lineDerivativeRelativeTolerance); UnivariateDifferentiableFunction pixelVSroll = differentiator.differentiate((double roll) -> { - try { - rollDriver.setValue(roll); - pitchDriver.setValue(0); - return rugged.inverseLocation("line", gp[referencePixel], 0, dimension).getPixelNumber(); - } catch (RuggedException e) { - throw new RuggedExceptionWrapper(e); - } + rollDriver.setValue(roll); + pitchDriver.setValue(0); + return rugged.inverseLocation("line", gp[referencePixel], 0, dimension).getPixelNumber(); }); double dXdR = pixelVSroll.value(factory.variable(0, 0.0)).getPartialDerivative(1); Assert.assertEquals(dXdR, result[1].getPartialDerivative(1, 0), dXdR * pixelDerivativeRelativeTolerance); UnivariateDifferentiableFunction pixelVSpitch = differentiator.differentiate((double pitch) -> { - try { - rollDriver.setValue(0); - pitchDriver.setValue(pitch); - return rugged.inverseLocation("line", gp[referencePixel], 0, dimension).getPixelNumber(); - } catch (RuggedException e) { - throw new RuggedExceptionWrapper(e); - } + rollDriver.setValue(0); + pitchDriver.setValue(pitch); + return rugged.inverseLocation("line", gp[referencePixel], 0, dimension).getPixelNumber(); }); double dXdP = pixelVSpitch.value(factory.variable(0, 0.0)).getPartialDerivative(1); Assert.assertEquals(dXdP, result[1].getPartialDerivative(0, 1), dXdP * pixelDerivativeRelativeTolerance); @@ -1362,7 +1345,7 @@ public class RuggedTest { } catch (InvocationTargetException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | URISyntaxException | - OrekitException | RuggedExceptionWrapper e) { + OrekitException | RuggedException e) { Assert.fail(e.getLocalizedMessage()); } } @@ -1542,7 +1525,7 @@ public class RuggedTest { @Before - public void setUp() throws OrekitException, URISyntaxException { + public void setUp() throws URISyntaxException { TestUtils.clearFactories(); } } diff --git a/src/test/java/org/orekit/rugged/errors/DumpManagerTest.java b/src/test/java/org/orekit/rugged/errors/DumpManagerTest.java index d2c4dd1b..7b6f3f70 100644 --- a/src/test/java/org/orekit/rugged/errors/DumpManagerTest.java +++ b/src/test/java/org/orekit/rugged/errors/DumpManagerTest.java @@ -35,7 +35,6 @@ import org.orekit.bodies.BodyShape; import org.orekit.bodies.GeodeticPoint; import org.orekit.data.DataProvidersManager; import org.orekit.data.DirectoryCrawler; -import org.orekit.errors.OrekitException; import org.orekit.orbits.Orbit; import org.orekit.rugged.TestUtils; import org.orekit.rugged.api.AlgorithmId; @@ -63,7 +62,7 @@ public class DumpManagerTest { public TemporaryFolder tempFolder = new TemporaryFolder(); @Test - public void testDump() throws URISyntaxException, IOException, OrekitException, RuggedException { + public void testDump() throws URISyntaxException, IOException { File dump = tempFolder.newFile(); DumpManager.activate(dump); @@ -146,7 +145,7 @@ public class DumpManagerTest { } public void variousRuggedCalls() - throws RuggedException, OrekitException, URISyntaxException { + throws URISyntaxException { int dimension = 200; @@ -209,7 +208,7 @@ public class DumpManagerTest { } @Test - public void testAlreadyActive() throws URISyntaxException, IOException, OrekitException, RuggedException { + public void testAlreadyActive() throws URISyntaxException, IOException { DumpManager.activate(tempFolder.newFile()); try { @@ -223,7 +222,7 @@ public class DumpManagerTest { } @Test - public void testNotActive() throws URISyntaxException, IOException, OrekitException, RuggedException { + public void testNotActive() throws URISyntaxException, IOException { try { DumpManager.deactivate(); Assert.fail("an exception should have been thrown"); @@ -233,7 +232,7 @@ public class DumpManagerTest { } @Test - public void testWriteError() throws URISyntaxException, IOException, OrekitException, RuggedException { + public void testWriteError() throws URISyntaxException, IOException { try { File dump = tempFolder.newFile(); dump.setReadOnly(); diff --git a/src/test/java/org/orekit/rugged/errors/DumpReplayerTest.java b/src/test/java/org/orekit/rugged/errors/DumpReplayerTest.java index 37a99a8b..5dce6d2a 100644 --- a/src/test/java/org/orekit/rugged/errors/DumpReplayerTest.java +++ b/src/test/java/org/orekit/rugged/errors/DumpReplayerTest.java @@ -36,7 +36,6 @@ import org.junit.rules.TemporaryFolder; import org.orekit.bodies.GeodeticPoint; import org.orekit.data.DataProvidersManager; import org.orekit.data.DirectoryCrawler; -import org.orekit.errors.OrekitException; import org.orekit.rugged.api.Rugged; import org.orekit.rugged.linesensor.SensorPixel; diff --git a/src/test/java/org/orekit/rugged/intersection/AbstractAlgorithmTest.java b/src/test/java/org/orekit/rugged/intersection/AbstractAlgorithmTest.java index ad970b02..f9e6998e 100644 --- a/src/test/java/org/orekit/rugged/intersection/AbstractAlgorithmTest.java +++ b/src/test/java/org/orekit/rugged/intersection/AbstractAlgorithmTest.java @@ -17,13 +17,13 @@ package org.orekit.rugged.intersection; +import java.io.File; +import java.net.URISyntaxException; + import org.hipparchus.geometry.euclidean.threed.Line; 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.net.URISyntaxException; - import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -32,13 +32,10 @@ import org.orekit.attitudes.Attitude; import org.orekit.bodies.GeodeticPoint; import org.orekit.data.DataProvidersManager; import org.orekit.data.DirectoryCrawler; -import org.orekit.errors.OrekitException; import org.orekit.frames.FramesFactory; import org.orekit.frames.Transform; import org.orekit.orbits.CartesianOrbit; import org.orekit.propagation.SpacecraftState; -import org.orekit.rugged.errors.RuggedException; -import org.orekit.rugged.intersection.IntersectionAlgorithm; import org.orekit.rugged.intersection.duvenhage.MinMaxTreeTile; import org.orekit.rugged.intersection.duvenhage.MinMaxTreeTileFactory; import org.orekit.rugged.raster.CliffsElevationUpdater; @@ -119,7 +116,7 @@ public abstract class AbstractAlgorithmTest { @Test public void testCliffsOfMoher() - throws RuggedException, OrekitException { + { setUpCliffsOfMoherContext(); @@ -152,8 +149,7 @@ public abstract class AbstractAlgorithmTest { } - protected void checkIntersection(Vector3D position, Vector3D los, GeodeticPoint intersection) - throws RuggedException { + protected void checkIntersection(Vector3D position, Vector3D los, GeodeticPoint intersection) { // check the point is on the line Line line = new Line(position, new Vector3D(1, position, 1e6, los), 1.0e-12); @@ -168,7 +164,7 @@ public abstract class AbstractAlgorithmTest { } protected void setUpMayonVolcanoContext() - throws RuggedException, OrekitException { + { // Mayon Volcano location according to Wikipedia: 13°15′24″N 123°41′6″E GeodeticPoint summit = @@ -216,7 +212,7 @@ public abstract class AbstractAlgorithmTest { } protected void setUpCliffsOfMoherContext() - throws RuggedException, OrekitException { + { // cliffs of Moher location according to Wikipedia: 52°56′10″N 9°28′15″ W GeodeticPoint north = new GeodeticPoint(FastMath.toRadians(52.9984), @@ -270,8 +266,8 @@ public abstract class AbstractAlgorithmTest { } @Before - public void setUp() - throws OrekitException, URISyntaxException { + public void setUp() throws URISyntaxException { + String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); earth = new ExtendedEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, diff --git a/src/test/java/org/orekit/rugged/intersection/ConstantElevationAlgorithmTest.java b/src/test/java/org/orekit/rugged/intersection/ConstantElevationAlgorithmTest.java index 954d030f..9b8d6a4a 100644 --- a/src/test/java/org/orekit/rugged/intersection/ConstantElevationAlgorithmTest.java +++ b/src/test/java/org/orekit/rugged/intersection/ConstantElevationAlgorithmTest.java @@ -1,4 +1,4 @@ -/* Copyright 2013-2017 CS Systèmes d'Information +/* Copyright 2013-2018 CS Systèmes d'Information * Licensed to CS Systèmes d'Information (CS) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -17,12 +17,12 @@ package org.orekit.rugged.intersection; -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.net.URISyntaxException; +import org.hipparchus.geometry.euclidean.threed.Rotation; +import org.hipparchus.geometry.euclidean.threed.Vector3D; +import org.hipparchus.util.FastMath; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -30,11 +30,9 @@ import org.junit.Test; import org.orekit.attitudes.Attitude; import org.orekit.data.DataProvidersManager; import org.orekit.data.DirectoryCrawler; -import org.orekit.errors.OrekitException; import org.orekit.frames.FramesFactory; import org.orekit.orbits.CartesianOrbit; import org.orekit.propagation.SpacecraftState; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.intersection.duvenhage.DuvenhageAlgorithm; import org.orekit.rugged.raster.CheckedPatternElevationUpdater; import org.orekit.rugged.raster.TileUpdater; @@ -100,8 +98,7 @@ public class ConstantElevationAlgorithmTest { } @Before - public void setUp() - throws OrekitException, URISyntaxException { + public void setUp() throws URISyntaxException { String path = getClass().getClassLoader().getResource("orekit-data").toURI().getPath(); DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(new File(path))); earth = new ExtendedEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, diff --git a/src/test/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithmTest.java b/src/test/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithmTest.java index 46563207..0abf6e55 100644 --- a/src/test/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithmTest.java +++ b/src/test/java/org/orekit/rugged/intersection/duvenhage/DuvenhageAlgorithmTest.java @@ -85,8 +85,8 @@ public class DuvenhageAlgorithmTest extends AbstractAlgorithmTest { final int n = 1201; final double size = FastMath.toRadians(1.0); updater = new TileUpdater() { - public void updateTile(double latitude, double longitude, UpdatableTile tile) - throws RuggedException { + public void updateTile(double latitude, double longitude, UpdatableTile tile) { + double step = size / (n - 1); // this geometry is incorrect: // the specified latitude/longitude belong to rows/columns [1, n-1] diff --git a/src/test/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTileTest.java b/src/test/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTileTest.java index 11f55389..1c3c442c 100644 --- a/src/test/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTileTest.java +++ b/src/test/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTileTest.java @@ -16,14 +16,13 @@ */ package org.orekit.rugged.intersection.duvenhage; +import java.lang.reflect.Field; + import org.hipparchus.random.RandomGenerator; import org.hipparchus.random.Well1024a; import org.hipparchus.util.FastMath; -import java.lang.reflect.Field; - import org.junit.Assert; import org.junit.Test; -import org.orekit.rugged.errors.RuggedException; public class MinMaxTreeTileTest { diff --git a/src/test/java/org/orekit/rugged/linesensor/FixedRotationTest.java b/src/test/java/org/orekit/rugged/linesensor/FixedRotationTest.java index eb99602d..01fbbfb3 100644 --- a/src/test/java/org/orekit/rugged/linesensor/FixedRotationTest.java +++ b/src/test/java/org/orekit/rugged/linesensor/FixedRotationTest.java @@ -37,8 +37,6 @@ import org.hipparchus.util.FastMath; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.orekit.errors.OrekitException; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.los.FixedRotation; import org.orekit.rugged.los.LOSBuilder; import org.orekit.rugged.los.TimeDependentLOS; diff --git a/src/test/java/org/orekit/rugged/linesensor/PolynomialRotationTest.java b/src/test/java/org/orekit/rugged/linesensor/PolynomialRotationTest.java index 672f71ca..9e510217 100644 --- a/src/test/java/org/orekit/rugged/linesensor/PolynomialRotationTest.java +++ b/src/test/java/org/orekit/rugged/linesensor/PolynomialRotationTest.java @@ -38,8 +38,6 @@ import org.hipparchus.util.FastMath; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.orekit.errors.OrekitException; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.los.LOSBuilder; import org.orekit.rugged.los.PolynomialRotation; import org.orekit.rugged.los.TimeDependentLOS; diff --git a/src/test/java/org/orekit/rugged/linesensor/SensorMeanPlaneCrossingTest.java b/src/test/java/org/orekit/rugged/linesensor/SensorMeanPlaneCrossingTest.java index 9a8ffeba..a0f61bfc 100644 --- a/src/test/java/org/orekit/rugged/linesensor/SensorMeanPlaneCrossingTest.java +++ b/src/test/java/org/orekit/rugged/linesensor/SensorMeanPlaneCrossingTest.java @@ -16,11 +16,6 @@ */ package org.orekit.rugged.linesensor; -import org.hipparchus.geometry.euclidean.threed.Line; -import org.hipparchus.geometry.euclidean.threed.Vector3D; -import org.hipparchus.random.RandomGenerator; -import org.hipparchus.random.Well19937a; -import org.hipparchus.util.FastMath; import java.io.File; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -28,6 +23,11 @@ import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; +import org.hipparchus.geometry.euclidean.threed.Line; +import org.hipparchus.geometry.euclidean.threed.Vector3D; +import org.hipparchus.random.RandomGenerator; +import org.hipparchus.random.Well19937a; +import org.hipparchus.util.FastMath; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -38,7 +38,6 @@ import org.orekit.bodies.GeodeticPoint; import org.orekit.bodies.OneAxisEllipsoid; import org.orekit.data.DataProvidersManager; import org.orekit.data.DirectoryCrawler; -import org.orekit.errors.OrekitException; import org.orekit.frames.FramesFactory; import org.orekit.frames.Transform; import org.orekit.orbits.CircularOrbit; @@ -49,7 +48,6 @@ import org.orekit.propagation.SpacecraftState; import org.orekit.propagation.analytical.KeplerianPropagator; import org.orekit.propagation.sampling.OrekitFixedStepHandler; import org.orekit.rugged.TestUtils; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.linesensor.SensorMeanPlaneCrossing.CrossingResult; import org.orekit.rugged.los.LOSBuilder; import org.orekit.rugged.utils.SpacecraftToObservedBody; diff --git a/src/test/java/org/orekit/rugged/raster/CheckedPatternElevationUpdater.java b/src/test/java/org/orekit/rugged/raster/CheckedPatternElevationUpdater.java index 59655cf1..d4349f5e 100644 --- a/src/test/java/org/orekit/rugged/raster/CheckedPatternElevationUpdater.java +++ b/src/test/java/org/orekit/rugged/raster/CheckedPatternElevationUpdater.java @@ -17,7 +17,6 @@ package org.orekit.rugged.raster; import org.hipparchus.util.FastMath; -import org.orekit.rugged.errors.RuggedException; public class CheckedPatternElevationUpdater implements TileUpdater { diff --git a/src/test/java/org/orekit/rugged/raster/CliffsElevationUpdater.java b/src/test/java/org/orekit/rugged/raster/CliffsElevationUpdater.java index 3f5ee8d0..ef23c39f 100644 --- a/src/test/java/org/orekit/rugged/raster/CliffsElevationUpdater.java +++ b/src/test/java/org/orekit/rugged/raster/CliffsElevationUpdater.java @@ -18,7 +18,6 @@ package org.orekit.rugged.raster; import org.hipparchus.util.FastMath; import org.orekit.bodies.GeodeticPoint; -import org.orekit.rugged.errors.RuggedException; public class CliffsElevationUpdater implements TileUpdater { diff --git a/src/test/java/org/orekit/rugged/raster/RandomLandscapeUpdater.java b/src/test/java/org/orekit/rugged/raster/RandomLandscapeUpdater.java index 43fefdc1..f84b81c7 100644 --- a/src/test/java/org/orekit/rugged/raster/RandomLandscapeUpdater.java +++ b/src/test/java/org/orekit/rugged/raster/RandomLandscapeUpdater.java @@ -22,7 +22,6 @@ import org.hipparchus.random.RandomGenerator; import org.hipparchus.random.Well19937a; import org.hipparchus.util.ArithmeticUtils; import org.hipparchus.util.FastMath; -import org.orekit.rugged.errors.RuggedException; public class RandomLandscapeUpdater implements TileUpdater { @@ -37,11 +36,9 @@ public class RandomLandscapeUpdater implements TileUpdater { * @param seed * @param size size in latitude / size in longitude (rad) * @param n number of latitude / number of longitude - * @throws MathIllegalArgumentException */ public RandomLandscapeUpdater(double baseH, double initialScale, double reductionFactor, - long seed, double size, int n) - throws MathIllegalArgumentException { + long seed, double size, int n) { if (!ArithmeticUtils.isPowerOfTwo(n - 1)) { throw new MathIllegalArgumentException(LocalizedCoreFormats.SIMPLE_MESSAGE, diff --git a/src/test/java/org/orekit/rugged/raster/TilesCacheTest.java b/src/test/java/org/orekit/rugged/raster/TilesCacheTest.java index 8f236d23..63e11e3e 100644 --- a/src/test/java/org/orekit/rugged/raster/TilesCacheTest.java +++ b/src/test/java/org/orekit/rugged/raster/TilesCacheTest.java @@ -21,9 +21,6 @@ import org.hipparchus.random.Well19937a; import org.hipparchus.util.FastMath; import org.junit.Assert; import org.junit.Test; -import org.orekit.rugged.errors.RuggedException; -import org.orekit.rugged.raster.SimpleTile; -import org.orekit.rugged.raster.TilesCache; public class TilesCacheTest { diff --git a/src/test/java/org/orekit/rugged/raster/VolcanicConeElevationUpdater.java b/src/test/java/org/orekit/rugged/raster/VolcanicConeElevationUpdater.java index bd236256..b8a694cd 100644 --- a/src/test/java/org/orekit/rugged/raster/VolcanicConeElevationUpdater.java +++ b/src/test/java/org/orekit/rugged/raster/VolcanicConeElevationUpdater.java @@ -18,7 +18,6 @@ package org.orekit.rugged.raster; import org.hipparchus.util.FastMath; import org.orekit.bodies.GeodeticPoint; -import org.orekit.rugged.errors.RuggedException; import org.orekit.utils.Constants; public class VolcanicConeElevationUpdater implements TileUpdater { diff --git a/src/test/java/org/orekit/rugged/refraction/MultiLayerModelTest.java b/src/test/java/org/orekit/rugged/refraction/MultiLayerModelTest.java index cc2904d5..4f5de408 100644 --- a/src/test/java/org/orekit/rugged/refraction/MultiLayerModelTest.java +++ b/src/test/java/org/orekit/rugged/refraction/MultiLayerModelTest.java @@ -16,6 +16,11 @@ */ package org.orekit.rugged.refraction; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + import org.hipparchus.analysis.UnivariateFunction; import org.hipparchus.geometry.euclidean.threed.Rotation; import org.hipparchus.geometry.euclidean.threed.RotationConvention; @@ -23,7 +28,6 @@ import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; import org.junit.Assert; import org.junit.Test; -import org.orekit.errors.OrekitException; import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.errors.RuggedMessages; import org.orekit.rugged.intersection.AbstractAlgorithmTest; @@ -32,11 +36,6 @@ import org.orekit.rugged.intersection.duvenhage.DuvenhageAlgorithm; import org.orekit.rugged.raster.TileUpdater; import org.orekit.rugged.utils.NormalizedGeodeticPoint; -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - public class MultiLayerModelTest extends AbstractAlgorithmTest { @Test diff --git a/src/test/java/org/orekit/rugged/utils/RoughVisibilityEstimatorTest.java b/src/test/java/org/orekit/rugged/utils/RoughVisibilityEstimatorTest.java index c64df549..8e75d4de 100644 --- a/src/test/java/org/orekit/rugged/utils/RoughVisibilityEstimatorTest.java +++ b/src/test/java/org/orekit/rugged/utils/RoughVisibilityEstimatorTest.java @@ -16,13 +16,13 @@ */ package org.orekit.rugged.utils; -import org.hipparchus.ode.nonstiff.DormandPrince853Integrator; -import org.hipparchus.util.FastMath; import java.io.File; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; +import org.hipparchus.ode.nonstiff.DormandPrince853Integrator; +import org.hipparchus.util.FastMath; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -51,7 +51,6 @@ import org.orekit.propagation.Propagator; import org.orekit.propagation.SpacecraftState; import org.orekit.propagation.numerical.NumericalPropagator; import org.orekit.propagation.sampling.OrekitFixedStepHandler; -import org.orekit.rugged.errors.RuggedException; import org.orekit.time.AbsoluteDate; import org.orekit.time.TimeScalesFactory; import org.orekit.utils.Constants; diff --git a/src/tutorials/java/fr/cs/examples/refiningPleiades/Refining.java b/src/tutorials/java/fr/cs/examples/refiningPleiades/Refining.java index e53d2ee6..9fe09bae 100644 --- a/src/tutorials/java/fr/cs/examples/refiningPleiades/Refining.java +++ b/src/tutorials/java/fr/cs/examples/refiningPleiades/Refining.java @@ -22,14 +22,13 @@ import java.util.Collections; import java.util.List; import org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresOptimizer.Optimum; -import org.orekit.errors.OrekitException; import org.orekit.rugged.adjustment.AdjustmentContext; -import org.orekit.rugged.api.Rugged; -import org.orekit.rugged.errors.RuggedException; -import org.orekit.rugged.errors.RuggedMessages; import org.orekit.rugged.adjustment.measurements.Observables; import org.orekit.rugged.adjustment.measurements.SensorToGroundMapping; import org.orekit.rugged.adjustment.measurements.SensorToSensorMapping; +import org.orekit.rugged.api.Rugged; +import org.orekit.rugged.errors.RuggedException; +import org.orekit.rugged.errors.RuggedMessages; import fr.cs.examples.refiningPleiades.generators.GroundMeasurementGenerator; import fr.cs.examples.refiningPleiades.generators.InterMeasurementGenerator; diff --git a/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/GroundMeasurementGenerator.java b/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/GroundMeasurementGenerator.java index e3b2efec..3d152207 100644 --- a/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/GroundMeasurementGenerator.java +++ b/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/GroundMeasurementGenerator.java @@ -22,12 +22,11 @@ import org.hipparchus.random.UncorrelatedRandomVectorGenerator; import org.hipparchus.random.Well19937a; import org.hipparchus.util.FastMath; import org.orekit.bodies.GeodeticPoint; +import org.orekit.rugged.adjustment.measurements.Observables; +import org.orekit.rugged.adjustment.measurements.SensorToGroundMapping; import org.orekit.rugged.api.Rugged; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.linesensor.LineSensor; import org.orekit.rugged.linesensor.SensorPixel; -import org.orekit.rugged.adjustment.measurements.Observables; -import org.orekit.rugged.adjustment.measurements.SensorToGroundMapping; import org.orekit.time.AbsoluteDate; /** Ground measurements generator (sensor to ground mapping). diff --git a/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/InterMeasurementGenerator.java b/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/InterMeasurementGenerator.java index 9dfe7d4e..bccf2043 100644 --- a/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/InterMeasurementGenerator.java +++ b/src/tutorials/java/fr/cs/examples/refiningPleiades/generators/InterMeasurementGenerator.java @@ -22,7 +22,6 @@ import org.hipparchus.random.Well19937a; import org.orekit.bodies.GeodeticPoint; import org.orekit.rugged.api.Rugged; import org.orekit.rugged.errors.RuggedException; -import org.orekit.rugged.errors.RuggedExceptionWrapper; import org.orekit.rugged.errors.RuggedMessages; import org.orekit.rugged.linesensor.LineSensor; import org.orekit.rugged.linesensor.SensorPixel; diff --git a/src/tutorials/java/fr/cs/examples/refiningPleiades/metrics/LocalisationMetrics.java b/src/tutorials/java/fr/cs/examples/refiningPleiades/metrics/LocalisationMetrics.java index a9b98543..b8125862 100644 --- a/src/tutorials/java/fr/cs/examples/refiningPleiades/metrics/LocalisationMetrics.java +++ b/src/tutorials/java/fr/cs/examples/refiningPleiades/metrics/LocalisationMetrics.java @@ -23,12 +23,11 @@ import java.util.Set; import org.hipparchus.geometry.euclidean.threed.Vector3D; import org.hipparchus.util.FastMath; import org.orekit.bodies.GeodeticPoint; +import org.orekit.rugged.adjustment.measurements.SensorToGroundMapping; +import org.orekit.rugged.adjustment.measurements.SensorToSensorMapping; import org.orekit.rugged.api.Rugged; -import org.orekit.rugged.errors.RuggedException; import org.orekit.rugged.linesensor.LineSensor; import org.orekit.rugged.linesensor.SensorPixel; -import org.orekit.rugged.adjustment.measurements.SensorToGroundMapping; -import org.orekit.rugged.adjustment.measurements.SensorToSensorMapping; import org.orekit.rugged.utils.SpacecraftToObservedBody; import org.orekit.time.AbsoluteDate; diff --git a/src/tutorials/java/fr/cs/examples/refiningPleiades/models/OrbitModel.java b/src/tutorials/java/fr/cs/examples/refiningPleiades/models/OrbitModel.java index d0fe5132..ddf1e12c 100644 --- a/src/tutorials/java/fr/cs/examples/refiningPleiades/models/OrbitModel.java +++ b/src/tutorials/java/fr/cs/examples/refiningPleiades/models/OrbitModel.java @@ -31,7 +31,6 @@ import org.orekit.attitudes.TabulatedLofOffset; import org.orekit.attitudes.YawCompensation; import org.orekit.bodies.BodyShape; import org.orekit.bodies.OneAxisEllipsoid; -import org.orekit.errors.OrekitException; import org.orekit.forces.gravity.potential.GravityFieldFactory; import org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider; import org.orekit.frames.Frame; diff --git a/src/tutorials/java/fr/cs/examples/refiningPleiades/models/PleiadesViewingModel.java b/src/tutorials/java/fr/cs/examples/refiningPleiades/models/PleiadesViewingModel.java index 9714793f..609fb4dc 100644 --- a/src/tutorials/java/fr/cs/examples/refiningPleiades/models/PleiadesViewingModel.java +++ b/src/tutorials/java/fr/cs/examples/refiningPleiades/models/PleiadesViewingModel.java @@ -16,15 +16,16 @@ */ package fr.cs.examples.refiningPleiades.models; +import java.util.ArrayList; +import java.util.List; + import org.hipparchus.geometry.euclidean.threed.Rotation; import org.hipparchus.geometry.euclidean.threed.RotationConvention; import org.hipparchus.geometry.euclidean.threed.Vector3D; - import org.hipparchus.util.FastMath; -import java.util.ArrayList; -import java.util.List; - - +import org.orekit.rugged.linesensor.LineDatation; +import org.orekit.rugged.linesensor.LineSensor; +import org.orekit.rugged.linesensor.LinearLineDatation; import org.orekit.rugged.los.FixedRotation; import org.orekit.rugged.los.FixedZHomothety; import org.orekit.rugged.los.LOSBuilder; @@ -35,13 +36,6 @@ import org.orekit.time.TimeScalesFactory; import fr.cs.examples.refiningPleiades.Refining; -import org.orekit.rugged.linesensor.LinearLineDatation; -import org.orekit.rugged.linesensor.LineDatation; -import org.orekit.rugged.linesensor.LineSensor; - -import org.orekit.rugged.errors.RuggedException; -import org.orekit.errors.OrekitException; - /** * Pleiades viewing model class definition. * The aim of this class is to simulate PHR sensor. -- GitLab