Class MinorBodyPropagator

java.lang.Object
talonsoalbi_at_gmail_dot_com.ssoxmatch.actions.MinorBodyPropagator

public class MinorBodyPropagator extends Object
To propagate the orbits of the minor objects to certain final epoch.
Author:
talonso
  • Method Details

    • main

      public static void main(String[] args) throws InterruptedException, IOException, spice.basic.SpiceErrorException
      Main program.
      Parameters:
      args - Not used.
      Throws:
      InterruptedException - Threading errors
      IOException - File system errors
      spice.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 null
      comet - Comets list, or null
      forceStartJD - 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 errors
      IOException - File system errors
      spice.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 null
      comet - Comets list, or null
      forceStartJD - Julian day to be used for the first reference date of the preintegrated files, or null to take it from the elements
      forceEndJD - Julian day for the oldest observation, or null to get it from the properties
      Throws:
      InterruptedException - Threading errors
      IOException - File system errors
      spice.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 missions
      IOException - 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 folder
      jd - 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 missions
      IOException - Whatever problem reading the properties file (when not read before)
    • getNumberOfPerturbersUsed

      public static int getNumberOfPerturbersUsed(File f) throws 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:
      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 read
      jpl - If the file belongs to JPL elements, or Lowell ones
      checkList - True to check the objects in the output list, comparing with NBodyIntegrator.getOrbitalElements()
      Returns:
      List of orbital elements
      Throws:
      spice.basic.SpiceErrorException - Ephemeris errors
      IOException - 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 read
      jpl - If the file belongs to JPL elements, or Lowell ones
      checkList - 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 all
      limitComet - Maximum number of comets to read, or -1 to read them all
      Returns:
      List of orbital elements
      Throws:
      spice.basic.SpiceErrorException - Ephemeris errors
      IOException - 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 null
      v - Heliocentric velocity vector in ecliptic coordinates, in AU / day. Velocities can be included in pos when v is null
      jd - 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 name
      checkTolerance - 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 sun
      IOException - File system errors
      spice.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 null
      jd - 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 name
      checkTolerance - 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 read
      IOException - File system errors