Search in sources :

Example 1 with EOPEntry

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;
}
Also used : IERSConventions(org.orekit.utils.IERSConventions) ArrayList(java.util.ArrayList) DateComponents(org.orekit.time.DateComponents) EOPEntry(org.orekit.frames.EOPEntry) AbsoluteDate(org.orekit.time.AbsoluteDate)

Example 2 with EOPEntry

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);
        }
    });
}
Also used : IERSConventions(org.orekit.utils.IERSConventions) EOPEntry(org.orekit.frames.EOPEntry) EOPHistoryLoader(org.orekit.frames.EOPHistoryLoader)

Aggregations

EOPEntry (org.orekit.frames.EOPEntry)2 IERSConventions (org.orekit.utils.IERSConventions)2 ArrayList (java.util.ArrayList)1 EOPHistoryLoader (org.orekit.frames.EOPHistoryLoader)1 AbsoluteDate (org.orekit.time.AbsoluteDate)1 DateComponents (org.orekit.time.DateComponents)1