LoadingSunEphemeris : Différence entre versions
De Wiki
(Page créée avec « <syntaxhighlight lang="java"> public class LoadingSunEphemeris { public static void main(String[] args) throws PatriusException { // Patrius Dataset init... ») |
(Aucune différence)
|
Version actuelle en date du 13 février 2018 à 12:16
public class LoadingSunEphemeris { public static void main(String[] args) throws PatriusException { // Patrius Dataset initialization PatriusDataset.addResourcesFromPatriusDataset() ; //String[] fileNames = { "unxp2000.405", "unxp1950.405", "unxp2700.406" }; String[] fileNames = { "unxp.*.405" }; // data for Sun coordinates output final TimeScale tuc = TimeScalesFactory.getUTC(); final AbsoluteDate date = new AbsoluteDate("2010-01-01T12:00:00.000", tuc); final Frame icrf = FramesFactory.getICRF(); for (int i = 0; i < fileNames.length; i++) { final JPLEphemeridesLoader loader = new JPLEphemeridesLoader(fileNames[i], EphemerisType.SUN); CelestialBodyFactory.clearCelestialBodyLoaders(); CelestialBodyFactory.addCelestialBodyLoader(CelestialBodyFactory.SUN, loader); // Using the loading theory final CelestialBody sun = loader.loadCelestialBody(CelestialBodyFactory.SUN); // Coordinates of the Sun at a given date and reference frame PVCoordinates pv = sun.getPVCoordinates(date, icrf); System.out.println(""); System.out.println(pv.getPosition().getX()); System.out.println(pv.getPosition().getY()); System.out.println(pv.getPosition().getZ()); } } }