Search in sources :

Example 21 with ChronologicalComparator

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

Example 22 with ChronologicalComparator

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);
}
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 23 with ChronologicalComparator

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);
}
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 24 with ChronologicalComparator

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);
}
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 25 with ChronologicalComparator

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());
}
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