Class MinorBodyPropagator
- java.lang.Object
-
- talonsoalbi_at_gmail_dot_com.ssoxmatch.actions.MinorBodyPropagator
-
public class MinorBodyPropagator extends java.lang.Object
To propagate the orbits of the minor objects to certain final epoch.- Author:
- talonso
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getFile(java.lang.String folder, double jd)
Returns the path to a given binary filestatic java.util.ArrayList<java.lang.String>
getFilenamesInLocalFolder(java.lang.String directoryName)
Returns the list of files in the provided local folderstatic int
getNumberOfPerturbersUsed(java.io.File f)
Returns the number of perturbing asteroids used in a given preintegrated file, provided that the file is complete, including the calculations for cometsstatic OrbitalElement
getOrbitalElementsFromPositionAndVelocity(double[] pos, double[] v, double jd, double mass, java.lang.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 OrbitalElement
getOrbitalElementsFromPositionAndVelocity(double[] pos, double[] v, double jd, double mass, java.lang.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 void
main(java.lang.String[] args)
Main program.static void
preIntegrate(java.util.ArrayList<OrbitalElement> aster, java.util.ArrayList<OrbitalElement> comet, java.lang.Double forceStartJD)
Preintegration programstatic java.util.ArrayList<OrbitalElement>
readElements(java.io.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 java.util.ArrayList<OrbitalElement>
readElements(java.io.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 bodies
-
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.lang.InterruptedException, java.io.IOException, spice.basic.SpiceErrorException
Main program.- Parameters:
args
- Not used.- Throws:
java.lang.InterruptedException
- Threading errorsjava.io.IOException
- File system errorsspice.basic.SpiceErrorException
- Ephemeris/kernel errors
-
preIntegrate
public static void preIntegrate(java.util.ArrayList<OrbitalElement> aster, java.util.ArrayList<OrbitalElement> comet, java.lang.Double forceStartJD) throws java.lang.InterruptedException, java.io.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:
java.lang.InterruptedException
- Threading errorsjava.io.IOException
- File system errorsspice.basic.SpiceErrorException
- Ephemeris/kernel errors
-
getFilenamesInLocalFolder
public static java.util.ArrayList<java.lang.String> getFilenamesInLocalFolder(java.lang.String directoryName) throws spice.basic.SpiceErrorException, java.io.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 missionsjava.io.IOException
- Whatever problem reading the properties file (when not read before)
-
getFile
public static java.lang.String getFile(java.lang.String folder, double jd) throws spice.basic.SpiceErrorException, java.io.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 missionsjava.io.IOException
- Whatever problem reading the properties file (when not read before)
-
getNumberOfPerturbersUsed
public static int getNumberOfPerturbersUsed(java.io.File f) throws java.io.IOException
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:
java.io.IOException
- If the file does not exists, is not complete, or an IO error happened
-
readElements
public static java.util.ArrayList<OrbitalElement> readElements(java.io.File f, boolean jpl, boolean checkList) throws spice.basic.SpiceErrorException, java.io.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 errorsjava.io.IOException
- Whatever problem reading the elements file
-
readElements
public static java.util.ArrayList<OrbitalElement> readElements(java.io.File f, boolean jpl, boolean checkList, int limitAster, int limitComet) throws spice.basic.SpiceErrorException, java.io.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 errorsjava.io.IOException
- Whatever problem reading the elements file
-
getOrbitalElementsFromPositionAndVelocity
public static OrbitalElement getOrbitalElementsFromPositionAndVelocity(double[] pos, double[] v, double jd, double mass, java.lang.String name, boolean checkTolerance) throws java.lang.IllegalArgumentException, java.io.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:
java.lang.IllegalArgumentException
- If the orbit is a straight line through the sunjava.io.IOException
- File system errorsspice.basic.SpiceErrorException
- Ephemeris/kernel errors
-
getOrbitalElementsFromPositionAndVelocity
public static OrbitalElement getOrbitalElementsFromPositionAndVelocity(double[] pos, double[] v, double jd, double mass, java.lang.String name, double checkTolerance) throws java.lang.IllegalArgumentException, java.io.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:
java.lang.IllegalArgumentException
- If the orbit is a straight line through the sun.spice.basic.SpiceErrorException
- If the JPL constant GMS cannot be readjava.io.IOException
- File system errors
-
-