Skip to content
Snippets Groups Projects
Commit b7924bb5 authored by Jonathan Guinet's avatar Jonathan Guinet
Browse files

checkstyle corrections

parent 9a2882e9
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,7 @@ import org.hipparchus.util.FastMath; ...@@ -35,7 +35,7 @@ import org.hipparchus.util.FastMath;
/** Ground measures generator (sensor to ground mapping) /** Ground measures generator (sensor to ground mapping).
* @author Jonathan Guinet * @author Jonathan Guinet
* @autor Lucie Labat-Allee * @autor Lucie Labat-Allee
*/ */
...@@ -58,7 +58,7 @@ public class GroundMeasureGenerator implements Measurable { ...@@ -58,7 +58,7 @@ public class GroundMeasureGenerator implements Measurable {
* *
* </p> * </p>
*/ */
public GroundMeasureGenerator(Rugged rugged, String sensorName, int dimension) throws RuggedException public GroundMeasureGenerator(final Rugged rugged, final String sensorName, final int dimension) throws RuggedException
{ {
// generate reference mapping // generate reference mapping
...@@ -69,69 +69,69 @@ public class GroundMeasureGenerator implements Measurable { ...@@ -69,69 +69,69 @@ public class GroundMeasureGenerator implements Measurable {
this.dimension = dimension; this.dimension = dimension;
} }
public SensorToGroundMapping getGroundMapping() { public SensorToGroundMapping getGroundMapping() {
return groundMapping; return groundMapping;
} }
public int getMeasureCount() { public int getMeasureCount() {
return measureCount; return measureCount;
} }
public void createMeasure(final int lineSampling,final int pixelSampling) throws RuggedException public void createMeasure(final int lineSampling,final int pixelSampling) throws RuggedException
{ {
for (double line = 0; line < dimension; line += lineSampling) { for (double line = 0; line < dimension; line += lineSampling) {
AbsoluteDate date = sensor.getDate(line); final AbsoluteDate date = sensor.getDate(line);
for (int pixel = 0; pixel < sensor.getNbPixels(); pixel += pixelSampling) { for (int pixel = 0; pixel < sensor.getNbPixels(); pixel += pixelSampling) {
GeodeticPoint gp2 = rugged.directLocation(date, sensor.getPosition(), final GeodeticPoint gp2 = rugged.directLocation(date, sensor.getPosition(),
sensor.getLOS(date, pixel)); sensor.getLOS(date, pixel));
groundMapping.addMapping(new SensorPixel(line, pixel), gp2); groundMapping.addMapping(new SensorPixel(line, pixel), gp2);
measureCount++; measureCount++;
} }
} }
} }
public void createNoisyMeasure(final int lineSampling,final int pixelSampling, Noise noise) throws RuggedException public void createNoisyMeasure(final int lineSampling,final int pixelSampling, final Noise noise) throws RuggedException
{ {
/* Estimate latitude and longitude errors estimation */ /* Estimate latitude and longitude errors estimation */
Vector3D latLongError = estimateLatLongError(); final Vector3D latLongError = estimateLatLongError();
/* Get noise features */ /* Get noise features */
final double[] mean = noise.getMean(); /* [latitude, longitude, altitude] mean */ final double[] mean = noise.getMean(); /* [latitude, longitude, altitude] mean */
final double[] std = noise.getStandardDeviation(); /* [latitude, longitude, altitude] standard deviation */ final double[] std = noise.getStandardDeviation(); /* [latitude, longitude, altitude] standard deviation */
double latErrorMean = mean[0]*latLongError.getX(); // in line: -0.000002 deg final double latErrorMean = mean[0] * latLongError.getX(); // in line: -0.000002 deg
double lonErrorMean = mean[1]*latLongError.getY(); // in line: 0.000012 deg final double lonErrorMean = mean[1] * latLongError.getY(); // in line: 0.000012 deg
double latErrorStd = std[0]*latLongError.getX(); // in line: -0.000002 deg final double latErrorStd = std[0] * latLongError.getX(); // in line: -0.000002 deg
double lonErrorStd = std[1]*latLongError.getY(); // in line: 0.000012 deg final double lonErrorStd = std[1] * latLongError.getY(); // in line: 0.000012 deg
// Gaussian random generator // Gaussian random generator
// Build a null mean random uncorrelated vector generator with standard deviation corresponding to the estimated error on ground // Build a null mean random uncorrelated vector generator with standard deviation corresponding to the estimated error on ground
double meanGenerator[] = {latErrorMean, lonErrorMean, mean[2]}; final double meanGenerator[] = {latErrorMean, lonErrorMean, mean[2]};
double stdGenerator[] = {latErrorStd, lonErrorStd, std[2]}; final double stdGenerator[] = {latErrorStd, lonErrorStd, std[2]};
System.out.format("Corresponding error estimation on ground {Latitude, Longitude, Altitude}:%n"); System.out.format("Corresponding error estimation on ground {Latitude, Longitude, Altitude}:%n");
System.out.format("\tMean: {%1.10f rad, %1.10f rad, %1.10f m} %n",meanGenerator[0],meanGenerator[1],meanGenerator[2]); System.out.format("\tMean: {%1.10f rad, %1.10f rad, %1.10f m} %n", meanGenerator[0], meanGenerator[1], meanGenerator[2]);
System.out.format("\tStd : {%1.10f rad, %1.10f rad, %1.10f m} %n",stdGenerator[0],stdGenerator[1],stdGenerator[2]); System.out.format("\tStd : {%1.10f rad, %1.10f rad, %1.10f m} %n", stdGenerator[0], stdGenerator[1], stdGenerator[2]);
GaussianRandomGenerator rng = new GaussianRandomGenerator(new Well19937a(0xefac03d9be4d24b9l)); final GaussianRandomGenerator rng = new GaussianRandomGenerator(new Well19937a(0xefac03d9be4d24b9l));
UncorrelatedRandomVectorGenerator rvg = new UncorrelatedRandomVectorGenerator(meanGenerator, stdGenerator, rng); final UncorrelatedRandomVectorGenerator rvg = new UncorrelatedRandomVectorGenerator(meanGenerator, stdGenerator, rng);
System.out.format("Add a gaussian noise to measures without biais (null mean) and standard deviation%n corresponding to the estimated error on ground.%n"); System.out.format("Add a gaussian noise to measures without biais (null mean) and standard deviation%n corresponding to the estimated error on ground.%n");
for (double line = 0; line < dimension; line += lineSampling) { for (double line = 0; line < dimension; line += lineSampling) {
AbsoluteDate date = sensor.getDate(line); final AbsoluteDate date = sensor.getDate(line);
for (int pixel = 0; pixel < sensor.getNbPixels(); pixel += pixelSampling) { for (int pixel = 0; pixel < sensor.getNbPixels(); pixel += pixelSampling) {
// Components of generated vector follow (independent) Gaussian distribution // Components of generated vector follow (independent) Gaussian distribution
Vector3D vecRandom = new Vector3D(rvg.nextVector()); final Vector3D vecRandom = new Vector3D(rvg.nextVector());
GeodeticPoint gp2 = rugged.directLocation(date, sensor.getPosition(), final GeodeticPoint gp2 = rugged.directLocation(date, sensor.getPosition(),
sensor.getLOS(date, pixel)); sensor.getLOS(date, pixel));
GeodeticPoint gpNoisy = new GeodeticPoint(gp2.getLatitude()+vecRandom.getX(), final GeodeticPoint gpNoisy = new GeodeticPoint(gp2.getLatitude()+vecRandom.getX(),
gp2.getLongitude()+vecRandom.getY(), gp2.getLongitude()+vecRandom.getY(),
gp2.getAltitude()+vecRandom.getZ()); gp2.getAltitude()+vecRandom.getZ());
...@@ -153,11 +153,11 @@ public class GroundMeasureGenerator implements Measurable { ...@@ -153,11 +153,11 @@ public class GroundMeasureGenerator implements Measurable {
final int line= (int) FastMath.floor(pix); // assumption : same number of line and pixels; final int line= (int) FastMath.floor(pix); // assumption : same number of line and pixels;
System.out.format("Pixel size estimated at position pix: %d line: %d %n", pix, line); System.out.format("Pixel size estimated at position pix: %d line: %d %n", pix, line);
final AbsoluteDate date = sensor.getDate(line); final AbsoluteDate date = sensor.getDate(line);
GeodeticPoint gp_pix0 = rugged.directLocation(date, sensor.getPosition(), sensor.getLOS(date, pix)); final GeodeticPoint gp_pix0 = rugged.directLocation(date, sensor.getPosition(), sensor.getLOS(date, pix));
final AbsoluteDate date1 = sensor.getDate(line+1); final AbsoluteDate date1 = sensor.getDate(line+1);
GeodeticPoint gp_pix1 = rugged.directLocation(date1, sensor.getPosition(), sensor.getLOS(date1, pix+1)); final GeodeticPoint gp_pix1 = rugged.directLocation(date1, sensor.getPosition(), sensor.getLOS(date1, pix+1));
double latErr=FastMath.abs(gp_pix0.getLatitude()-gp_pix1.getLatitude()); final double latErr = FastMath.abs(gp_pix0.getLatitude() - gp_pix1.getLatitude());
double lonErr=FastMath.abs(gp_pix0.getLongitude()-gp_pix1.getLongitude()); final double lonErr = FastMath.abs(gp_pix0.getLongitude() - gp_pix1.getLongitude());
//double dist = FastMath.sqrt(lonErr*lonErr + latErr*latErr)/FastMath.sqrt(2); //double dist = FastMath.sqrt(lonErr*lonErr + latErr*latErr)/FastMath.sqrt(2);
final double distanceX = DistanceTools.computeDistanceInMeter(gp_pix0.getLongitude(), gp_pix0.getLatitude(),gp_pix1.getLongitude(), gp_pix0.getLatitude()); 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()); final double distanceY = DistanceTools.computeDistanceInMeter(gp_pix0.getLongitude(), gp_pix0.getLatitude(),gp_pix0.getLongitude(), gp_pix1.getLatitude());
...@@ -165,9 +165,7 @@ public class GroundMeasureGenerator implements Measurable { ...@@ -165,9 +165,7 @@ public class GroundMeasureGenerator implements Measurable {
System.out.format("Estimated distance: X %3.3f Y %3.3f %n",distanceX, distanceY); System.out.format("Estimated distance: X %3.3f Y %3.3f %n",distanceX, distanceY);
//System.out.format(" lat : %1.10f %1.10f %n", latErr, lonErr); //System.out.format(" lat : %1.10f %1.10f %n", latErr, lonErr);
return new Vector3D(latErr,lonErr,0.0); return new Vector3D(latErr, lonErr, 0.0);
} }
} }
...@@ -32,13 +32,13 @@ import org.hipparchus.random.GaussianRandomGenerator; ...@@ -32,13 +32,13 @@ import org.hipparchus.random.GaussianRandomGenerator;
import org.hipparchus.random.Well19937a; import org.hipparchus.random.Well19937a;
/** /**
* Inter-measures generator (sensor to sensor mapping) * Inter-measures generator (sensor to sensor mapping).
* @author Jonathan Guinet * @author Jonathan Guinet
* @author Lucie Labatallee * @author Lucie Labatallee
*/ */
public class InterMeasureGenerator implements Measurable { public class InterMeasureGenerator implements Measurable {
/** mapping */ /** mapping. */
private SensorToSensorMapping interMapping; private SensorToSensorMapping interMapping;
private Rugged ruggedA; private Rugged ruggedA;
......
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