use of org.orekit.time.ChronologicalComparator in project Orekit by CS-SI.
the class BulletinAFilesLoaderTest method checkTruncated.
private void checkTruncated(String name, OrekitMessages expected) {
SortedSet<EOPEntry> history = new TreeSet<EOPEntry>(new ChronologicalComparator());
try {
new BulletinAFilesLoader(name).fillHistory(null, history);
Assert.fail("an exception should have been thrown");
} catch (OrekitException oe) {
Assert.assertEquals(expected, oe.getSpecifier());
Assert.assertTrue(((String) oe.getParts()[0]).endsWith(name));
}
}
use of org.orekit.time.ChronologicalComparator in project Orekit by CS-SI.
the class BulletinBFilesLoaderTest method testNewFormatContent.
@Test
public void testNewFormatContent() throws OrekitException {
setRoot("new-bulletinB");
IERSConventions.NutationCorrectionConverter converter = IERSConventions.IERS_2010.getNutationCorrectionConverter();
SortedSet<EOPEntry> data = new TreeSet<EOPEntry>(new ChronologicalComparator());
new BulletinBFilesLoader("^bulletinb\\.270$").fillHistory(converter, data);
EOPHistory history = new EOPHistory(IERSConventions.IERS_2010, data, true);
AbsoluteDate date = new AbsoluteDate(2010, 6, 12, 12, 0, 0, TimeScalesFactory.getUTC());
Assert.assertEquals(msToS((-3 * 0.1202 + 27 * 0.0294 + 27 * 0.0682 - 3 * 0.1531) / 48), history.getLOD(date), 1.0e-10);
Assert.assertEquals(msToS((-3 * -57.1711 + 27 * -57.2523 + 27 * -57.3103 - 3 * -57.4101) / 48), history.getUT1MinusUTC(date), 1.0e-10);
Assert.assertEquals(masToRad((-3 * -1.216 + 27 * 1.658 + 27 * 4.926 - 3 * 7.789) / 48), history.getPoleCorrection(date).getXp(), 1.0e-10);
Assert.assertEquals(masToRad((-3 * 467.780 + 27 * 469.330 + 27 * 470.931 - 3 * 472.388) / 48), history.getPoleCorrection(date).getYp(), 1.0e-10);
Assert.assertEquals(masToRad((-3 * 0.097 + 27 * 0.089 + 27 * 0.050 - 3 * -0.007) / 48), history.getNonRotatinOriginNutationCorrection(date)[0], 1.0e-10);
Assert.assertEquals(masToRad((-3 * 0.071 + 27 * 0.066 + 27 * 0.090 - 3 * 0.111) / 48), history.getNonRotatinOriginNutationCorrection(date)[1], 1.0e-10);
}
use of org.orekit.time.ChronologicalComparator in project Orekit by CS-SI.
the class BulletinBFilesLoaderTest method testOldFormatContent.
@Test
public void testOldFormatContent() throws OrekitException {
setRoot("regular-data");
IERSConventions.NutationCorrectionConverter converter = IERSConventions.IERS_2010.getNutationCorrectionConverter();
SortedSet<EOPEntry> data = new TreeSet<EOPEntry>(new ChronologicalComparator());
new BulletinBFilesLoader(FramesFactory.BULLETINB_2000_FILENAME).fillHistory(converter, data);
EOPHistory history = new EOPHistory(IERSConventions.IERS_2010, data, true);
AbsoluteDate date = new AbsoluteDate(2006, 1, 11, 12, 0, 0, TimeScalesFactory.getUTC());
Assert.assertEquals(msToS((-3 * 0.073 + 27 * -0.130 + 27 * -0.244 - 3 * -0.264) / 48), history.getLOD(date), 1.0e-10);
Assert.assertEquals((-3 * 0.333275 + 27 * 0.333310 + 27 * 0.333506 - 3 * 0.333768) / 48, history.getUT1MinusUTC(date), 1.0e-10);
Assert.assertEquals(asToRad((-3 * 0.04958 + 27 * 0.04927 + 27 * 0.04876 - 3 * 0.04854) / 48), history.getPoleCorrection(date).getXp(), 1.0e-10);
Assert.assertEquals(asToRad((-3 * 0.38117 + 27 * 0.38105 + 27 * 0.38071 - 3 * 0.38036) / 48), history.getPoleCorrection(date).getYp(), 1.0e-10);
}
use of org.orekit.time.ChronologicalComparator in project Orekit by CS-SI.
the class BulletinBFilesLoaderTest method testMissingMonths.
@Test
public void testMissingMonths() throws OrekitException {
setRoot("missing-months");
IERSConventions.NutationCorrectionConverter converter = IERSConventions.IERS_2010.getNutationCorrectionConverter();
SortedSet<EOPEntry> history = new TreeSet<EOPEntry>(new ChronologicalComparator());
new BulletinBFilesLoader(FramesFactory.BULLETINB_2000_FILENAME).fillHistory(converter, history);
Assert.assertTrue(getMaxGap(history) > 5);
}
use of org.orekit.time.ChronologicalComparator in project Orekit by CS-SI.
the class BulletinBFilesLoaderTest method testNewFormatNominal.
@Test
public void testNewFormatNominal() throws OrekitException {
setRoot("new-bulletinB");
IERSConventions.NutationCorrectionConverter converter = IERSConventions.IERS_2010.getNutationCorrectionConverter();
SortedSet<EOPEntry> data = new TreeSet<EOPEntry>(new ChronologicalComparator());
new BulletinBFilesLoader("^bulletinb\\.270$").fillHistory(converter, data);
EOPHistory history = new EOPHistory(IERSConventions.IERS_2010, data, true);
Assert.assertEquals(new AbsoluteDate(2010, 6, 2, TimeScalesFactory.getUTC()), history.getStartDate());
Assert.assertEquals(new AbsoluteDate(2010, 7, 1, TimeScalesFactory.getUTC()), history.getEndDate());
}
Aggregations