use of org.orekit.frames.EOPEntry in project Orekit by CS-SI.
the class Utils method buildEOPList.
public static List<EOPEntry> buildEOPList(IERSConventions conventions, ITRFVersion version, double[][] data) throws OrekitException {
IERSConventions.NutationCorrectionConverter converter = conventions.getNutationCorrectionConverter();
final List<EOPEntry> list = new ArrayList<EOPEntry>();
for (double[] row : data) {
final AbsoluteDate date = new AbsoluteDate(new DateComponents(DateComponents.MODIFIED_JULIAN_EPOCH, (int) row[0]), TimeScalesFactory.getUTC());
final double[] nro;
final double[] equinox;
if (Double.isNaN(row[7])) {
equinox = new double[] { Constants.ARC_SECONDS_TO_RADIANS * row[5], Constants.ARC_SECONDS_TO_RADIANS * row[6] };
nro = converter.toNonRotating(date, equinox[0], equinox[1]);
} else if (Double.isNaN(row[5])) {
nro = new double[] { Constants.ARC_SECONDS_TO_RADIANS * row[7], Constants.ARC_SECONDS_TO_RADIANS * row[8] };
equinox = converter.toEquinox(date, nro[0], nro[1]);
} else {
equinox = new double[] { Constants.ARC_SECONDS_TO_RADIANS * row[5], Constants.ARC_SECONDS_TO_RADIANS * row[6] };
nro = new double[] { Constants.ARC_SECONDS_TO_RADIANS * row[7], Constants.ARC_SECONDS_TO_RADIANS * row[8] };
}
list.add(new EOPEntry((int) row[0], row[1], row[2], Constants.ARC_SECONDS_TO_RADIANS * row[3], Constants.ARC_SECONDS_TO_RADIANS * row[4], equinox[0], equinox[1], nro[0], nro[1], version));
}
return list;
}
use of org.orekit.frames.EOPEntry in project Orekit by CS-SI.
the class Utils method setLoaders.
public static void setLoaders(final IERSConventions conventions, final List<EOPEntry> eop) {
clearFactoryMaps(FramesFactory.class);
clearFactoryMaps(TimeScalesFactory.class);
FramesFactory.addEOPHistoryLoader(conventions, new EOPHistoryLoader() {
public void fillHistory(IERSConventions.NutationCorrectionConverter converter, SortedSet<EOPEntry> history) {
history.addAll(eop);
}
});
}
Aggregations