Commit ce010d1c authored by Bryan Cazabonne's avatar Bryan Cazabonne

Fixed checkstyle warnings.

parent 424bbc36
......@@ -84,6 +84,27 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
*/
public class Phasing {
/** Key to print initial osculating orbit. */
private static final String INITIAL_OSC_ORBIT = "initial osculating orbit%n";
/** Key to print final osculating orbit. */
private static final String FINAL_OSC_ORBIT = "%nfinal osculating orbit%n";
/** Key to print initial and final epochs. */
private static final String EPOCH = " date = %s%n";
/** Key to print initial and final orbital elements. */
private static final String ORBITAL_ELEMENTS = " a = %14.6f m, ex = %17.10e, ey = %17.10e, i = %12.9f deg, Ω = %12.9f deg%n";
/** Key to pthe iteration report. */
private static final String ITERATION_REPORT = " iteration %2d: Δa = %12.6f m, Δex = %13.6e, Δey = %13.6e, Δi = %12.9f deg, ΔΩ = %12.9f deg, ΔP = %11.6f m, ΔV = %11.9f m/s%n";
/** Key to print the title for the final frozen eccentricity. */
private static final String FROZEN_ECC_TITLE = "%nfinal frozen eccentricity%n";
/** Key to print the the final frozen eccentricity. */
private static final String FROZEN_ECC = " ex_f = %17.10e, ey_f = %17.10e%n";
/** GMST function. */
private final TimeScalarFunction gmst;
......@@ -187,10 +208,10 @@ public class Phasing {
// initial guess for orbit
CircularOrbit orbit = guessOrbit(date, frame, nbOrbits, nbDays,
latitude, ascending, mst);
System.out.format(Locale.US, "initial osculating orbit%n");
System.out.format(Locale.US, " date = %s%n",
System.out.format(Locale.US, INITIAL_OSC_ORBIT);
System.out.format(Locale.US, EPOCH,
orbit.getDate());
System.out.format(Locale.US, " a = %14.6f m, ex = %17.10e, ey = %17.10e, i = %12.9f deg, Ω = %12.9f deg%n",
System.out.format(Locale.US, ORBITAL_ELEMENTS,
orbit.getA(), orbit.getCircularEx(), orbit.getCircularEy(),
FastMath.toDegrees(orbit.getI()),
FastMath.toDegrees(orbit.getRightAscensionOfAscendingNode()));
......@@ -236,23 +257,23 @@ public class Phasing {
deltaV = delta.getVelocity().getNorm();
System.out.format(Locale.US,
" iteration %2d: Δa = %12.6f m, Δex = %13.6e, Δey = %13.6e, Δi = %12.9f deg, ΔΩ = %12.9f deg, ΔP = %11.6f m, ΔV = %11.9f m/s%n",
++counter, da, dex, dey, di, dr, deltaP, deltaV);
ITERATION_REPORT,
++counter, da, dex, dey, di, dr, deltaP, deltaV);
}
// final orbit
System.out.format(Locale.US, "%nfinal osculating orbit%n");
System.out.format(Locale.US, " date = %s%n",
System.out.format(Locale.US, FINAL_OSC_ORBIT);
System.out.format(Locale.US, EPOCH,
orbit.getDate());
System.out.format(Locale.US, " a = %14.6f m, ex = %17.10e, ey = %17.10e, i = %12.9f deg, Ω = %12.9f deg%n",
System.out.format(Locale.US, ORBITAL_ELEMENTS,
orbit.getA(), orbit.getCircularEx(), orbit.getCircularEy(),
FastMath.toDegrees(orbit.getI()),
FastMath.toDegrees(orbit.getRightAscensionOfAscendingNode()));
System.out.format(Locale.US, "%nfinal frozen eccentricity%n");
MeanEccentricityFitter eccentricityFitter = new MeanEccentricityFitter(orbit, maxMDaily, nbDays, nbOrbits);
System.out.format(Locale.US, FROZEN_ECC_TITLE);
final MeanEccentricityFitter eccentricityFitter = new MeanEccentricityFitter(orbit, maxMDaily, nbDays, nbOrbits);
eccentricityFitter.fit(propagator);
System.out.format(Locale.US, " ex_f = %17.10e, ey_f = %17.10e%n",
System.out.format(Locale.US, FROZEN_ECC,
eccentricityFitter.cx, eccentricityFitter.cy);
// generate the ground track grid file
......@@ -313,9 +334,9 @@ public class Phasing {
* @param maxMDaily maximum index of m-daily terms
* @param nbDays number of days of the phasing cycle
* @param nbOrbits number of orbits of the phasing cycle
*/
public MeanEccentricityFitter(final CircularOrbit initial, final int maxMDaily,
final int nbDays, final int nbOrbits) {
*/
MeanEccentricityFitter(final CircularOrbit initial, final int maxMDaily,
final int nbDays, final int nbOrbits) {
this.initial = initial;
this.tEnd = initial.getDate().shiftedBy(nbDays * Constants.JULIAN_DAY);
this.maxMDaily = maxMDaily;
......@@ -332,8 +353,7 @@ public class Phasing {
// sample orbit for one phasing cycle
propagator.setMasterMode(60,
(state, isLast) ->
observed.add((CircularOrbit) OrbitType.CIRCULAR.convertType(state.getOrbit())));
(state, isLast) -> observed.add((CircularOrbit) OrbitType.CIRCULAR.convertType(state.getOrbit())));
propagator.propagate(start, tEnd);
// compute mean semi-major axis and mean inclination
......@@ -368,8 +388,7 @@ public class Phasing {
start(new double[4 + 4 * maxMDaily]).
target(new double[2 * observed.size()]).
model(params -> residuals(params),
params -> jacobian(params)).
build();
params -> jacobian(params)).build();
final LeastSquaresOptimizer.Optimum optimum = new LevenbergMarquardtOptimizer().optimize(lsp);
// store coefficients (for mean model only)
......@@ -418,7 +437,7 @@ public class Phasing {
* @return model Jacobian
*/
private double[][] jacobian(final double[] params) {
final double[][] jac = new double[2 * observed.size()][];
final double[][] jac = new double[2 * observed.size()][];
int i = 0;
for (final CircularOrbit c : observed) {
final double dt = c.getDate().durationFrom(initial.getDate());
......@@ -643,7 +662,7 @@ public class Phasing {
* @param maxMDaily maximum index of m-daily terms
* @param nbDays number of days of the phasing cycle
* @param nbOrbits number of orbits of the phasing cycle
* @return orit with improved frozen eccentricity
* @return orbit with improved frozen eccentricity
*/
private CircularOrbit improveFrozenEccentricity(final CircularOrbit previous, final Propagator propagator,
final int maxMDaily, final int nbDays, final int nbOrbits) {
......@@ -975,7 +994,7 @@ public class Phasing {
/**
* Set the maximum order of m-daily terms for eccentricity fitting.
* @param maximum order of m-daily terms for eccentricity fitting
* @param maxMDaily maximum order of m-daily terms for eccentricity fitting
*/
public void setMaxMDaily(final int maxMDaily) {
this.maxMDaily = maxMDaily;
......
......@@ -114,8 +114,7 @@ public class ImpulseAtNode {
// we allow only maneuvers on the first 3 orbits
final AbsoluteDate lastAllowedDate =
initialOrbit.getDate().shiftedBy(3 * initialOrbit.getKeplerianPeriod());
final EnablingPredicate<EventDetector> predicate =
(state, detector, g) -> state.getDate().isBefore(lastAllowedDate);
final EnablingPredicate<EventDetector> predicate = (state, detector, g) -> state.getDate().isBefore(lastAllowedDate);
final EventDetector trigger =
new EventEnablingPredicateFilter<>(ascendingNodeStopper, predicate);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment