Search in sources :

Example 11 with ChronologicalComparator

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

the class RapidDataAndPredictionXMLLoaderTest method testExternalResourcesAreIgnoredIssue368.

@Test
public void testExternalResourcesAreIgnoredIssue368() throws OrekitException {
    // setup
    setRoot("external-resources");
    IERSConventions.NutationCorrectionConverter converter = IERSConventions.IERS_1996.getNutationCorrectionConverter();
    SortedSet<EOPEntry> history = new TreeSet<>(new ChronologicalComparator());
    RapidDataAndPredictionXMLLoader loader = new RapidDataAndPredictionXMLLoader("^finals2000A\\..*\\.xml$");
    // action
    try {
        loader.fillHistory(converter, history);
        // verify
        Assert.fail("Expected Exception");
    } catch (OrekitException e) {
        // Malformed URL exception indicates external resource was disabled
        // file not found exception indicates parser tried to load the resource
        Assert.assertThat(e.getCause(), CoreMatchers.instanceOf(MalformedURLException.class));
    }
    // problem if any EOP data is loaded
    Assert.assertEquals(0, history.size());
}
Also used : TreeSet(java.util.TreeSet) IERSConventions(org.orekit.utils.IERSConventions) OrekitException(org.orekit.errors.OrekitException) ChronologicalComparator(org.orekit.time.ChronologicalComparator) Test(org.junit.Test) AbstractFilesLoaderTest(org.orekit.data.AbstractFilesLoaderTest)

Example 12 with ChronologicalComparator

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

the class RapidDataAndPredictionXMLLoaderTest method testStartDateFinals1980.

@Test
public void testStartDateFinals1980() throws OrekitException {
    setRoot("compressed-data");
    IERSConventions.NutationCorrectionConverter converter = IERSConventions.IERS_1996.getNutationCorrectionConverter();
    SortedSet<EOPEntry> history = new TreeSet<EOPEntry>(new ChronologicalComparator());
    new RapidDataAndPredictionXMLLoader("^finals\\.1999\\.xml$").fillHistory(converter, history);
    Assert.assertEquals(new AbsoluteDate(1999, 1, 1, TimeScalesFactory.getUTC()), new EOPHistory(IERSConventions.IERS_1996, history, true).getStartDate());
}
Also used : TreeSet(java.util.TreeSet) IERSConventions(org.orekit.utils.IERSConventions) ChronologicalComparator(org.orekit.time.ChronologicalComparator) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test) AbstractFilesLoaderTest(org.orekit.data.AbstractFilesLoaderTest)

Example 13 with ChronologicalComparator

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

the class RapidDataAndPredictionColumnsLoaderTest method testMissingColumnsPadding2000.

