use of org.orekit.time.ChronologicalComparator in project Orekit by CS-SI.
the class BulletinAFilesLoaderTest method testFinalValuesContent.
@Test
public void testFinalValuesContent() throws OrekitException {
setRoot("bulletinA");
SortedSet<EOPEntry> data = new TreeSet<EOPEntry>(new ChronologicalComparator());
new BulletinAFilesLoader(FramesFactory.BULLETINA_FILENAME).fillHistory(null, data);
EOPHistory history = new EOPHistory(IERSConventions.IERS_2010, data, true);
AbsoluteDate date = new AbsoluteDate(2013, 8, 26, 12, 0, 0, TimeScalesFactory.getUTC());
// the following values are from bulletina-xxvi-040.txt, final values section, lines 79-82
Assert.assertEquals((-3 * 0.04058 + 27 * 0.04000 + 27 * 0.03953 - 3 * 0.03917) / 48, history.getUT1MinusUTC(date), 1.0e-10);
Assert.assertEquals(asToRad((-3 * 0.1692 + 27 * 0.1689 + 27 * 0.1685 - 3 * 0.1684) / 48), history.getPoleCorrection(date).getXp(), 1.0e-10);
Assert.assertEquals(asToRad((-3 * 0.3336 + 27 * 0.3322 + 27 * 0.3307 - 3 * 0.3294) / 48), history.getPoleCorrection(date).getYp(), 1.0e-10);
}
use of org.orekit.time.ChronologicalComparator in project Orekit by CS-SI.
the class BulletinAFilesLoaderTest method checkInconsistent.
private void checkInconsistent(String name) {
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(OrekitMessages.INCONSISTENT_DATES_IN_IERS_FILE, oe.getSpecifier());
Assert.assertTrue(((String) oe.getParts()[0]).endsWith(name));
}
}
use of org.orekit.time.ChronologicalComparator in project Orekit by CS-SI.
the class BulletinAFilesLoaderTest method testSingleFile.
@Test
public void testSingleFile() throws OrekitException {
setRoot("bulletinA");
SortedSet<EOPEntry> data = new TreeSet<EOPEntry>(new ChronologicalComparator());
new BulletinAFilesLoader("bulletina-xxvi-039.txt").fillHistory(null, data);
EOPHistory history = new EOPHistory(IERSConventions.IERS_2010, data, true);
// earliest date is for pole position, provided days 56546, 56547, 56548
Assert.assertEquals(new AbsoluteDate(new DateComponents(DateComponents.MODIFIED_JULIAN_EPOCH, 56546), TimeScalesFactory.getUTC()), history.getStartDate());
// with this single file, there is a hole between last pole (56548) and first rapid data (56555)
Assert.assertEquals(56555 - 56548, getMaxGap(data));
// latest date is for EOP prediction, corresponding to 56926
Assert.assertEquals(new AbsoluteDate(new DateComponents(DateComponents.MODIFIED_JULIAN_EPOCH, 56926), TimeScalesFactory.getUTC()), history.getEndDate());
}
use of org.orekit.time.ChronologicalComparator in project Orekit by CS-SI.
the class BulletinBFilesLoaderTest method testEndDate.
@Test
public void testEndDate() throws OrekitException {
setRoot("regular-data");
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);
Assert.assertEquals(new AbsoluteDate(2006, 3, 5, TimeScalesFactory.getUTC()), new EOPHistory(IERSConventions.IERS_2010, history, false).getEndDate());
}
use of org.orekit.time.ChronologicalComparator in project Orekit by CS-SI.
the class BulletinBFilesLoaderTest method testNewFormatRemovedFirstDates.
@Test
public void testNewFormatRemovedFirstDates() throws OrekitException {
setRoot("new-bulletinB");
IERSConventions.NutationCorrectionConverter converter = IERSConventions.IERS_2010.getNutationCorrectionConverter();
SortedSet<EOPEntry> data = new TreeSet<EOPEntry>(new ChronologicalComparator());
new BulletinBFilesLoader("^bulletinb-edited\\.270$").fillHistory(converter, data);
EOPHistory history = new EOPHistory(IERSConventions.IERS_2010, data, true);
Assert.assertEquals(new AbsoluteDate(2010, 6, 11, TimeScalesFactory.getUTC()), history.getStartDate());
}
Aggregations