Class MinorBodyPropagator
java.lang.Object
talonsoalbi_at_gmail_dot_com.ssoxmatch.actions.MinorBodyPropagator
To propagate the orbits of the minor objects to certain final epoch.
- Author:
- talonso
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringReturns the path to a given binary filegetFilenamesInLocalFolder(String directoryName) Returns the list of files in the provided local folderstatic intReturns the number of perturbing asteroids used in a given preintegrated file, provided that the file is complete, including the calculations for cometsstatic OrbitalElementgetOrbitalElementsFromPositionAndVelocity(double[] pos, double[] v, double jd, double mass, String name, boolean checkTolerance) Obtain a set of orbital elements knowing the position and velocity vectors in certain instant, according to the classical theory of the two body motion.static OrbitalElementgetOrbitalElementsFromPositionAndVelocity(double[] pos, double[] v, double jd, double mass, String name, double checkTolerance) Obtain a set of orbital elements knowing the position and velocity vectors in certain instant, according to the classical theory of the two body motion.static voidMain program.static voidpreIntegrate(ArrayList<OrbitalElement> aster, ArrayList<OrbitalElement> comet, Double forceStartJD) Preintegration programstatic voidpreIntegrate(ArrayList<OrbitalElement> aster, ArrayList<OrbitalElement> comet, Double forceStartJD, Double forceEndJD) Preintegration programstatic ArrayList<OrbitalElement> readElements(File f, boolean jpl, boolean checkList) Reads the data contained in a given file and returns the list of orbital elements from the position and velocity vector on it, for all minor bodiesstatic ArrayList<OrbitalElement> readElements(File f, boolean jpl, boolean checkList, int limitAster, int limitComet) Reads the data contained in a given file and returns the list of orbital elements from the position and velocity vector on it, for all minor bodiesstatic voidreset()Reset all the private static variables in this class
-
Method Details
-
main
public static void main(String[] args) throws InterruptedException, IOException, spice.basic.SpiceErrorException Main program.- Parameters:
args- Not used.- Throws:
InterruptedException- Threading errorsIOException- File system errorsspice.basic.SpiceErrorException- Ephemeris/kernel errors
-
reset
public static void reset()Reset all the private static variables in this class -
preIntegrate
public static void preIntegrate(ArrayList<OrbitalElement> aster, ArrayList<OrbitalElement> comet, Double forceStartJD) throws InterruptedException, IOException, spice.basic.SpiceErrorException Preintegration program- Parameters:
aster- Asteroids list, or nullcomet- Comets list, or nullforceStartJD- Julian day to be used for the first reference date of the preintegrated files, or null to take it from the elements- Throws:
InterruptedException- Threading errorsIOException- File system errorsspice.basic.SpiceErrorException- Ephemeris/kernel errors
-
preIntegrate
public static void preIntegrate(ArrayList<OrbitalElement> aster, ArrayList<OrbitalElement> comet, Double forceStartJD, Double forceEndJD) throws InterruptedException, IOException, spice.basic.SpiceErrorException Preintegration program- Parameters:
aster- Asteroids list, or nullcomet- Comets list, or nullforceStartJD- Julian day to be used for the first reference date of the preintegrated files, or null to take it from the elementsforceEndJD- Julian day for the oldest observation, or null to get it from the properties- Throws:
InterruptedException- Threading errorsIOException- File system errorsspice.basic.SpiceErrorException- Ephemeris/kernel errors
-
getFilenamesInLocalFolder
public static ArrayList<String> getFilenamesInLocalFolder(String directoryName) throws spice.basic.SpiceErrorException, IOException Returns the list of files in the provided local folder- Parameters:
directoryName- Name of folder in the local system- Returns:
- List of files
- Throws:
spice.basic.SpiceErrorException- Whatever problem reading the missionsIOException- Whatever problem reading the properties file (when not read before)
-
getFile
public static String getFile(String folder, double jd) throws spice.basic.SpiceErrorException, IOException Returns the path to a given binary file- Parameters:
folder- Folder where the files are located, respect the local folderjd- Julian day for the file name, or <= 0 for the index file- Returns:
- Path to the preintegration file for the date and folder provided
- Throws:
spice.basic.SpiceErrorException- Whatever problem reading the missionsIOException- Whatever problem reading the properties file (when not read before)
-
getNumberOfPerturbersUsed
Returns the number of perturbing asteroids used in a given preintegrated file, provided that the file is complete, including the calculations for comets- Parameters:
f- The file- Returns:
- The number of perturbing asteroids
- Throws:
IOException- If the file does not exists, is not complete, or an IO error happened
-
readElements
public static ArrayList<OrbitalElement> readElements(File f, boolean jpl, boolean checkList) throws spice.basic.SpiceErrorException, IOException Reads the data contained in a given file and returns the list of orbital elements from the position and velocity vector on it, for all minor bodies- Parameters:
f- File to readjpl- If the file belongs to JPL elements, or Lowell onescheckList- True to check the objects in the output list, comparing with NBodyIntegrator.getOrbitalElements()- Returns:
- List of orbital elements
- Throws:
spice.basic.SpiceErrorException- Ephemeris errorsIOException- Whatever problem reading the elements file
-
readElements
public static ArrayList<OrbitalElement> readElements(File f, boolean jpl, boolean checkList, int limitAster, int limitComet) throws spice.basic.SpiceErrorException, IOException Reads the data contained in a given file and returns the list of orbital elements from the position and velocity vector on it, for all minor bodies- Parameters:
f- File to readjpl- If the file belongs to JPL elements, or Lowell onescheckList- True to check the objects in the output list, comparing with NBodyIntegrator.getOrbitalElements()limitAster- Maximum number of asteroids to read, or -1 to read them alllimitComet- Maximum number of comets to read, or -1 to read them all- Returns:
- List of orbital elements
- Throws:
spice.basic.SpiceErrorException- Ephemeris errorsIOException- Whatever problem reading the elements file
-
getOrbitalElementsFromPositionAndVelocity
public static OrbitalElement getOrbitalElementsFromPositionAndVelocity(double[] pos, double[] v, double jd, double mass, String name, boolean checkTolerance) throws IllegalArgumentException, IOException, spice.basic.SpiceErrorException Obtain a set of orbital elements knowing the position and velocity vectors in certain instant, according to the classical theory of the two body motion.
For reference see Practical Ephemeris Calculations, by Oliver Montenbruck, chapter 3- Parameters:
pos- Geometric heliocentric position vector in ecliptic coordinates, in AU. Velocities can be included here in case v is set to nullv- Heliocentric velocity vector in ecliptic coordinates, in AU / day. Velocities can be included in pos when v is nulljd- Time of vectors as Julian daymass- Mass of the orbiting body in Msun. Can be set to zero if it is very low or unknownname- Body namecheckTolerance- True will check the output and set converge flag to false in case the elements will not recover accurately the input vector, using as tolerance 1E-10 AU- Returns:
- A set of orbital elements describing the shape and orientation of the orbit, and ready for subsequent ephemeris calculations (all data except magnitude, mag slope, name, and applicable times). Mean equinox and ecliptic of the input vector (assumed J2000)
- Throws:
IllegalArgumentException- If the orbit is a straight line through the sunIOException- File system errorsspice.basic.SpiceErrorException- Ephemeris/kernel errors
-
getOrbitalElementsFromPositionAndVelocity
public static OrbitalElement getOrbitalElementsFromPositionAndVelocity(double[] pos, double[] v, double jd, double mass, String name, double checkTolerance) throws IllegalArgumentException, IOException, spice.basic.SpiceErrorException Obtain a set of orbital elements knowing the position and velocity vectors in certain instant, according to the classical theory of the two body motion.
For reference see Practical Ephemeris Calculations, by Oliver Montenbruck, chapter 3.- Parameters:
pos- Geometric heliocentric position vector in ecliptic coordinates, in AU. Velocities can be included here in case v is set to null.v- Heliocentric velocity vector in ecliptic coordinates, in AU / day. Velocities can be included in pos when v is nulljd- Time of vectors as Julian day.mass- Mass of the orbiting body in Msun. Can be set to zero if it is very low or unknown.name- Body namecheckTolerance- Tolerance value to consider the elements computed as wrong. Set to <=0 to skip this check.- Returns:
- A set of orbital elements describing the shape and orientation of the orbit, and ready for subsequent ephemeris calculations (all data except magnitude, mag slope, name, and applicable times). Mean equinox and ecliptic of the input vector (assumed J2000).
- Throws:
IllegalArgumentException- If the orbit is a straight line through the sun.spice.basic.SpiceErrorException- If the JPL constant GMS cannot be readIOException- File system errors
-