From e192782819f65040d11458ceff4c5761d9d06607 Mon Sep 17 00:00:00 2001 From: Guylaine Prat <guylaine.prat@c-s.fr> Date: Thu, 2 Nov 2017 11:58:12 +0100 Subject: [PATCH] Checkstyle corrections (trailing whitespace; indent; javadoc) --- .gitignore | 9 +++ .../rugged/adjustment/AdjustmentContext.java | 8 +-- .../GroundOptimizationProblemBuilder.java | 17 +++-- ...nterSensorsOptimizationProblemBuilder.java | 26 ++++---- .../adjustment/LeastSquareAdjuster.java | 16 ++--- .../OptimizationProblemBuilder.java | 62 ++++++++++--------- .../orekit/rugged/adjustment/OptimizerId.java | 6 +- .../rugged/adjustment/measurements/Noise.java | 2 +- .../adjustment/measurements/Observables.java | 16 ++--- .../measurements/SensorMapping.java | 2 +- .../measurements/SensorToGroundMapping.java | 4 +- .../measurements/SensorToSensorMapping.java | 26 ++++---- .../java/org/orekit/rugged/api/Rugged.java | 50 +++++++-------- .../org/orekit/rugged/api/RuggedBuilder.java | 2 +- .../duvenhage/MinMaxTreeTile.java | 6 +- .../orekit/rugged/los/PolynomialRotation.java | 2 +- .../java/RefiningPleiades/GroundRefining.java | 10 +-- .../java/RefiningPleiades/InterRefining.java | 30 ++++----- .../java/RefiningPleiades/Refining.java | 12 ++-- .../GroundMeasurementGenerator.java | 24 +++---- .../generators/InterMeasurementGenerator.java | 24 +++---- .../generators/Measurable.java | 2 +- .../metrics/LocalisationMetrics.java | 30 ++++----- .../RefiningPleiades/models/OrbitModel.java | 34 +++++----- .../models/PleiadesViewingModel.java | 8 +-- .../java/fr/cs/examples/DirectLocation.java | 8 +-- 26 files changed, 223 insertions(+), 213 deletions(-) diff --git a/.gitignore b/.gitignore index 83eaec7b..db7ba5eb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,12 @@ bin .settings target +/erreur.txt +/erreurApresGraphivz.txt +/erreurMvnSiteVO +/listeWarningDeprecatedTest.txt +/titi +/toto +/traceMvnFindbugs.txt +/tutu +/.gitignore diff --git a/src/main/java/org/orekit/rugged/adjustment/AdjustmentContext.java b/src/main/java/org/orekit/rugged/adjustment/AdjustmentContext.java index 22dbfc5a..9706a26b 100644 --- a/src/main/java/org/orekit/rugged/adjustment/AdjustmentContext.java +++ b/src/main/java/org/orekit/rugged/adjustment/AdjustmentContext.java @@ -59,7 +59,7 @@ public class AdjustmentContext { * @param measurements control and tie points */ public AdjustmentContext(final Collection<Rugged> viewingModel, final Observables measurements) { - + this.viewingModel = new HashMap<String, Rugged>(); for (final Rugged r : viewingModel) { this.viewingModel.put(r.getName(), r); @@ -123,10 +123,10 @@ public class AdjustmentContext { * if parameters cannot be estimated (too few measurements, * ill-conditioned problem ...) */ - public Optimum estimateFreeParameters(final Collection<String> ruggedNameList, final int maxEvaluations, + public Optimum estimateFreeParameters(final Collection<String> ruggedNameList, final int maxEvaluations, final double parametersConvergenceThreshold) throws RuggedException { - + try { final List<Rugged> ruggedList = new ArrayList<Rugged>(); @@ -143,7 +143,7 @@ public class AdjustmentContext { final LeastSquareAdjuster adjuster = new LeastSquareAdjuster(this.optimizerID); LeastSquaresProblem theProblem = null; - + // builder switch (ruggedList.size()) { case 1: diff --git a/src/main/java/org/orekit/rugged/adjustment/GroundOptimizationProblemBuilder.java b/src/main/java/org/orekit/rugged/adjustment/GroundOptimizationProblemBuilder.java index 5fd89468..8051de2f 100644 --- a/src/main/java/org/orekit/rugged/adjustment/GroundOptimizationProblemBuilder.java +++ b/src/main/java/org/orekit/rugged/adjustment/GroundOptimizationProblemBuilder.java @@ -46,8 +46,7 @@ import org.orekit.rugged.adjustment.measurements.Observables; import org.orekit.rugged.adjustment.measurements.SensorToGroundMapping; import org.orekit.utils.ParameterDriver; -/** - * TODO GP description a completer +/** TODO GP description a completer. * @author Guylaine Prat * @since 2.0 */ @@ -74,8 +73,8 @@ public class GroundOptimizationProblemBuilder extends OptimizationProblemBuilder /** Target and weight (the solution of the optimization problem).*/ private HashMap<String, double[] > targetAndWeight; - - /** TODO GP description a completer + + /** TODO GP description a completer. * @param sensors list of sensors to refine * @param measurements set of observables * @param rugged name of rugged to refine @@ -84,7 +83,7 @@ public class GroundOptimizationProblemBuilder extends OptimizationProblemBuilder public GroundOptimizationProblemBuilder(final List<LineSensor> sensors, final Observables measurements, final Rugged rugged) throws RuggedException { - + super(sensors, measurements); this.rugged = rugged; this.initMapping(); @@ -95,7 +94,7 @@ public class GroundOptimizationProblemBuilder extends OptimizationProblemBuilder */ @Override protected void initMapping() { - + final String ruggedName = rugged.getName(); this.sensorToGroundMappings = new ArrayList<SensorToGroundMapping>(); for (final LineSensor lineSensor : this.getSensors()) { @@ -111,7 +110,7 @@ public class GroundOptimizationProblemBuilder extends OptimizationProblemBuilder */ @Override protected void createTargetAndWeight() throws RuggedException { - + try { int n = 0; for (final SensorToGroundMapping reference : this.sensorToGroundMappings) { @@ -156,7 +155,7 @@ public class GroundOptimizationProblemBuilder extends OptimizationProblemBuilder */ @Override protected MultivariateJacobianFunction createFunction() { - + // model function final MultivariateJacobianFunction model = point -> { try { @@ -221,7 +220,7 @@ public class GroundOptimizationProblemBuilder extends OptimizationProblemBuilder throw new OrekitExceptionWrapper(oe); } }; - + return model; } diff --git a/src/main/java/org/orekit/rugged/adjustment/InterSensorsOptimizationProblemBuilder.java b/src/main/java/org/orekit/rugged/adjustment/InterSensorsOptimizationProblemBuilder.java index 554dda91..a65401b5 100644 --- a/src/main/java/org/orekit/rugged/adjustment/InterSensorsOptimizationProblemBuilder.java +++ b/src/main/java/org/orekit/rugged/adjustment/InterSensorsOptimizationProblemBuilder.java @@ -49,7 +49,7 @@ import org.orekit.rugged.utils.SpacecraftToObservedBody; import org.orekit.time.AbsoluteDate; import org.orekit.utils.ParameterDriver; -/** TODO GP description a completer +/** TODO GP description a completer. * @author ??? * @author Guylaine Prat * @since 2.0 @@ -71,7 +71,7 @@ public class InterSensorsOptimizationProblemBuilder extends OptimizationProblemB /** Targets and weights of optimization problem. */ private HashMap<String, double[] > targetAndWeight; - /** Constructor + /** Constructor. * @param sensors list of sensors to refine * @param measurements set of observables * @param ruggedList names of rugged to refine @@ -80,7 +80,7 @@ public class InterSensorsOptimizationProblemBuilder extends OptimizationProblemB public InterSensorsOptimizationProblemBuilder(final List<LineSensor> sensors, final Observables measurements, final Collection<Rugged> ruggedList) throws RuggedException { - + super(sensors, measurements); this.ruggedMap = new LinkedHashMap<String, Rugged>(); for (final Rugged rugged : ruggedList) { @@ -96,17 +96,17 @@ public class InterSensorsOptimizationProblemBuilder extends OptimizationProblemB protected void initMapping() { this.sensorToSensorMappings = new ArrayList<SensorToSensorMapping>(); - + for (final String ruggedNameA : this.ruggedMap.keySet()) { for (final String ruggedNameB : this.ruggedMap.keySet()) { - + for (final LineSensor sensorA : this.getSensors()) { for (final LineSensor sensorB : this.getSensors()) { - + final String sensorNameA = sensorA.getName(); final String sensorNameB = sensorB.getName(); final SensorToSensorMapping mapping = this.getMeasurements().getInterMapping(ruggedNameA, sensorNameA, ruggedNameB, sensorNameB); - + if (mapping != null) { this.sensorToSensorMappings.add(mapping); } @@ -141,10 +141,10 @@ public class InterSensorsOptimizationProblemBuilder extends OptimizationProblemB // Get Earth constraint weight final double earthConstraintWeight = reference.getEarthConstraintWeight(); - + int i = 0; for (Iterator<Map.Entry<SensorPixel, SensorPixel>> gtIt = reference.getMapping().iterator(); gtIt.hasNext(); i++) { - + if (i == reference.getMapping().size()) break; // Get LOS distance @@ -174,7 +174,7 @@ public class InterSensorsOptimizationProblemBuilder extends OptimizationProblemB */ @Override protected MultivariateJacobianFunction createFunction() { - + // model function final MultivariateJacobianFunction model = point -> { @@ -200,7 +200,7 @@ public class InterSensorsOptimizationProblemBuilder extends OptimizationProblemB if (ruggedA == null) { throw new RuggedException(RuggedMessages.INVALID_RUGGED_NAME); } - + final Rugged ruggedB = this.ruggedMap.get(ruggedNameB); if (ruggedB == null) { throw new RuggedException(RuggedMessages.INVALID_RUGGED_NAME); @@ -222,8 +222,8 @@ public class InterSensorsOptimizationProblemBuilder extends OptimizationProblemB final SpacecraftToObservedBody scToBodyA = ruggedA.getScToBody(); - final DerivativeStructure[] ilResult = - ruggedB.distanceBetweenLOSDerivatives(lineSensorA, dateA, pixelA, scToBodyA, + final DerivativeStructure[] ilResult = + ruggedB.distanceBetweenLOSDerivatives(lineSensorA, dateA, pixelA, scToBodyA, lineSensorB, dateB, pixelB, this.getGenerator()); if (ilResult == null) { diff --git a/src/main/java/org/orekit/rugged/adjustment/LeastSquareAdjuster.java b/src/main/java/org/orekit/rugged/adjustment/LeastSquareAdjuster.java index ee8f1490..f2dbb85f 100644 --- a/src/main/java/org/orekit/rugged/adjustment/LeastSquareAdjuster.java +++ b/src/main/java/org/orekit/rugged/adjustment/LeastSquareAdjuster.java @@ -24,7 +24,7 @@ import org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem; import org.hipparchus.optim.nonlinear.vector.leastsquares.LevenbergMarquardtOptimizer; import org.orekit.rugged.errors.RuggedException; -/** TODO GP description a completer +/** TODO GP description a completer. * @author Guylaine Prat * @since 2.0 */ @@ -41,7 +41,7 @@ public class LeastSquareAdjuster { */ // TODO GP public protected ??? LeastSquareAdjuster(final OptimizerId optimizerID) { - + this.optimizerID = optimizerID; this.adjuster = this.selectOptimizer(); } @@ -49,7 +49,7 @@ public class LeastSquareAdjuster { /** Default constructor with Gauss Newton with QR decomposition algorithm.*/ // TODO GP public protected ??? LeastSquareAdjuster() { - + this.optimizerID = OptimizerId.GAUSS_NEWTON_QR; this.adjuster = this.selectOptimizer(); } @@ -66,19 +66,19 @@ public class LeastSquareAdjuster { * @return the least square optimizer */ private LeastSquaresOptimizer selectOptimizer() { - + // Set up the optimizer switch (this.optimizerID) { - + case LEVENBERG_MARQUADT: return new LevenbergMarquardtOptimizer(); - + case GAUSS_NEWTON_LU : return new GaussNewtonOptimizer().withDecomposition(GaussNewtonOptimizer.Decomposition.LU); - + case GAUSS_NEWTON_QR : return new GaussNewtonOptimizer().withDecomposition(GaussNewtonOptimizer.Decomposition.QR); - + default : // this should never happen throw RuggedException.createInternalError(null); diff --git a/src/main/java/org/orekit/rugged/adjustment/OptimizationProblemBuilder.java b/src/main/java/org/orekit/rugged/adjustment/OptimizationProblemBuilder.java index 406b4aa6..8282028d 100644 --- a/src/main/java/org/orekit/rugged/adjustment/OptimizationProblemBuilder.java +++ b/src/main/java/org/orekit/rugged/adjustment/OptimizationProblemBuilder.java @@ -43,7 +43,7 @@ import org.orekit.utils.ParameterDriver; /** * Builder for optimization problem. * <p> - * TODO GP description a completer + * TODO GP description a completer * </p> * @author Jonathan Guinet * @author Guylaine Prat @@ -75,7 +75,7 @@ abstract class OptimizationProblemBuilder { * @throws RuggedException an exception is generated if no parameters has been selected for refining */ OptimizationProblemBuilder(final List<LineSensor> sensors, final Observables measurements) throws RuggedException { - + try { this.generator = this.createGenerator(sensors); this.drivers = this.generator.getSelected(); @@ -98,7 +98,7 @@ abstract class OptimizationProblemBuilder { * @return the least squares problem */ - public abstract LeastSquaresProblem build(int maxEvaluations, double convergenceThreshold) + public abstract LeastSquaresProblem build(int maxEvaluations, double convergenceThreshold) throws RuggedException; /** Create the convergence check. @@ -108,15 +108,13 @@ abstract class OptimizationProblemBuilder { * @param parametersConvergenceThreshold convergence threshold * @return the checker */ - final ConvergenceChecker<LeastSquaresProblem.Evaluation> + final ConvergenceChecker<LeastSquaresProblem.Evaluation> createChecker(final double parametersConvergenceThreshold) { - // TODO GP description a completer - final ConvergenceChecker<LeastSquaresProblem.Evaluation> checker = - (iteration, previous, current) - -> current.getPoint().getLInfDistance(previous.getPoint()) - <= parametersConvergenceThreshold; - + // TODO GP description a completer + final ConvergenceChecker<LeastSquaresProblem.Evaluation> checker = (iteration, previous, current) + -> current.getPoint().getLInfDistance(previous.getPoint()) <= parametersConvergenceThreshold; + return checker; } @@ -124,7 +122,7 @@ abstract class OptimizationProblemBuilder { * @return start parameters values (normalized) */ final double[] createStartTab() { - + // Get start points (as a normalized value) final double[] start = new double[this.nbParams]; int iStart = 0; @@ -134,38 +132,42 @@ abstract class OptimizationProblemBuilder { return start; } - // TODO GP description a completer + /** Create targets and weights of optimization problem. + * @throws RuggedException if no reference mappings for parameters estimation are found + */ protected abstract void createTargetAndWeight() throws RuggedException; - // TODO GP description a completer + /** Create the model function value and its Jacobian. + * @return the model function value and its Jacobian + */ protected abstract MultivariateJacobianFunction createFunction(); /** Parse the observables to select mapping .*/ protected abstract void initMapping(); - + /** Create parameter validator. * @return parameter validator */ final ParameterValidator createParameterValidator() { - + // Prevent parameters to exceed their prescribed bounds - // TODO GP description a completer + // TODO GP description a completer final ParameterValidator validator = params -> { try { int i = 0; for (final ParameterDriver driver : this.drivers) { - + // let the parameter handle min/max clipping driver.setNormalizedValue(params.getEntry(i)); params.setEntry(i++, driver.getNormalizedValue()); } return params; - + } catch (OrekitException oe) { throw new OrekitExceptionWrapper(oe); } }; - + return validator; } @@ -177,13 +179,13 @@ abstract class OptimizationProblemBuilder { // Initialize set of drivers name final Set<String> names = new HashSet<>(); - - // Get the drivers name + + // Get the drivers name for (final LineSensor sensor : selectedSensors) { - - // Get the drivers name for the sensor + + // Get the drivers name for the sensor sensor.getParametersDrivers().forEach(driver -> { - + // Add the name of the driver to the set of drivers name if (names.contains(driver.getName()) == false) { names.add(driver.getName()); @@ -194,10 +196,10 @@ abstract class OptimizationProblemBuilder { // Set up generator list and map final List<ParameterDriver> selected = new ArrayList<>(); final Map<String, Integer> map = new HashMap<>(); - + // Get the list of selected drivers for (final LineSensor sensor : selectedSensors) { - + sensor.getParametersDrivers().filter(driver -> driver.isSelected()).forEach(driver -> { if (map.get(driver.getName()) == null) { map.put(driver.getName(), map.size()); @@ -208,7 +210,7 @@ abstract class OptimizationProblemBuilder { final DSFactory factory = new DSFactory(map.size(), 1); - // TODO GP description a completer + // TODO GP description a completer return new DSGenerator() { /** {@inheritDoc} */ @@ -226,7 +228,7 @@ abstract class OptimizationProblemBuilder { /** {@inheritDoc} */ @Override public DerivativeStructure variable(final ParameterDriver driver) { - + final Integer index = map.get(driver.getName()); if (index == null) { return constant(driver.getValue()); @@ -243,7 +245,7 @@ abstract class OptimizationProblemBuilder { protected List<LineSensor> getSensors() { return sensors; } - + /** Get the number of parameters to refine. * @return the number of parameters to refine */ @@ -266,7 +268,7 @@ abstract class OptimizationProblemBuilder { protected final DSGenerator getGenerator() { return this.generator; } - + /** Get the measurements. * @return the measurements */ diff --git a/src/main/java/org/orekit/rugged/adjustment/OptimizerId.java b/src/main/java/org/orekit/rugged/adjustment/OptimizerId.java index 3f0bae9b..019c6543 100644 --- a/src/main/java/org/orekit/rugged/adjustment/OptimizerId.java +++ b/src/main/java/org/orekit/rugged/adjustment/OptimizerId.java @@ -25,11 +25,11 @@ public enum OptimizerId { /** Levenberg Marquadt. */ LEVENBERG_MARQUADT, - + /** Gauss Newton with LU decomposition. */ GAUSS_NEWTON_LU, - + /** Gauss Newton with QR decomposition. */ GAUSS_NEWTON_QR - + } diff --git a/src/main/java/org/orekit/rugged/adjustment/measurements/Noise.java b/src/main/java/org/orekit/rugged/adjustment/measurements/Noise.java index 9a5dbfc1..74a7bfbf 100644 --- a/src/main/java/org/orekit/rugged/adjustment/measurements/Noise.java +++ b/src/main/java/org/orekit/rugged/adjustment/measurements/Noise.java @@ -44,7 +44,7 @@ public class Noise { * @param dimension noise dimension */ public Noise(final int distribution, final int dimension) { - + this.mean = new double[dimension]; this.standardDeviation = new double[dimension]; this.dimension = dimension; diff --git a/src/main/java/org/orekit/rugged/adjustment/measurements/Observables.java b/src/main/java/org/orekit/rugged/adjustment/measurements/Observables.java index 2ab234b2..7e534ad9 100644 --- a/src/main/java/org/orekit/rugged/adjustment/measurements/Observables.java +++ b/src/main/java/org/orekit/rugged/adjustment/measurements/Observables.java @@ -49,7 +49,7 @@ public class Observables { * @param nbModels number of viewing models to map */ public Observables(final int nbModels) { - + this.groundMappings = new LinkedHashMap<String, SensorToGroundMapping>(); this.interMappings = new LinkedHashMap<String, SensorToSensorMapping>(); this.nbModels = nbModels; @@ -59,16 +59,16 @@ public class Observables { * @param interMapping sensor to sensor mapping */ public void addInterMapping(final SensorToSensorMapping interMapping) { - + interMappings.put(this.createKey(interMapping), interMapping); } /** Add a ground mapping between ???? - * TODO GP commentaire a completer + * TODO GP commentaire a completer * @param groundMapping sensor to ground mapping */ public void addGroundMapping(final SensorToGroundMapping groundMapping) { - + groundMappings.put(this.createKey(groundMapping), groundMapping); } @@ -86,12 +86,12 @@ public class Observables { * @return selected ground mapping or null if sensor is not found */ public SensorToGroundMapping getGroundMapping(final String ruggedName, final String sensorName) { - + final SensorToGroundMapping mapping = this.groundMappings.get(ruggedName + RUGGED_SENSOR_SEPARATOR + sensorName); return mapping; } - /** Get the sensor to sensor values + /** Get the sensor to sensor values. * TODO GP commentaire a completer * @return the inter-mappings */ @@ -99,7 +99,7 @@ public class Observables { return interMappings.values(); } - /** Get the number of viewing models to map + /** Get the number of viewing models to map. * @return the number of viewing models to map */ public int getNbModels() { @@ -115,7 +115,7 @@ public class Observables { * @param sensorNameB sensor name B * @return selected ground mapping or null if a sensor is not found */ - public SensorToSensorMapping getInterMapping(final String ruggedNameA, final String sensorNameA, + public SensorToSensorMapping getInterMapping(final String ruggedNameA, final String sensorNameA, final String ruggedNameB, final String sensorNameB) { //TODO GP revoir la creation de string par "+" diff --git a/src/main/java/org/orekit/rugged/adjustment/measurements/SensorMapping.java b/src/main/java/org/orekit/rugged/adjustment/measurements/SensorMapping.java index ccf28f9f..c718e403 100644 --- a/src/main/java/org/orekit/rugged/adjustment/measurements/SensorMapping.java +++ b/src/main/java/org/orekit/rugged/adjustment/measurements/SensorMapping.java @@ -55,7 +55,7 @@ public class SensorMapping<T> { * @param ruggedName name of the Rugged to which mapping applies */ public SensorMapping(final String sensorName, final String ruggedName) { - + this.sensorName = sensorName; this.ruggedName = ruggedName; this.mapping = new LinkedHashMap<SensorPixel, T>(); diff --git a/src/main/java/org/orekit/rugged/adjustment/measurements/SensorToGroundMapping.java b/src/main/java/org/orekit/rugged/adjustment/measurements/SensorToGroundMapping.java index 29d40d0e..b38c9c1f 100644 --- a/src/main/java/org/orekit/rugged/adjustment/measurements/SensorToGroundMapping.java +++ b/src/main/java/org/orekit/rugged/adjustment/measurements/SensorToGroundMapping.java @@ -41,7 +41,7 @@ public class SensorToGroundMapping { /** Mapping from sensor to ground. */ private final SensorMapping<GeodeticPoint> groundMapping; - + /** Build a new instance (with default Rugged name). * @param sensorName name of the sensor to which mapping applies */ @@ -54,7 +54,7 @@ public class SensorToGroundMapping { * @param sensorName name of the sensor to which mapping applies */ public SensorToGroundMapping(final String ruggedName, final String sensorName) { - + this.sensorName = sensorName; this.groundMapping = new SensorMapping<GeodeticPoint>(sensorName, ruggedName); } diff --git a/src/main/java/org/orekit/rugged/adjustment/measurements/SensorToSensorMapping.java b/src/main/java/org/orekit/rugged/adjustment/measurements/SensorToSensorMapping.java index 3428fba4..c1185a98 100644 --- a/src/main/java/org/orekit/rugged/adjustment/measurements/SensorToSensorMapping.java +++ b/src/main/java/org/orekit/rugged/adjustment/measurements/SensorToSensorMapping.java @@ -24,7 +24,7 @@ import java.util.Set; import org.orekit.rugged.linesensor.SensorPixel; /** Container for mapping sensors pixels of two viewing models. - * Store the distance between both lines of sight computed with + * Store the distance between both lines of sight computed with * {@link org.orekit.rugged.api.Rugged#distanceBetweenLOS(org.orekit.rugged.linesensor.LineSensor, org.orekit.time.AbsoluteDate, double, org.orekit.rugged.utils.SpacecraftToObservedBody, org.orekit.rugged.linesensor.LineSensor, org.orekit.time.AbsoluteDate, double)} * <p> Constraints in relation to Earth distance can be added. * @see SensorMapping @@ -55,13 +55,13 @@ public class SensorToSensorMapping { /** Earth constraint weight. */ private double earthConstraintWeight; - + /** Build a new instance without Earth constraint (with default Rugged names). * @param sensorNameA name of the sensor A to which mapping applies * @param sensorNameB name of the sensor B to which mapping applies */ public SensorToSensorMapping(final String sensorNameA, final String sensorNameB) { - + this(sensorNameA, RUGGED, sensorNameB, RUGGED, 0.0); } @@ -71,17 +71,17 @@ public class SensorToSensorMapping { * @param sensorNameB name of the sensor B to which mapping applies * @param ruggedNameB name of the Rugged B to which mapping applies * @param earthConstraintWeight weight given to the Earth distance constraint - * with respect to the LOS distance (between 0 and 1). + * with respect to the LOS distance (between 0 and 1). * <br>Weighting will be applied as follow : * <ul> * <li>(1 - earthConstraintWeight) for LOS distance weighting</li> * <li>earthConstraintWeight for Earth distance weighting</li> * </ul> */ - public SensorToSensorMapping(final String sensorNameA, final String ruggedNameA, - final String sensorNameB, final String ruggedNameB, + public SensorToSensorMapping(final String sensorNameA, final String ruggedNameA, + final String sensorNameB, final String ruggedNameB, final double earthConstraintWeight) { - + this.interMapping = new SensorMapping<SensorPixel>(sensorNameA, ruggedNameA); this.sensorNameB = sensorNameB; this.ruggedNameB = ruggedNameB; @@ -96,9 +96,9 @@ public class SensorToSensorMapping { * @param sensorNameB name of the sensor B to which mapping applies * @param ruggedNameB name of the Rugged B to which mapping applies */ - public SensorToSensorMapping(final String sensorNameA, final String ruggedNameA, + public SensorToSensorMapping(final String sensorNameA, final String ruggedNameA, final String sensorNameB, final String ruggedNameB) { - + this(sensorNameA, ruggedNameA, sensorNameB, ruggedNameB, 0.0); } @@ -107,7 +107,7 @@ public class SensorToSensorMapping { * @param sensorNameA name of the sensor A to which mapping applies * @param sensorNameB name of the sensor B to which mapping applies * @param earthConstraintWeight weight given to the Earth distance constraint - * with respect to the LOS distance (between 0 and 1). + * with respect to the LOS distance (between 0 and 1). * <br>Weighting will be applied as follow : * <ul> * <li>(1 - earthConstraintWeight) for LOS distance weighting</li> @@ -116,7 +116,7 @@ public class SensorToSensorMapping { */ public SensorToSensorMapping(final String sensorNameA, final String sensorNameB, final double earthConstraintWeight) { - + this(sensorNameA, RUGGED, sensorNameB, RUGGED, earthConstraintWeight); } @@ -198,7 +198,7 @@ public class SensorToSensorMapping { * @param losDistance distance between both line of sight */ public void addMapping(final SensorPixel pixelA, final SensorPixel pixelB, final Double losDistance) { - + interMapping.addMapping(pixelA, pixelB); losDistances.add(losDistance); } @@ -212,7 +212,7 @@ public class SensorToSensorMapping { */ public void addMapping(final SensorPixel pixelA, final SensorPixel pixelB, final Double losDistance, final Double earthDistance) { - + interMapping.addMapping(pixelA, pixelB); losDistances.add(losDistance); earthDistances.add(earthDistance); diff --git a/src/main/java/org/orekit/rugged/api/Rugged.java b/src/main/java/org/orekit/rugged/api/Rugged.java index 94de3373..cca5ef74 100644 --- a/src/main/java/org/orekit/rugged/api/Rugged.java +++ b/src/main/java/org/orekit/rugged/api/Rugged.java @@ -613,7 +613,7 @@ public class Rugged { } - /** Compute distances between two line sensors. + /** Compute distances between two line sensors. * @param sensorA line sensor A * @param dateA current date for sensor A * @param pixelA pixel index for sensor A @@ -632,28 +632,28 @@ public class Rugged { // Compute the approximate transform between spacecraft and observed body // from Rugged instance A - final Transform scToInertA = scToBodyA.getScToInertial(dateA); + final Transform scToInertA = scToBodyA.getScToInertial(dateA); final Transform inertToBodyA = scToBodyA.getInertialToBody(dateA); final Transform transformScToBodyA = new Transform(dateA, scToInertA, inertToBodyA); - + // from (current) Rugged instance B - final Transform scToInertB = scToBody.getScToInertial(dateB); + final Transform scToInertB = scToBody.getScToInertial(dateB); final Transform inertToBodyB = scToBody.getInertialToBody(dateB); final Transform transformScToBodyB = new Transform(dateB, scToInertB, inertToBodyB); // Get sensors LOS into local frame - final Vector3D vALocal = sensorA.getLOS(dateA, pixelA); - final Vector3D vBLocal = sensorB.getLOS(dateB, pixelB); + final Vector3D vALocal = sensorA.getLOS(dateA, pixelA); + final Vector3D vBLocal = sensorB.getLOS(dateB, pixelB); // Position of sensors into local frame final Vector3D sALocal = sensorA.getPosition(); // S_a : sensorA 's position final Vector3D sBLocal = sensorB.getPosition(); // S_b : sensorB 's position // Get sensors position and LOS into body frame - final Vector3D sA = transformScToBodyA.transformPosition(sALocal); // S_a : sensorA's position - final Vector3D vA = transformScToBodyA.transformVector(vALocal); // V_a : line of sight's vectorA - final Vector3D sB = transformScToBodyB.transformPosition(sBLocal); // S_b : sensorB's position - final Vector3D vB = transformScToBodyB.transformVector(vBLocal); // V_b : line of sight's vectorB + final Vector3D sA = transformScToBodyA.transformPosition(sALocal); // S_a : sensorA's position + final Vector3D vA = transformScToBodyA.transformVector(vALocal); // V_a : line of sight's vectorA + final Vector3D sB = transformScToBodyB.transformPosition(sBLocal); // S_b : sensorB's position + final Vector3D vB = transformScToBodyB.transformVector(vBLocal); // V_b : line of sight's vectorB // Compute distance final Vector3D vBase = sB.subtract(sA); // S_b - S_a @@ -675,13 +675,13 @@ public class Rugged { // Compute vector M_a -> M_B for which distance between LOS is minimum final Vector3D vDistanceMin = mB.subtract(mA); // M_b - M_a - + // Compute vector from mid point of vector M_a -> M_B to the ground (corresponds to minimum elevation) final Vector3D midPoint = (mB.add(mA)).scalarMultiply(0.5); // Get the euclidean norms to compute the minimum distances: between LOS and to the ground final double[] distances = {vDistanceMin.getNorm(), midPoint.getNorm()}; - + return distances; } @@ -707,12 +707,12 @@ public class Rugged { // Compute the approximate transforms between spacecraft and observed body // from Rugged instance A - final Transform scToInertA = scToBodyA.getScToInertial(dateA); + final Transform scToInertA = scToBodyA.getScToInertial(dateA); final Transform inertToBodyA = scToBodyA.getInertialToBody(dateA); final Transform transformScToBodyA = new Transform(dateA, scToInertA, inertToBodyA); - + // from (current) Rugged instance B - final Transform scToInertB = scToBody.getScToInertial(dateB); + final Transform scToInertB = scToBody.getScToInertial(dateB); final Transform inertToBodyB = scToBody.getInertialToBody(dateB); final Transform transformScToBodyB = new Transform(dateB, scToInertB, inertToBodyB); @@ -722,14 +722,14 @@ public class Rugged { // Get sensors LOS into body frame final FieldVector3D<DerivativeStructure> vA = transformScToBodyA.transformVector(vALocal); // V_a : line of sight's vectorA - final FieldVector3D<DerivativeStructure> vB = transformScToBodyB.transformVector(vBLocal); // V_b : line of sight's vectorB + final FieldVector3D<DerivativeStructure> vB = transformScToBodyB.transformVector(vBLocal); // V_b : line of sight's vectorB // Position of sensors into local frame - final Vector3D sAtmp = sensorA.getPosition(); - final Vector3D sBtmp = sensorB.getPosition(); - + final Vector3D sAtmp = sensorA.getPosition(); + final Vector3D sBtmp = sensorB.getPosition(); + final DerivativeStructure scaleFactor = FieldVector3D.dotProduct(vA.normalize(), vA.normalize()); // V_a.V_a=1 - + // Build a vector from the position and a scale factor (equals to 1). // The vector built will be scaleFactor * sAtmp for example. final FieldVector3D<DerivativeStructure> sALocal = new FieldVector3D<DerivativeStructure>(scaleFactor, sAtmp); @@ -752,19 +752,19 @@ public class Rugged { // Compute lambda_a = SV_a + lambdaB * V_a.V_b final DerivativeStructure lambdaA = vAvB.multiply(lambdaB).add(svA); - // Compute vector M_a: + // Compute vector M_a: final FieldVector3D<DerivativeStructure> mA = sA.add(vA.scalarMultiply(lambdaA)); // M_a = S_a + lambda_a * V_a // Compute vector M_b - final FieldVector3D<DerivativeStructure> mB = sB.add(vB.scalarMultiply(lambdaB)); // M_b = S_b + lambda_b * V_b + final FieldVector3D<DerivativeStructure> mB = sB.add(vB.scalarMultiply(lambdaB)); // M_b = S_b + lambda_b * V_b // Compute vector M_a -> M_B for which distance between LOS is minimum final FieldVector3D<DerivativeStructure> vDistanceMin = mB.subtract(mA); // M_b - M_a - + // Compute vector from mid point of vector M_a -> M_B to the ground (corresponds to minimum elevation) final FieldVector3D<DerivativeStructure> midPoint = (mB.add(mA)).scalarMultiply(0.5); // Get the euclidean norms to compute the minimum distances: - // between LOS + // between LOS final DerivativeStructure dMin = vDistanceMin.getNorm(); // to the ground final DerivativeStructure dEarth = midPoint.getNorm(); @@ -828,7 +828,7 @@ public class Rugged { */ public DerivativeStructure[] inverseLocationDerivatives(final String sensorName, - final GeodeticPoint point, + final GeodeticPoint point, final int minLine, final int maxLine, final DSGenerator generator) diff --git a/src/main/java/org/orekit/rugged/api/RuggedBuilder.java b/src/main/java/org/orekit/rugged/api/RuggedBuilder.java index a425d598..716fbfaa 100644 --- a/src/main/java/org/orekit/rugged/api/RuggedBuilder.java +++ b/src/main/java/org/orekit/rugged/api/RuggedBuilder.java @@ -256,7 +256,7 @@ public class RuggedBuilder { * IGNORE_DEM_USE_ELLIPSOID} does not require * any methods tobe called.</li> * </ul> - * + * * @param algorithmID identifier of algorithm to use for Digital Elevation Model intersection * @return the builder instance * @see #setDigitalElevationModel(TileUpdater, int) diff --git a/src/main/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTile.java b/src/main/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTile.java index 02c1fdc9..c65a4c69 100644 --- a/src/main/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTile.java +++ b/src/main/java/org/orekit/rugged/intersection/duvenhage/MinMaxTreeTile.java @@ -53,7 +53,7 @@ import org.orekit.rugged.utils.Selector; * If we consider for example a tall 107 ⨉ 19 raw tile, the min/max kd-tree will * have 9 levels: * </p> - * + * * <table border="0"> * <tr BGCOLOR="#EEEEFF"> * <td>Level</td> <td>Number of sub-tiles</td> <td>Regular sub-tiles dimension</td></tr> @@ -153,7 +153,7 @@ public class MinMaxTreeTile extends SimpleTile { * tree level l includes cell (i,j) but not cell (i+1, j+1). In other words, * interpolation implies sub-tile boundaries are overshoot by one column to * the East and one row to the North when computing min. - * + * * @param i row index of the cell * @param j column index of the cell * @param level tree level @@ -213,7 +213,7 @@ public class MinMaxTreeTile extends SimpleTile { * tree level l includes cell (i,j) but not cell (i+1, j+1). In other words, * interpolation implies sub-tile boundaries are overshoot by one column to * the East and one row to the North when computing max. - * + * * @param i row index of the cell * @param j column index of the cell * @param level tree level diff --git a/src/main/java/org/orekit/rugged/los/PolynomialRotation.java b/src/main/java/org/orekit/rugged/los/PolynomialRotation.java index 4f6c6b93..3a978793 100644 --- a/src/main/java/org/orekit/rugged/los/PolynomialRotation.java +++ b/src/main/java/org/orekit/rugged/los/PolynomialRotation.java @@ -125,7 +125,7 @@ public class PolynomialRotation implements LOSTransform { this(name, axis, referenceDate, angle.getCoefficients()); } - /** {@inheritDoc} + /** {@inheritDoc} * @since 2.0 */ @Override diff --git a/src/tutorials/java/RefiningPleiades/GroundRefining.java b/src/tutorials/java/RefiningPleiades/GroundRefining.java index 1aafed44..132c3910 100644 --- a/src/tutorials/java/RefiningPleiades/GroundRefining.java +++ b/src/tutorials/java/RefiningPleiades/GroundRefining.java @@ -117,13 +117,13 @@ public class GroundRefining extends Refining { orbitmodel.setLOFTransform(rollPoly, pitchPoly, yawPoly, minDate); // Satellite attitude - List<TimeStampedAngularCoordinates> satelliteQList = + List<TimeStampedAngularCoordinates> satelliteQList = orbitmodel.orbitToQ(orbit, earth, minDate.shiftedBy(-0.0), maxDate.shiftedBy(+0.0), 0.25); int nbQPoints = 2; // Position and velocities PVCoordinates PV = orbit.getPVCoordinates(earth.getBodyFrame()); - List<TimeStampedPVCoordinates> satellitePVList = + List<TimeStampedPVCoordinates> satellitePVList = orbitmodel.orbitToPV(orbit, earth, minDate.shiftedBy(-0.0), maxDate.shiftedBy(+0.0), 0.25); int nbPVPoints = 8; @@ -144,10 +144,10 @@ public class GroundRefining extends Refining { ruggedBuilder.setAlgorithm(AlgorithmId.IGNORE_DEM_USE_ELLIPSOID); ruggedBuilder.setEllipsoid(EllipsoidId.WGS84, BodyRotatingFrameId.ITRF); ruggedBuilder.setTimeSpan(minDate,maxDate, 0.001, 5.0); - ruggedBuilder.setTrajectory(InertialFrameId.EME2000, satellitePVList,nbPVPoints, + ruggedBuilder.setTrajectory(InertialFrameId.EME2000, satellitePVList,nbPVPoints, CartesianDerivativesFilter.USE_PV, satelliteQList, nbQPoints, AngularDerivativesFilter.USE_R); - + ruggedBuilder.setName("Rugged_refining"); refining.setRugged(ruggedBuilder.build()); @@ -285,7 +285,7 @@ public class GroundRefining extends Refining { double [] gsd = {gsdX, gsdY}; return gsd; } - + /** * Get the Pleiades viewing model * @return the Pleiades viewing model diff --git a/src/tutorials/java/RefiningPleiades/InterRefining.java b/src/tutorials/java/RefiningPleiades/InterRefining.java index a4d32f92..a342d080 100644 --- a/src/tutorials/java/RefiningPleiades/InterRefining.java +++ b/src/tutorials/java/RefiningPleiades/InterRefining.java @@ -161,19 +161,19 @@ public class InterRefining extends Refining { ruggedBuilderA.setAlgorithm(AlgorithmId.IGNORE_DEM_USE_ELLIPSOID); ruggedBuilderA.setEllipsoid(EllipsoidId.WGS84, BodyRotatingFrameId.ITRF); ruggedBuilderA.setTimeSpan(minDateA,maxDateA, 0.001, 5.0); - ruggedBuilderA.setTrajectory(InertialFrameId.EME2000, satellitePVListA, nbPVPoints, - CartesianDerivativesFilter.USE_PV, satelliteQListA, + ruggedBuilderA.setTrajectory(InertialFrameId.EME2000, satellitePVListA, nbPVPoints, + CartesianDerivativesFilter.USE_PV, satelliteQListA, nbQPoints, AngularDerivativesFilter.USE_R); ruggedBuilderA.setLightTimeCorrection(false); ruggedBuilderA.setAberrationOfLightCorrection(false); - + ruggedBuilderA.setName("RuggedA"); - + refining.setRuggedA(ruggedBuilderA.build()); - + System.out.format("\n**** Build Pleiades viewing model B and its orbit definition **** %n"); - + // 2/- Create Second Pleiades Viewing Model PleiadesViewingModel pleiadesViewingModelB = refining.getPleiadesViewingModelB(); final AbsoluteDate minDateB = pleiadesViewingModelB.getMinDate(); @@ -210,14 +210,14 @@ public class InterRefining extends Refining { ruggedBuilderB.setAlgorithm(AlgorithmId.IGNORE_DEM_USE_ELLIPSOID); ruggedBuilderB.setEllipsoid(EllipsoidId.WGS84, BodyRotatingFrameId.ITRF); ruggedBuilderB.setTimeSpan(minDateB,maxDateB, 0.001, 5.0); - ruggedBuilderB.setTrajectory(InertialFrameId.EME2000, satellitePVListB, nbPVPoints, - CartesianDerivativesFilter.USE_PV, satelliteQListB, + ruggedBuilderB.setTrajectory(InertialFrameId.EME2000, satellitePVListB, nbPVPoints, + CartesianDerivativesFilter.USE_PV, satelliteQListB, nbQPoints, AngularDerivativesFilter.USE_R); ruggedBuilderB.setLightTimeCorrection(false); ruggedBuilderB.setAberrationOfLightCorrection(false); - + ruggedBuilderB.setName("RuggedB"); - + refining.setRuggedB(ruggedBuilderB.build()); // Compute distance between LOS @@ -256,11 +256,11 @@ public class InterRefining extends Refining { // Noise definition // distribution: gaussian(0), vector dimension: 2 final Noise noise = new Noise(0,2); - // {pixelA mean, pixelB mean} + // {pixelA mean, pixelB mean} final double[] mean = {5.0,0.0}; // {pixelB std, pixelB std} final double[] standardDeviation = {0.1,0.1}; - + noise.setMean(mean); noise.setStandardDeviation(standardDeviation); @@ -354,13 +354,13 @@ public class InterRefining extends Refining { */ private double computeDistance(final LineSensor lineSensorA, final LineSensor lineSensorB) throws RuggedException { - + // Get number of line of sensors int dimensionA = pleiadesViewingModelA.getDimension(); int dimensionB = pleiadesViewingModelB.getDimension(); - Vector3D positionA = lineSensorA.getPosition(); + Vector3D positionA = lineSensorA.getPosition(); // This returns a zero vector since we set the relative position of the sensor w.r.T the satellite to 0. @@ -372,7 +372,7 @@ public class InterRefining extends Refining { FastMath.toDegrees(centerPointA.getLongitude()),centerPointA.getAltitude()); - Vector3D positionB = lineSensorB.getPosition(); + Vector3D positionB = lineSensorB.getPosition(); // This returns a zero vector since we set the relative position of the sensor w.r.T the satellite to 0. AbsoluteDate lineDateB = lineSensorB.getDate(dimensionB/2); diff --git a/src/tutorials/java/RefiningPleiades/Refining.java b/src/tutorials/java/RefiningPleiades/Refining.java index f72256a3..ee3c8fae 100644 --- a/src/tutorials/java/RefiningPleiades/Refining.java +++ b/src/tutorials/java/RefiningPleiades/Refining.java @@ -128,7 +128,7 @@ public class Refining { */ public InterMeasurementGenerator generatePoints(final int lineSampling, final int pixelSampling, final Rugged ruggedA, final String sensorNameA, final int dimensionA, - final Rugged ruggedB, final String sensorNameB, final int dimensionB) + final Rugged ruggedB, final String sensorNameB, final int dimensionB) throws RuggedException { // Outliers control @@ -198,10 +198,10 @@ public class Refining { final Noise noise) throws RuggedException { // Outliers control - final double outlierValue = 1.e+2; + final double outlierValue = 1.e+2; // Earth constraint weight - final double earthConstraintWeight = 0.1; + final double earthConstraintWeight = 0.1; // Generate measurements with constraints on Earth distance and outliers control InterMeasurementGenerator measurements = new InterMeasurementGenerator(ruggedA, sensorNameA, dimensionA, @@ -284,7 +284,7 @@ public class Refining { throw new OrekitExceptionWrapper(e); } }); - + rugged. getLineSensor(sensorName). getParametersDrivers(). @@ -292,7 +292,7 @@ public class Refining { forEach(driver -> { try { driver.setSelected(isSelected); - + // default value: no Z scale factor applied driver.setValue(1.0); } catch (OrekitException e) { @@ -334,7 +334,7 @@ public class Refining { final Collection<Rugged> ruggeds) throws RuggedException { System.out.format("Iterations max: %d\tconvergence threshold: %3.6e \n", maxIterations, convergenceThreshold); - + if(ruggeds.size()!= 2 ) { throw new RuggedException(RuggedMessages.UNSUPPORTED_REFINING_CONTEXT,ruggeds.size()); } diff --git a/src/tutorials/java/RefiningPleiades/generators/GroundMeasurementGenerator.java b/src/tutorials/java/RefiningPleiades/generators/GroundMeasurementGenerator.java index 21c34ce1..c7a7d95c 100644 --- a/src/tutorials/java/RefiningPleiades/generators/GroundMeasurementGenerator.java +++ b/src/tutorials/java/RefiningPleiades/generators/GroundMeasurementGenerator.java @@ -53,7 +53,7 @@ public class GroundMeasurementGenerator implements Measurable { /** Number of lines of the sensor */ private int dimension; - + /** Number of measurements */ private int measurementCount; @@ -63,7 +63,7 @@ public class GroundMeasurementGenerator implements Measurable { * @param dimension number of line of the sensor * @throws RuggedException */ - public GroundMeasurementGenerator(final Rugged rugged, final String sensorName, final int dimension) + public GroundMeasurementGenerator(final Rugged rugged, final String sensorName, final int dimension) throws RuggedException { // Generate reference mapping @@ -103,7 +103,7 @@ public class GroundMeasurementGenerator implements Measurable { for (double line = 0; line < dimension; line += lineSampling) { final AbsoluteDate date = sensor.getDate(line); - + for (int pixel = 0; pixel < sensor.getNbPixels(); pixel += pixelSampling) { final GeodeticPoint gp2 = rugged.directLocation(date, sensor.getPosition(), @@ -115,7 +115,7 @@ public class GroundMeasurementGenerator implements Measurable { measurementCount++; } } - + observables.addGroundMapping(groundMapping); } @@ -127,8 +127,8 @@ public class GroundMeasurementGenerator implements Measurable { final Vector3D latLongError = estimateLatLongError(); // Get noise features - final double[] mean = noise.getMean(); // [latitude, longitude, altitude] mean - final double[] std = noise.getStandardDeviation(); // [latitude, longitude, altitude] standard deviation + final double[] mean = noise.getMean(); // [latitude, longitude, altitude] mean + final double[] std = noise.getStandardDeviation(); // [latitude, longitude, altitude] standard deviation final double latErrorMean = mean[0] * latLongError.getX(); final double lonErrorMean = mean[1] * latLongError.getY(); @@ -161,12 +161,12 @@ public class GroundMeasurementGenerator implements Measurable { gp2.getAltitude() + vecRandom.getZ()); groundMapping.addMapping(new SensorPixel(line, pixel), gpNoisy); - + // increment the number of measurements measurementCount++; } } - + this.observables.addGroundMapping(groundMapping); } @@ -180,16 +180,16 @@ public class GroundMeasurementGenerator implements Measurable { final int pix = sensor.getNbPixels() / 2; final int line = (int) FastMath.floor(pix); // assumption : same number of line and pixels; - + final AbsoluteDate date = sensor.getDate(line); final GeodeticPoint gp_pix0 = rugged.directLocation(date, sensor.getPosition(), sensor.getLOS(date, pix)); - + final AbsoluteDate date1 = sensor.getDate(line + 1); final GeodeticPoint gp_pix1 = rugged.directLocation(date1, sensor.getPosition(), sensor.getLOS(date1, pix + 1)); - + final double latErr = FastMath.abs(gp_pix0.getLatitude() - gp_pix1.getLatitude()); final double lonErr = FastMath.abs(gp_pix0.getLongitude() - gp_pix1.getLongitude()); - + // final double distanceX = DistanceTools.computeDistanceInMeter(gp_pix0.getLongitude(), gp_pix0.getLatitude(), gp_pix1.getLongitude(), gp_pix0.getLatitude()); // final double distanceY = DistanceTools.computeDistanceInMeter(gp_pix0.getLongitude(), gp_pix0.getLatitude(), gp_pix0.getLongitude(), gp_pix1.getLatitude()); diff --git a/src/tutorials/java/RefiningPleiades/generators/InterMeasurementGenerator.java b/src/tutorials/java/RefiningPleiades/generators/InterMeasurementGenerator.java index 841be96b..152f413f 100644 --- a/src/tutorials/java/RefiningPleiades/generators/InterMeasurementGenerator.java +++ b/src/tutorials/java/RefiningPleiades/generators/InterMeasurementGenerator.java @@ -64,7 +64,7 @@ public class InterMeasurementGenerator implements Measurable { /** Number of measurements */ private int measurementCount; - // TODO GP pas utilise ... + // TODO GP pas utilise ... // private String sensorNameA; /** Sensor name B */ @@ -75,7 +75,7 @@ public class InterMeasurementGenerator implements Measurable { /** Number of line for acquisition B */ private int dimensionB; - + /** Limit value for outlier points */ private double outlier; @@ -195,8 +195,8 @@ public class InterMeasurementGenerator implements Measurable { sensorA.getLOS(dateA, pixelA)); final SensorPixel sensorPixelB = ruggedB.inverseLocation(sensorNameB, gpA, minLine, maxLine); - - // We need to test if the sensor pixel is found in the prescribed lines + + // We need to test if the sensor pixel is found in the prescribed lines // otherwise the sensor pixel is null if (sensorPixelB != null) { @@ -231,7 +231,7 @@ public class InterMeasurementGenerator implements Measurable { } } } - + this.observables.addInterMapping(interMapping); } @@ -246,10 +246,10 @@ public class InterMeasurementGenerator implements Measurable { throws RuggedException { // Get noise features (errors) - // [pixelA, pixelB] mean - final double[] mean = noise.getMean(); - // [pixelA, pixelB] standard deviation - final double[] std = noise.getStandardDeviation(); + // [pixelA, pixelB] mean + final double[] mean = noise.getMean(); + // [pixelA, pixelB] standard deviation + final double[] std = noise.getStandardDeviation(); // Search the sensor pixel seeing point final int minLine = 0; @@ -276,14 +276,14 @@ public class InterMeasurementGenerator implements Measurable { final GeodeticPoint gpA = ruggedA.directLocation(dateA, sensorA.getPosition(), sensorA.getLOS(dateA, pixelA)); final SensorPixel sensorPixelB = ruggedB.inverseLocation(sensorNameB, gpA, minLine, maxLine); - + // We need to test if the sensor pixel is found in the prescribed lines // otherwise the sensor pixel is null if (sensorPixelB != null) { final AbsoluteDate dateB = sensorB.getDate(sensorPixelB.getLineNumber()); final double pixelB = sensorPixelB.getPixelNumber(); - + // Get spacecraft to body transform of Rugged instance A final SpacecraftToObservedBody scToBodyA = ruggedA.getScToBody(); @@ -315,7 +315,7 @@ public class InterMeasurementGenerator implements Measurable { } } } - + this.observables.addInterMapping(interMapping); } diff --git a/src/tutorials/java/RefiningPleiades/generators/Measurable.java b/src/tutorials/java/RefiningPleiades/generators/Measurable.java index 77532b2e..8f30c415 100644 --- a/src/tutorials/java/RefiningPleiades/generators/Measurable.java +++ b/src/tutorials/java/RefiningPleiades/generators/Measurable.java @@ -35,7 +35,7 @@ public interface Measurable { /** Create measurements (without noise) * @param lineSampling line sampling * @param pixelSampling pixel sampling - * @throws RuggedException + * @throws RuggedException */ void createMeasurement(int lineSampling, int pixelSampling) throws RuggedException; diff --git a/src/tutorials/java/RefiningPleiades/metrics/LocalisationMetrics.java b/src/tutorials/java/RefiningPleiades/metrics/LocalisationMetrics.java index 0d1cd624..ec6015d6 100644 --- a/src/tutorials/java/RefiningPleiades/metrics/LocalisationMetrics.java +++ b/src/tutorials/java/RefiningPleiades/metrics/LocalisationMetrics.java @@ -63,7 +63,7 @@ public class LocalisationMetrics { /** Earth distance mean.*/ private double earthDistanceMean; - + /** Compute metrics corresponding to the ground points study. * @param measMapping Mapping of observations/measurements = the ground truth * @param rugged Rugged instance @@ -117,17 +117,17 @@ public class LocalisationMetrics { // Mapping of observations/measurements = the ground truth final Set<Map.Entry<SensorPixel, GeodeticPoint>> measurementsMapping; final LineSensor lineSensor; - + // counter for compute mean distance double count = 0; - + // Initialization measurementsMapping = measMapping.getMapping(); lineSensor = rugged.getLineSensor(measMapping.getSensorName()); - + // number of measurements int nbMeas = measurementsMapping.size(); - + final Iterator<Map.Entry<SensorPixel, GeodeticPoint>> gtIt = measurementsMapping.iterator(); // Browse map of measurements @@ -171,20 +171,20 @@ public class LocalisationMetrics { // Mapping of observations/measurements = the ground truth final Set<Map.Entry<SensorPixel, SensorPixel>> measurementsMapping; - final LineSensor lineSensorA; // line sensor corresponding to rugged A - final LineSensor lineSensorB; // line sensor corresponding to rugged B - double count = 0; // counter for computing remaining mean distance - double losDistanceCount = 0; // counter for computing LOS distance mean - double earthDistanceCount = 0; // counter for computing Earth distance mean - int i = 0; // increment of measurements + final LineSensor lineSensorA; // line sensor corresponding to rugged A + final LineSensor lineSensorB; // line sensor corresponding to rugged B + double count = 0; // counter for computing remaining mean distance + double losDistanceCount = 0; // counter for computing LOS distance mean + double earthDistanceCount = 0; // counter for computing Earth distance mean + int i = 0; // increment of measurements - // Initialization + // Initialization measurementsMapping = measMapping.getMapping(); lineSensorA = ruggedA.getLineSensor(measMapping.getSensorNameA()); lineSensorB = ruggedB.getLineSensor(measMapping.getSensorNameB()); - int nbMeas = measurementsMapping.size(); // number of measurements - - // Browse map of measurements + int nbMeas = measurementsMapping.size(); // number of measurements + + // Browse map of measurements for (Iterator<Map.Entry<SensorPixel, SensorPixel>> gtIt = measurementsMapping.iterator(); gtIt.hasNext(); i++) { diff --git a/src/tutorials/java/RefiningPleiades/models/OrbitModel.java b/src/tutorials/java/RefiningPleiades/models/OrbitModel.java index 5c19aa9e..52714924 100644 --- a/src/tutorials/java/RefiningPleiades/models/OrbitModel.java +++ b/src/tutorials/java/RefiningPleiades/models/OrbitModel.java @@ -60,7 +60,7 @@ import org.orekit.utils.TimeStampedPVCoordinates; import org.orekit.utils.AngularDerivativesFilter; /** - * TODO GP add comments for tuto + * TODO GP add comments for tuto * Orbit Model class to generate positions-velocities and attitude quaternions. * @author Jonathan Guinet * @author Guylaine Prat @@ -159,14 +159,14 @@ public class OrbitModel { final Frame eme2000 = FramesFactory.getEME2000(); return new CircularOrbit(694000.0 + Constants.WGS84_EARTH_EQUATORIAL_RADIUS, - -4.029194321683225E-4, + -4.029194321683225E-4, 0.0013530362644647786, FastMath.toRadians(98.2), // Pleiades inclination 98.2 deg FastMath.toRadians(-86.47 + 180), FastMath.toRadians(135.9 + 0.3), - PositionAngle.TRUE, - eme2000, - date, + PositionAngle.TRUE, + eme2000, + date, mu); } @@ -213,7 +213,7 @@ public class OrbitModel { getAttitude(orbit, orbit.getDate().getDate().shiftedBy(shift), orbit.getFrame()). getRotation(); final Rotation offsetProper = offsetAtt.compose(nadirAtt.revert(), RotationConvention.VECTOR_OPERATOR); - + return offsetProper; } @@ -252,20 +252,20 @@ public class OrbitModel { final AttitudeProvider attitudeProvider = createAttitudeProvider(earth, orbit); - final SpacecraftState state = + final SpacecraftState state = new SpacecraftState(orbit, attitudeProvider.getAttitude(orbit, orbit.getDate(), orbit.getFrame()), 1180.0); // numerical model for improving orbit final OrbitType type = OrbitType.CIRCULAR; final double[][] tolerances = NumericalPropagator.tolerances(0.1, orbit, type); - final DormandPrince853Integrator integrator = + final DormandPrince853Integrator integrator = new DormandPrince853Integrator(1.0e-4 * orbit.getKeplerianPeriod(), 1.0e-1 * orbit.getKeplerianPeriod(), tolerances[0], tolerances[1]); integrator.setInitialStepSize(1.0e-2 * orbit.getKeplerianPeriod()); - + final NumericalPropagator numericalPropagator = new NumericalPropagator(integrator); numericalPropagator.addForceModel(new HolmesFeatherstoneAttractionModel(earth.getBodyFrame(), gravityField)); numericalPropagator .addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getSun())); @@ -273,14 +273,14 @@ public class OrbitModel { numericalPropagator.setOrbitType(type); numericalPropagator.setInitialState(state); numericalPropagator.setAttitudeProvider(attitudeProvider); - + return numericalPropagator; } /** TODO GP add comments */ - public List<TimeStampedPVCoordinates> orbitToPV(final Orbit orbit, final BodyShape earth, - final AbsoluteDate minDate, final AbsoluteDate maxDate, + public List<TimeStampedPVCoordinates> orbitToPV(final Orbit orbit, final BodyShape earth, + final AbsoluteDate minDate, final AbsoluteDate maxDate, final double step) throws OrekitException { @@ -290,21 +290,21 @@ public class OrbitModel { propagator.propagate(minDate); final List<TimeStampedPVCoordinates> list = new ArrayList<TimeStampedPVCoordinates>(); - propagator.setMasterMode(step, + propagator.setMasterMode(step, (currentState, isLast) -> list.add(new TimeStampedPVCoordinates(currentState.getDate(), currentState.getPVCoordinates().getPosition(), currentState.getPVCoordinates().getVelocity(), Vector3D.ZERO))); propagator.propagate(maxDate); - + return list; } /** TODO GP add comments */ - public List<TimeStampedAngularCoordinates> orbitToQ(final Orbit orbit, final BodyShape earth, - final AbsoluteDate minDate, final AbsoluteDate maxDate, + public List<TimeStampedAngularCoordinates> orbitToQ(final Orbit orbit, final BodyShape earth, + final AbsoluteDate minDate, final AbsoluteDate maxDate, final double step) throws OrekitException { @@ -319,7 +319,7 @@ public class OrbitModel { Vector3D.ZERO, Vector3D.ZERO))); propagator.propagate(maxDate); - + return list; } } diff --git a/src/tutorials/java/RefiningPleiades/models/PleiadesViewingModel.java b/src/tutorials/java/RefiningPleiades/models/PleiadesViewingModel.java index 8e5f3d4f..99927670 100644 --- a/src/tutorials/java/RefiningPleiades/models/PleiadesViewingModel.java +++ b/src/tutorials/java/RefiningPleiades/models/PleiadesViewingModel.java @@ -40,7 +40,7 @@ import org.orekit.rugged.errors.RuggedException; import org.orekit.errors.OrekitException; /** - * TODO GP add comments for tuto + * TODO GP add comments for tuto * Pleiades viewing model class definition. * @author Jonathan Guinet * @author Lucie Labat-Allee @@ -51,7 +51,7 @@ public class PleiadesViewingModel { /** intrinsic Pleiades parameters. */ private double fov = 1.65; // 20km - alt 694km - + // Number of line of the sensor private int dimension = 40000; @@ -118,7 +118,7 @@ public class PleiadesViewingModel { // factor is a common parameters shared between all Pleiades models losBuilder.addTransform(new FixedZHomothety("factor", 1.0)); - + return losBuilder.build(); } @@ -180,7 +180,7 @@ public int getDimension() { // linear datation model: at reference time we get the middle line, and the rate is one line every 1.5ms final LineDatation lineDatation = new LinearLineDatation(getDatationReference(), dimension / 2, rate); - + lineSensor = new LineSensor(sensorName, lineDatation, msiOffset, lineOfSight); } } diff --git a/src/tutorials/java/fr/cs/examples/DirectLocation.java b/src/tutorials/java/fr/cs/examples/DirectLocation.java index e8d3d33e..be4f57b9 100644 --- a/src/tutorials/java/fr/cs/examples/DirectLocation.java +++ b/src/tutorials/java/fr/cs/examples/DirectLocation.java @@ -64,10 +64,10 @@ public class DirectLocation { File orekitData = new File(home, "orekit-data"); DataProvidersManager.getInstance().addProvider(new DirectoryCrawler(orekitData)); - // Sensor's definition + // Sensor's definition // =================== // Line of sight - // ------------- + // ------------- // The raw viewing direction of pixel i with respect to the instrument is defined by the vector: List<Vector3D> rawDirs = new ArrayList<Vector3D>(); for (int i = 0; i < 2000; i++) { @@ -82,7 +82,7 @@ public class DirectLocation { TimeDependentLOS lineOfSight = losBuilder.build(); - // Datation model + // Datation model // -------------- // We use Orekit for handling time and dates, and Rugged for defining the datation model: TimeScale gps = TimeScalesFactory.getGPS(); @@ -176,7 +176,7 @@ public class DirectLocation { double px, double py, double pz, double vx, double vy, double vz) throws OrekitException { AbsoluteDate ephemerisDate = new AbsoluteDate(absDate, gps); - Vector3D position = new Vector3D(px, py, pz); // in ITRF, unit: m + Vector3D position = new Vector3D(px, py, pz); // in ITRF, unit: m Vector3D velocity = new Vector3D(vx, vy, vz); // in ITRF, unit: m/s PVCoordinates pvITRF = new PVCoordinates(position, velocity); Transform transform = itrf.getTransformTo(eme2000, ephemerisDate); -- GitLab