List<ValidObservation> fitObs = fitter.getFit();
assertEquals(polyfit_degree2.length, fitObs.size());
for (int i = 0; i < fitObs.size(); i++) {
ValidObservation ob = fitObs.get(i);
assertEquals(String.format("%1.4f", polyfit_degree2[i][0]),
String.format("%1.4f", ob.getJD()));
assertEquals(String.format("%1.4f", polyfit_degree2[i][1]),
String.format("%1.4f", ob.getMag()));
}
List<ValidObservation> residualObs = fitter.getResiduals();
assertEquals(polyfit_residuals_degree2.length, residualObs.size());
for (int i = 0; i < residualObs.size(); i++) {
ValidObservation ob = residualObs.get(i);
assertEquals(String.format("%1.4f",
polyfit_residuals_degree2[i][0]), String.format(
"%1.4f", ob.getJD()));
assertEquals(String.format("%1.4f",
polyfit_residuals_degree2[i][1]), String.format(
"%1.4f", ob.getMag()));
}
} catch (AlgorithmError e) {
fail();
}
}