Search in sources :

Example 41 with ChronologicalComparator

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);
}
Also used : TreeSet(java.util.TreeSet) ChronologicalComparator(org.orekit.time.ChronologicalComparator) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test) AbstractFilesLoaderTest(org.orekit.data.AbstractFilesLoaderTest)

Example 42 with ChronologicalComparator

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));
    }
}
Also used : TreeSet(java.util.TreeSet) OrekitException(org.orekit.errors.OrekitException) ChronologicalComparator(org.orekit.time.ChronologicalComparator)

Example 43 with ChronologicalComparator

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());
}
Also used : TreeSet(java.util.TreeSet) DateComponents(org.orekit.time.DateComponents) ChronologicalComparator(org.orekit.time.ChronologicalComparator) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test) AbstractFilesLoaderTest(org.orekit.data.AbstractFilesLoaderTest)

Example 44 with ChronologicalComparator

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());
}
Also used : TreeSet(java.util.TreeSet) IERSConventions(org.orekit.utils.IERSConventions) ChronologicalComparator(org.orekit.time.ChronologicalComparator) AbsoluteDate(org.orekit.time.AbsoluteDate) AbstractFilesLoaderTest(org.orekit.data.AbstractFilesLoaderTest) Test(org.junit.Test)

Example 45 with ChronologicalComparator

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());
}
Also used : TreeSet(java.util.TreeSet) IERSConventions(org.orekit.utils.IERSConventions) ChronologicalComparator(org.orekit.time.ChronologicalComparator) AbsoluteDate(org.orekit.time.AbsoluteDate) AbstractFilesLoaderTest(org.orekit.data.AbstractFilesLoaderTest) Test(org.junit.Test)

Aggregations

ChronologicalComparator (org.orekit.time.ChronologicalComparator)57 TreeSet (java.util.TreeSet)47 Test (org.junit.Test)44 AbstractFilesLoaderTest (org.orekit.data.AbstractFilesLoaderTest)41 AbsoluteDate (org.orekit.time.AbsoluteDate)41 IERSConventions (org.orekit.utils.IERSConventions)39 OrekitException (org.orekit.errors.OrekitException)11 ArrayList (java.util.ArrayList)10 Context (org.orekit.estimation.Context)9 Propagator (org.orekit.propagation.Propagator)9 NumericalPropagatorBuilder (org.orekit.propagation.conversion.NumericalPropagatorBuilder)9 Max (org.hipparchus.stat.descriptive.rank.Max)8 Median (org.hipparchus.stat.descriptive.rank.Median)8 SpacecraftState (org.orekit.propagation.SpacecraftState)8 OrekitStepInterpolator (org.orekit.propagation.sampling.OrekitStepInterpolator)8 Mean (org.hipparchus.stat.descriptive.moment.Mean)5 RangeTroposphericDelayModifier (org.orekit.estimation.measurements.modifiers.RangeTroposphericDelayModifier)4 Min (org.hipparchus.stat.descriptive.rank.Min)3 Orbit (org.orekit.orbits.Orbit)3 DateComponents (org.orekit.time.DateComponents)3