Skip to content
Snippets Groups Projects
Commit 7a20923c authored by Guylaine Prat's avatar Guylaine Prat
Browse files

Checkstyle corrections

parent a1f78c0c
No related branches found
No related tags found
1 merge request!3Custom margin for atmospheric refraction; made exception message clearer
Pipeline #2126 passed
...@@ -727,7 +727,7 @@ public class Rugged { ...@@ -727,7 +727,7 @@ public class Rugged {
if (sp0 == null) { if (sp0 == null) {
// In order for the dump to end nicely // In order for the dump to end nicely
DumpManager.endNicely(); DumpManager.endNicely();
// Impossible to find the sensor pixel in the given range lines (without atmosphere) // 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); throw new RuggedException(RuggedMessages.SENSOR_PIXEL_NOT_FOUND_IN_RANGE_LINES, minLine, maxLine);
} }
...@@ -813,10 +813,10 @@ public class Rugged { ...@@ -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) // 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)) { if (!pixelIsInside(sensorPixelGrid[uIndex][vIndex], sensor)) {
// In order for the dump to end nicely // In order for the dump to end nicely
DumpManager.endNicely(); DumpManager.endNicely();
if (sensorPixelGrid[uIndex][vIndex] == null) { if (sensorPixelGrid[uIndex][vIndex] == null) {
// Impossible to find the sensor pixel in the given range lines // Impossible to find the sensor pixel in the given range lines
throw new RuggedException(RuggedMessages.SENSOR_PIXEL_NOT_FOUND_IN_RANGE_LINES, minLine, maxLine); throw new RuggedException(RuggedMessages.SENSOR_PIXEL_NOT_FOUND_IN_RANGE_LINES, minLine, maxLine);
...@@ -824,7 +824,7 @@ public class Rugged { ...@@ -824,7 +824,7 @@ public class Rugged {
// Impossible to find the sensor pixel // Impossible to find the sensor pixel
final double invLocationMargin = atmosphericRefraction.getComputationParameters().getInverseLocMargin(); final double invLocationMargin = atmosphericRefraction.getComputationParameters().getInverseLocMargin();
throw new RuggedException(RuggedMessages.SENSOR_PIXEL_NOT_FOUND_IN_PIXELS_LINE, sensorPixelGrid[uIndex][vIndex].getPixelNumber(), 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 { ...@@ -851,7 +851,7 @@ public class Rugged {
private boolean pixelIsInside(final SensorPixel pixel, final LineSensor sensor) { private boolean pixelIsInside(final SensorPixel pixel, final LineSensor sensor) {
// Get the inverse location margin // Get the inverse location margin
final double invLocationMargin = atmosphericRefraction.getComputationParameters().getInverseLocMargin(); final double invLocationMargin = atmosphericRefraction.getComputationParameters().getInverseLocMargin();
return pixel != null && pixel.getPixelNumber() >= -invLocationMargin && pixel.getPixelNumber() < invLocationMargin + sensor.getNbPixels() - 1; return pixel != null && pixel.getPixelNumber() >= -invLocationMargin && pixel.getPixelNumber() < invLocationMargin + sensor.getNbPixels() - 1;
} }
......
...@@ -39,15 +39,15 @@ public class AtmosphericComputationParameters { ...@@ -39,15 +39,15 @@ public class AtmosphericComputationParameters {
/** Default value for line step. */ /** Default value for line step. */
private static final int DEFAULT_STEP_LINE = 100; 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. */ /** Actual values for pixel step in case default are overwritten. */
private int pixelStep; private int pixelStep;
/** Actual values for line step in case default are overwritten. */ /** Actual values for line step in case default are overwritten. */
private int lineStep; 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. /** Actual values for inverse location margin with atmospheric refraction in case default are overwritten.
* @since 3.0 * @since 3.0
...@@ -131,7 +131,7 @@ public class AtmosphericComputationParameters { ...@@ -131,7 +131,7 @@ public class AtmosphericComputationParameters {
this.pixelStep = gridPixelStep; this.pixelStep = gridPixelStep;
this.lineStep = gridLineStep; this.lineStep = gridLineStep;
} }
/** /**
* Set the margin for computation of inverse location with atmospheric refraction correction. * Set the margin for computation of inverse location with atmospheric refraction correction.
* Overwrite the default value DEFAULT_INVLOC_MARGIN. * Overwrite the default value DEFAULT_INVLOC_MARGIN.
...@@ -140,7 +140,6 @@ public class AtmosphericComputationParameters { ...@@ -140,7 +140,6 @@ public class AtmosphericComputationParameters {
* @since 3.0 * @since 3.0
*/ */
public void setInverseLocMargin(final double inverseLocMargin) { public void setInverseLocMargin(final double inverseLocMargin) {
this.invlocMargin = inverseLocMargin; this.invlocMargin = inverseLocMargin;
} }
...@@ -149,7 +148,7 @@ public class AtmosphericComputationParameters { ...@@ -149,7 +148,7 @@ public class AtmosphericComputationParameters {
* @since 3.0 * @since 3.0
*/ */
public double getInverseLocMargin () { public double getInverseLocMargin () {
return this.invlocMargin; return this.invlocMargin;
} }
/** /**
...@@ -157,9 +156,9 @@ public class AtmosphericComputationParameters { ...@@ -157,9 +156,9 @@ public class AtmosphericComputationParameters {
* @since 3.0 * @since 3.0
*/ */
public double getDefaultInverseLocMargin () { public double getDefaultInverseLocMargin () {
return DEFAULT_INVLOC_MARGIN; return DEFAULT_INVLOC_MARGIN;
} }
/** /**
* @return the size of pixel grid * @return the size of pixel grid
*/ */
......
...@@ -142,7 +142,7 @@ public abstract class AtmosphericRefraction { ...@@ -142,7 +142,7 @@ public abstract class AtmosphericRefraction {
public void setGridSteps(final int pixelStep, final int lineStep) { public void setGridSteps(final int pixelStep, final int lineStep) {
atmosphericParams.setGridSteps(pixelStep, lineStep); atmosphericParams.setGridSteps(pixelStep, lineStep);
} }
/** /**
* Set the margin for computation of inverse location with atmospheric refraction correction. * Set the margin for computation of inverse location with atmospheric refraction correction.
* Overwrite the default value DEFAULT_INVLOC_MARGIN. * Overwrite the default value DEFAULT_INVLOC_MARGIN.
...@@ -186,7 +186,7 @@ public abstract class AtmosphericRefraction { ...@@ -186,7 +186,7 @@ public abstract class AtmosphericRefraction {
} else { } else {
// Impossible to find the sensor pixel in the given range lines // 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()); atmosphericParams.getMinLineSensor(), atmosphericParams.getMaxLineSensor());
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment