Search in sources :

Example 31 with ChronologicalComparator

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

the class EOPC04FilesLoaderTest 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 EOPC04FilesLoader(FramesFactory.EOPC04_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 32 with ChronologicalComparator

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

the class EOPC04FilesLoaderTest method testContent.

@Test
public void testContent() throws OrekitException {
    setRoot("regular-data");
    IERSConventions.NutationCorrectionConverter converter = IERSConventions.IERS_2010.getNutationCorrectionConverter();
    SortedSet<EOPEntry> data = new TreeSet<EOPEntry>(new ChronologicalComparator());
    new EOPC04FilesLoader(FramesFactory.EOPC04_2000_FILENAME).fillHistory(converter, data);
    EOPHistory history = new EOPHistory(IERSConventions.IERS_2010, data, true);
    AbsoluteDate date = new AbsoluteDate(2003, 1, 7, 12, 0, 0, TimeScalesFactory.getUTC());
    Assert.assertEquals((9 * (0.0007777 + 0.0008565) - (0.0005883 + 0.0008758)) / 16, history.getLOD(date), 1.0e-10);
    Assert.assertEquals((9 * (-0.2920264 + -0.2928461) - (-0.2913281 + -0.2937305)) / 16, history.getUT1MinusUTC(date), 1.0e-10);
    Assert.assertEquals(asToRad((9 * (-0.105933 + -0.108553) - (-0.103513 + -0.111054)) / 16), history.getPoleCorrection(date).getXp(), 1.0e-10);
    Assert.assertEquals(asToRad((9 * (0.201451 + 0.203596) - (0.199545 + 0.205660)) / 16), history.getPoleCorrection(date).getYp(), 1.0e-10);
    Assert.assertEquals(ITRFVersion.ITRF_2008, history.getITRFVersion(date));
}
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 33 with ChronologicalComparator

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

the class EOPC04FilesLoaderTest 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 EOPC04FilesLoader(FramesFactory.EOPC04_2000_FILENAME).fillHistory(converter, history);
    Assert.assertEquals(new AbsoluteDate(2003, 1, 1, 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 34 with ChronologicalComparator

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

the class FramesFactoryTest method testEOPConversionSymetry1980.

@Test
public void testEOPConversionSymetry1980() throws OrekitException {
    Utils.setDataRoot("rapid-data-columns");
    IERSConventions.NutationCorrectionConverter converter = IERSConventions.IERS_1996.getNutationCorrectionConverter();
    SortedSet<EOPEntry> rawEquinox = new TreeSet<EOPEntry>(new ChronologicalComparator());
    new RapidDataAndPredictionColumnsLoader(false, "^finals\\.daily$").fillHistory(converter, rawEquinox);
    Assert.assertEquals(181, rawEquinox.size());
    for (final EOPEntry entry : rawEquinox) {
        final double[] rebuiltEquinox = converter.toEquinox(entry.getDate(), entry.getDx(), entry.getDy());
        Assert.assertEquals(entry.getDdPsi(), rebuiltEquinox[0], 2.0e-22);
        Assert.assertEquals(entry.getDdEps(), rebuiltEquinox[1], 2.0e-23);
    }
}
Also used : NutationCorrectionConverter(org.orekit.utils.IERSConventions.NutationCorrectionConverter) TreeSet(java.util.TreeSet) IERSConventions(org.orekit.utils.IERSConventions) ChronologicalComparator(org.orekit.time.ChronologicalComparator) Test(org.junit.Test)

Example 35 with ChronologicalComparator

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

the class FramesFactory method getEOPHistory.

/**
 * Get Earth Orientation Parameters history.
 * <p>
 * If no {@link EOPHistoryLoader} has been added by calling {@link
 * #addEOPHistoryLoader(IERSConventions, EOPHistoryLoader) addEOPHistoryLoader}
 * or if {@link #clearEOPHistoryLoaders() clearEOPHistoryLoaders} has been
 * called afterwards, the {@link #addDefaultEOP1980HistoryLoaders(String, String,
 * String, String, String)} and {@link #addDefaultEOP2000HistoryLoaders(String,
 * String, String, String, String)} methods will be called automatically with
 * supported file names parameters all set to null, in order to get the default
 * loaders configuration.
 * </p>
 * @param conventions conventions for which EOP history is requested
 * @param simpleEOP if true, tidal effects are ignored when interpolating EOP
 * @return Earth Orientation Parameters history
 * @exception OrekitException if the data cannot be loaded
 */
public static EOPHistory getEOPHistory(final IERSConventions conventions, final boolean simpleEOP) throws OrekitException {
    synchronized (EOP_HISTORY_LOADERS) {
        if (EOP_HISTORY_LOADERS.isEmpty()) {
            // set up using default loaders
            addDefaultEOP2000HistoryLoaders(null, null, null, null, null);
            addDefaultEOP1980HistoryLoaders(null, null, null, null, null);
        }
        // TimeStamped based set needed to remove duplicates
        OrekitException pendingException = null;
        final SortedSet<EOPEntry> data = new TreeSet<EOPEntry>(new ChronologicalComparator());
        // try to load canonical data if available
        if (EOP_HISTORY_LOADERS.containsKey(conventions)) {
            for (final EOPHistoryLoader loader : EOP_HISTORY_LOADERS.get(conventions)) {
                try {
                    loader.fillHistory(conventions.getNutationCorrectionConverter(), data);
                } catch (OrekitException oe) {
                    pendingException = oe;
                }
            }
        }
        if (data.isEmpty() && pendingException != null) {
            throw pendingException;
        }
        final EOPHistory history = new EOPHistory(conventions, data, simpleEOP);
        history.checkEOPContinuity(EOP_CONTINUITY_THRESHOLD);
        return history;
    }
}
Also used : TreeSet(java.util.TreeSet) OrekitException(org.orekit.errors.OrekitException) ChronologicalComparator(org.orekit.time.ChronologicalComparator)

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