@Test
public void testMissingColumnsPadding2000() throws OrekitException {
    setRoot("rapid-data-columns");
    IERSConventions.NutationCorrectionConverter converter = IERSConventions.IERS_2003.getNutationCorrectionConverter();
    SortedSet<EOPEntry> data = new TreeSet<EOPEntry>(new ChronologicalComparator());
    new RapidDataAndPredictionColumnsLoader(true, "^finals2000A\\.daily$").fillHistory(converter, data);
    EOPHistory history = new EOPHistory(IERSConventions.IERS_2003, data, true);
    // after 2011-06-01, the example daily file has no columns for Bulletin B data
    // we don't see anything since we ignore the columns from Bulletin B
    AbsoluteDate t1Inf = new AbsoluteDate(2011, 6, 1, TimeScalesFactory.getUTC());
    Assert.assertEquals(-0.015313, 3600 * FastMath.toDegrees(history.getPoleCorrection(t1Inf).getXp()), 1.0e-10);
    Assert.assertEquals(0.403214, 3600 * FastMath.toDegrees(history.getPoleCorrection(t1Inf).getYp()), 1.0e-10);
    Assert.assertEquals(-0.2778790, history.getUT1MinusUTC(t1Inf), 1.0e-10);
    Assert.assertEquals(0.5773, 1000 * history.getLOD(t1Inf), 1.0e-10);
    AbsoluteDate t1Sup = t1Inf.shiftedBy(Constants.JULIAN_DAY);
    Assert.assertEquals(-0.014222, 3600 * FastMath.toDegrees(history.getPoleCorrection(t1Sup).getXp()), 1.0e-10);
    Assert.assertEquals(0.404430, 3600 * FastMath.toDegrees(history.getPoleCorrection(t1Sup).getYp()), 1.0e-10);
    Assert.assertEquals(-0.2784173, history.getUT1MinusUTC(t1Sup), 1.0e-10);
    Assert.assertEquals(0.5055, 1000 * history.getLOD(t1Sup), 1.0e-10);
    // after 2011-07-06, the example daily file has no columns for LOD
    AbsoluteDate t2Inf = new AbsoluteDate(2011, 7, 6, TimeScalesFactory.getUTC());
    Assert.assertEquals(0.052605, 3600 * FastMath.toDegrees(history.getPoleCorrection(t2Inf).getXp()), 1.0e-10);
    Assert.assertEquals(0.440076, 3600 * FastMath.toDegrees(history.getPoleCorrection(t2Inf).getYp()), 1.0e-10);
    Assert.assertEquals(-0.2915826, history.getUT1MinusUTC(t2Inf), 1.0e-10);
    Assert.assertEquals(0.5020, 1000 * history.getLOD(t2Inf), 1.0e-10);
    AbsoluteDate t2Sup = t2Inf.shiftedBy(Constants.JULIAN_DAY);
    Assert.assertEquals(0.055115, 3600 * FastMath.toDegrees(history.getPoleCorrection(t2Sup).getXp()), 1.0e-10);
    Assert.assertEquals(0.440848, 3600 * FastMath.toDegrees(history.getPoleCorrection(t2Sup).getYp()), 1.0e-10);
    Assert.assertEquals(-0.2920866, history.getUT1MinusUTC(t2Sup), 1.0e-10);
    Assert.assertEquals(0.0, 1000 * history.getLOD(t2Sup), 1.0e-10);
}
Also used : TreeSet(java.util.TreeSet) IERSConventions(org.orekit.utils.IERSConventions) ChronologicalComparator(org.orekit.time.ChronologicalComparator) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test) AbstractFilesLoaderTest(org.orekit.data.AbstractFilesLoaderTest)

Example 14 with ChronologicalComparator

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

the class RapidDataAndPredictionColumnsLoaderTest method testMissingColumnsPadding1980.

