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