From 7a20923cccec9a29520293780e9b8b085c66ad25 Mon Sep 17 00:00:00 2001 From: gprat <guylaine.prat@csgroup.eu> Date: Wed, 15 Jun 2022 11:28:27 +0200 Subject: [PATCH] Checkstyle corrections --- .../java/org/orekit/rugged/api/Rugged.java | 10 +++++----- .../AtmosphericComputationParameters.java | 19 +++++++++---------- .../refraction/AtmosphericRefraction.java | 4 ++-- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/orekit/rugged/api/Rugged.java b/src/main/java/org/orekit/rugged/api/Rugged.java index de131078..a6ab89e1 100644 --- a/src/main/java/org/orekit/rugged/api/Rugged.java +++ b/src/main/java/org/orekit/rugged/api/Rugged.java @@ -727,7 +727,7 @@ public class Rugged { if (sp0 == null) { // In order for the dump to end nicely DumpManager.endNicely(); - + // Impossible to find the sensor pixel in the given range lines (without atmosphere) throw new RuggedException(RuggedMessages.SENSOR_PIXEL_NOT_FOUND_IN_RANGE_LINES, minLine, maxLine); } @@ -813,10 +813,10 @@ public class Rugged { // Check if the pixel is inside the sensor (with a margin) OR if the inverse location was impossible (null result) if (!pixelIsInside(sensorPixelGrid[uIndex][vIndex], sensor)) { - + // In order for the dump to end nicely DumpManager.endNicely(); - + if (sensorPixelGrid[uIndex][vIndex] == null) { // Impossible to find the sensor pixel in the given range lines throw new RuggedException(RuggedMessages.SENSOR_PIXEL_NOT_FOUND_IN_RANGE_LINES, minLine, maxLine); @@ -824,7 +824,7 @@ public class Rugged { // Impossible to find the sensor pixel final double invLocationMargin = atmosphericRefraction.getComputationParameters().getInverseLocMargin(); throw new RuggedException(RuggedMessages.SENSOR_PIXEL_NOT_FOUND_IN_PIXELS_LINE, sensorPixelGrid[uIndex][vIndex].getPixelNumber(), - (-invLocationMargin), (invLocationMargin + sensor.getNbPixels() - 1), invLocationMargin); + -invLocationMargin, invLocationMargin + sensor.getNbPixels() - 1, invLocationMargin); } } @@ -851,7 +851,7 @@ public class Rugged { private boolean pixelIsInside(final SensorPixel pixel, final LineSensor sensor) { // Get the inverse location margin final double invLocationMargin = atmosphericRefraction.getComputationParameters().getInverseLocMargin(); - + return pixel != null && pixel.getPixelNumber() >= -invLocationMargin && pixel.getPixelNumber() < invLocationMargin + sensor.getNbPixels() - 1; } diff --git a/src/main/java/org/orekit/rugged/refraction/AtmosphericComputationParameters.java b/src/main/java/org/orekit/rugged/refraction/AtmosphericComputationParameters.java index 3f63b0f2..7eb96d68 100644 --- a/src/main/java/org/orekit/rugged/refraction/AtmosphericComputationParameters.java +++ b/src/main/java/org/orekit/rugged/refraction/AtmosphericComputationParameters.java @@ -39,15 +39,15 @@ public class AtmosphericComputationParameters { /** Default value for line step. */ private static final int DEFAULT_STEP_LINE = 100; + /** Default margin for computation of inverse location with atmospheric refraction correction. + * @since 3.0 + */ + private static final double DEFAULT_INVLOC_MARGIN = 0.8; + /** Actual values for pixel step in case default are overwritten. */ private int pixelStep; /** Actual values for line step in case default are overwritten. */ private int lineStep; - - /** Default margin for computation of inverse location with atmospheric refraction correction. - * @since 3.0 - */ - private static final double DEFAULT_INVLOC_MARGIN = 0.8; /** Actual values for inverse location margin with atmospheric refraction in case default are overwritten. * @since 3.0 @@ -131,7 +131,7 @@ public class AtmosphericComputationParameters { this.pixelStep = gridPixelStep; this.lineStep = gridLineStep; } - + /** * Set the margin for computation of inverse location with atmospheric refraction correction. * Overwrite the default value DEFAULT_INVLOC_MARGIN. @@ -140,7 +140,6 @@ public class AtmosphericComputationParameters { * @since 3.0 */ public void setInverseLocMargin(final double inverseLocMargin) { - this.invlocMargin = inverseLocMargin; } @@ -149,7 +148,7 @@ public class AtmosphericComputationParameters { * @since 3.0 */ public double getInverseLocMargin () { - return this.invlocMargin; + return this.invlocMargin; } /** @@ -157,9 +156,9 @@ public class AtmosphericComputationParameters { * @since 3.0 */ public double getDefaultInverseLocMargin () { - return DEFAULT_INVLOC_MARGIN; + return DEFAULT_INVLOC_MARGIN; } - + /** * @return the size of pixel grid */ diff --git a/src/main/java/org/orekit/rugged/refraction/AtmosphericRefraction.java b/src/main/java/org/orekit/rugged/refraction/AtmosphericRefraction.java index 65e3cae3..02416a1f 100644 --- a/src/main/java/org/orekit/rugged/refraction/AtmosphericRefraction.java +++ b/src/main/java/org/orekit/rugged/refraction/AtmosphericRefraction.java @@ -142,7 +142,7 @@ public abstract class AtmosphericRefraction { public void setGridSteps(final int pixelStep, final int lineStep) { atmosphericParams.setGridSteps(pixelStep, lineStep); } - + /** * Set the margin for computation of inverse location with atmospheric refraction correction. * Overwrite the default value DEFAULT_INVLOC_MARGIN. @@ -186,7 +186,7 @@ public abstract class AtmosphericRefraction { } else { // Impossible to find the sensor pixel in the given range lines - throw new RuggedException(RuggedMessages.SENSOR_PIXEL_NOT_FOUND_IN_RANGE_LINES, + throw new RuggedException(RuggedMessages.SENSOR_PIXEL_NOT_FOUND_IN_RANGE_LINES, atmosphericParams.getMinLineSensor(), atmosphericParams.getMaxLineSensor()); } } -- GitLab