@Test
public void testMissingColumnsPadding1980() throws OrekitException {
    setRoot("rapid-data-columns");
    IERSConventions.NutationCorrectionConverter converter = IERSConventions.IERS_1996.getNutationCorrectionConverter();
    SortedSet<EOPEntry> data = new TreeSet<EOPEntry>(new ChronologicalComparator());
    new RapidDataAndPredictionColumnsLoader(false, "^finals\\.daily$").fillHistory(converter, data);
    EOPHistory history = new EOPHistory(IERSConventions.IERS_1996, data, true);
    // after 2011-06-01, the example daily file has no columns for Bulletin B data
    // we don't see anything since we ignore the columns from Bulletin B
    AbsoluteDate t1Inf = new AbsoluteDate(2011, 6, 1, TimeScalesFactory.getUTC());
    Assert.assertEquals(-67.724, 3600000 * FastMath.toDegrees(history.getEquinoxNutationCorrection(t1Inf)[0]), 1.0e-10);
    Assert.assertEquals(-11.807, 3600000 * FastMath.toDegrees(history.getEquinoxNutationCorrection(t1Inf)[1]), 1.0e-10);
    Assert.assertEquals(-0.2778790, history.getUT1MinusUTC(t1Inf), 1.0e-10);
    Assert.assertEquals(0.5773, 1000 * history.getLOD(t1Inf), 1.0e-10);
    AbsoluteDate t1Sup = t1Inf.shiftedBy(Constants.JULIAN_DAY);
    Assert.assertEquals(-67.800, 3600000 * FastMath.toDegrees(history.getEquinoxNutationCorrection(t1Sup)[0]), 1.0e-10);
    Assert.assertEquals(-11.810, 3600000 * FastMath.toDegrees(history.getEquinoxNutationCorrection(t1Sup)[1]), 1.0e-10);
    Assert.assertEquals(-0.2784173, history.getUT1MinusUTC(t1Sup), 1.0e-10);
    Assert.assertEquals(0.5055, 1000 * history.getLOD(t1Sup), 1.0e-10);
    // after 2011-07-06, the example daily file has no columns for LOD
    AbsoluteDate t2Inf = new AbsoluteDate(2011, 7, 6, TimeScalesFactory.getUTC());
    Assert.assertEquals(-72.717, 3600000 * FastMath.toDegrees(history.getEquinoxNutationCorrection(t2Inf)[0]), 1.0e-10);
    Assert.assertEquals(-10.620, 3600000 * FastMath.toDegrees(history.getEquinoxNutationCorrection(t2Inf)[1]), 1.0e-10);
    Assert.assertEquals(-0.2915826, history.getUT1MinusUTC(t2Inf), 1.0e-10);
    Assert.assertEquals(0.5020, 1000 * history.getLOD(t2Inf), 1.0e-10);
    AbsoluteDate t2Sup = t2Inf.shiftedBy(Constants.JULIAN_DAY);
    Assert.assertEquals(-73.194, 3600000 * FastMath.toDegrees(history.getEquinoxNutationCorrection(t2Sup)[0]), 1.0e-10);
    Assert.assertEquals(-10.535, 3600000 * FastMath.toDegrees(history.getEquinoxNutationCorrection(t2Sup)[1]), 1.0e-10);
    Assert.assertEquals(-0.2920866, history.getUT1MinusUTC(t2Sup), 1.0e-10);
    Assert.assertEquals(0.0, 1000 * history.getLOD(t2Sup), 1.0e-10);
    // after 2011-09-19, the example daily file has no columns for nutation
    AbsoluteDate t3Inf = new AbsoluteDate(2011, 9, 19, TimeScalesFactory.getUTC());
    Assert.assertEquals(-79.889, 3600000 * FastMath.toDegrees(history.getEquinoxNutationCorrection(t3Inf)[0]), 1.0e-10);
    Assert.assertEquals(-11.125, 3600000 * FastMath.toDegrees(history.getEquinoxNutationCorrection(t3Inf)[1]), 1.0e-10);
    Assert.assertEquals(-0.3112849, history.getUT1MinusUTC(t3Inf), 1.0e-10);
    Assert.assertEquals(0.0, 1000 * history.getLOD(t3Inf), 1.0e-10);
    AbsoluteDate t3Sup = t3Inf.shiftedBy(Constants.JULIAN_DAY);
    Assert.assertEquals(0.0, 3600000 * FastMath.toDegrees(history.getEquinoxNutationCorrection(t3Sup)[0]), 1.0e-10);
    Assert.assertEquals(0.0, 3600000 * FastMath.toDegrees(history.getEquinoxNutationCorrection(t3Sup)[1]), 1.0e-10);
    Assert.assertEquals(-0.3115675, history.getUT1MinusUTC(t3Sup), 1.0e-10);
    Assert.assertEquals(0.0, 1000 * history.getLOD(t3Sup), 1.0e-10);
}
Also used : TreeSet(java.util.TreeSet) IERSConventions(org.orekit.utils.IERSConventions) ChronologicalComparator(org.orekit.time.ChronologicalComparator) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test) AbstractFilesLoaderTest(org.orekit.data.AbstractFilesLoaderTest)

Example 15 with ChronologicalComparator

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

the class RapidDataAndPredictionColumnsLoaderTest method testPost2070.

@Test
public void testPost2070() throws OrekitException {
    setRoot("rapid-data-columns");
    IERSConventions.NutationCorrectionConverter converter = IERSConventions.IERS_2010.getNutationCorrectionConverter();
    SortedSet<EOPEntry> history = new TreeSet<EOPEntry>(new ChronologicalComparator());
    new RapidDataAndPredictionColumnsLoader(true, "^finals2000A-post-2070\\.daily$").fillHistory(converter, history);
    Assert.assertEquals(new AbsoluteDate(2075, 4, 16, 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) Test(org.junit.Test) AbstractFilesLoaderTest(org.orekit.data.AbstractFilesLoaderTest)

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