Search in sources :

Example 26 with ChronologicalComparator

use of org.orekit.time.ChronologicalComparator in project Orekit by CS-SI.

the class BulletinBFilesLoaderTest method testNewFormatInconsistentDate.

@Test
public void testNewFormatInconsistentDate() throws OrekitException {
    setRoot("new-bulletinB");
    IERSConventions.NutationCorrectionConverter converter = IERSConventions.IERS_2010.getNutationCorrectionConverter();
    SortedSet<EOPEntry> history = new TreeSet<EOPEntry>(new ChronologicalComparator());
    try {
        new BulletinBFilesLoader("bulletinb-inconsistent-date.270").fillHistory(converter, history);
        Assert.fail("an exception should have been thrown");
    } catch (OrekitException oe) {
        Assert.assertEquals(OrekitMessages.INCONSISTENT_DATES_IN_IERS_FILE, oe.getSpecifier());
    }
}
Also used : TreeSet(java.util.TreeSet) IERSConventions(org.orekit.utils.IERSConventions) OrekitException(org.orekit.errors.OrekitException) ChronologicalComparator(org.orekit.time.ChronologicalComparator) AbstractFilesLoaderTest(org.orekit.data.AbstractFilesLoaderTest) Test(org.junit.Test)

Example 27 with ChronologicalComparator

use of org.orekit.time.ChronologicalComparator in project Orekit by CS-SI.

the class BulletinBFilesLoaderTest method testStartDate.

@Test
public void testStartDate() 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.assertEquals(new AbsoluteDate(2005, 12, 5, TimeScalesFactory.getUTC()), new EOPHistory(IERSConventions.IERS_2010, history, true).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)

Example 28 with ChronologicalComparator

use of org.orekit.time.ChronologicalComparator in project Orekit by CS-SI.

the class BulletinBFilesLoaderTest method testNewFormatInconsistent.

@Test(expected = OrekitException.class)
public void testNewFormatInconsistent() throws OrekitException {
    setRoot("new-bulletinB");
    IERSConventions.NutationCorrectionConverter converter = IERSConventions.IERS_2010.getNutationCorrectionConverter();
    SortedSet<EOPEntry> history = new TreeSet<EOPEntry>(new ChronologicalComparator());
    new BulletinBFilesLoader("^bulletinb-inconsistent\\.270$").fillHistory(converter, history);
}
Also used : TreeSet(java.util.TreeSet) IERSConventions(org.orekit.utils.IERSConventions) ChronologicalComparator(org.orekit.time.ChronologicalComparator) AbstractFilesLoaderTest(org.orekit.data.AbstractFilesLoaderTest) Test(org.junit.Test)

Example 29 with ChronologicalComparator

use of org.orekit.time.ChronologicalComparator in project Orekit by CS-SI.

the class BulletinBFilesLoaderTest method testOldFormat1980.

@Test
public void testOldFormat1980() throws OrekitException {
    setRoot("old-bulletinB");
    IERSConventions.NutationCorrectionConverter converter = IERSConventions.IERS_1996.getNutationCorrectionConverter();
    SortedSet<EOPEntry> data = new TreeSet<EOPEntry>(new ChronologicalComparator());
    new BulletinBFilesLoader("^bulletinb_IAU1980-220\\.txt$").fillHistory(converter, data);
    EOPHistory history = new EOPHistory(IERSConventions.IERS_1996, data, true);
    Assert.assertEquals(new AbsoluteDate(2006, 4, 4, TimeScalesFactory.getUTC()), history.getStartDate());
    Assert.assertEquals(new AbsoluteDate(2006, 5, 4, TimeScalesFactory.getUTC()), history.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 30 with ChronologicalComparator

use of org.orekit.time.ChronologicalComparator in project Orekit by CS-SI.

the class EOPC04FilesLoaderTest 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 EOPC04FilesLoader(FramesFactory.EOPC04_2000_FILENAME).fillHistory(converter, history);
    Assert.assertEquals(new AbsoluteDate(2005, 12, 31, TimeScalesFactory.getUTC()), new EOPHistory(IERSConventions.IERS_2010, history, true).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)

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