JEphem site
tig API
Build classes

jephem.tools
Class Ephemeris

java.lang.Object
  |
  +--jephem.tools.Ephemeris
All Implemented Interfaces:
GeneralConstants, SolarSystemConstants

public class Ephemeris
extends java.lang.Object
implements GeneralConstants, SolarSystemConstants

An Ephemeris is the representation of a coordinate at different instants.
It can be for one or several celestial bodies.

An Ephemeris is defined by :

  • the instants this Ephemeris represents, expressed in JD - accessible through getJDs()
  • the bodies for which coordinates are represented - accessible through getBodyIndexes()
  • the precision required for the calculations.


  • Internally, the coordinates of the bodies at different instants are stored in a double[][][], accessible via getData().
    This array is filled by the call of Ephemeris constructor ; Ephemeris uses AstroContext to fill it.

    As in the rest of the non-GUI part of the API, internal representation uses "standard units".


    Field Summary
    static int DISPLAY_DATES
              Constant meaning that dates should be displayed as formatted dates.
    static int DISPLAY_JDS
              Constant meaning that dates should be displayed as julian days.
    static int INSTANTS_IN_COLUMNS
              Constant meaning that the generated Ephemeris must have instants in columns and positions in rows.
    static int INSTANTS_IN_ROWS
              Constant meaning that the generated Ephemeris must have positions in columns and instants in rows.
     
    Fields inherited from interface tig.GeneralConstants
    BLANK, FS, LS, NO_SPECIF, SPACE
     
    Fields inherited from interface jephem.astro.solarsystem.SolarSystemConstants
    E0_1900, E0_1950, E0_2000, EARTH, JUPITER, KM_PER_AU, MARS, MERCURY, MOON, NB_BODIES, NEPTUNE, PLUTO, SATURN, SIDERAL_RATE, SUN, URANUS, VENUS
     
    Constructor Summary
    Ephemeris(int[] bodyIndexes, double[] JDs, int timeFrame, int[] whichCoords, int[] coordUnits, int frame, int sphereCart, double precision, java.lang.String astroEngine, boolean displayErrorMsg)
              Unique constructor, which orders the computations to be done.
     
    Method Summary
     int[] getBodyIndexes()
              Returns the indexes of the bodies handled by this Ephemeris.
     double[][][] getData()
              Returns the data of this Ephemeris.
     java.lang.String getHtmlString(int orientation, boolean useSymbols, int degreeFormat, int dateDisplay)
              Returns a HTML String representation of the Ephemeris.
     double[] getJDs()
              Returns the instants of this Ephemeris, expressed in julian days.
     java.lang.String toString()
              Returns a basic String representation of this Ephemeris (useful for debug).
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Field Detail

    DISPLAY_DATES

    public static final int DISPLAY_DATES
    Constant meaning that dates should be displayed as formatted dates.

    See Also:
    Constant Field Values

    DISPLAY_JDS

    public static final int DISPLAY_JDS
    Constant meaning that dates should be displayed as julian days.

    See Also:
    Constant Field Values

    INSTANTS_IN_COLUMNS

    public static final int INSTANTS_IN_COLUMNS
    Constant meaning that the generated Ephemeris must have instants in columns and positions in rows.

    See Also:
    Constant Field Values

    INSTANTS_IN_ROWS

    public static final int INSTANTS_IN_ROWS
    Constant meaning that the generated Ephemeris must have positions in columns and instants in rows.

    See Also:
    Constant Field Values
    Constructor Detail

    Ephemeris

    public Ephemeris(int[] bodyIndexes,
                     double[] JDs,
                     int timeFrame,
                     int[] whichCoords,
                     int[] coordUnits,
                     int frame,
                     int sphereCart,
                     double precision,
                     java.lang.String astroEngine,
                     boolean displayErrorMsg)
    Unique constructor, which orders the computations to be done.
    Warning : 'whichCoords' and 'coordUnits' parameters must be of the same length.

    Parameters:
    bodyIndexes - The indexes of the bodies for which ephemeris is represented, expressed with constants of SolarSystemConstants.
    JDs - The instants this Ephemeris represents, expressed in Julian Days.
    timeFrame - The time frame used to express 'jds'. use TimeConstants constants.
    frame - The reference frame in which the required coordinate must be expressed. use SpaceConstants constants.
    coordUnits - Specifies which units must be used to express the coordinate; use UnitsConstants.UNIT_XXX constants.
    sphereCart - Specifies if coordinate must be expressed in cartesian or spherical ; use SpaceConstants constants.
    precision - Precision required for the calculation, expressed in arcseconds.
    astroEngine - : the astro engine used for the computations. use AstroContext constants to specify it.
    displayErrorMsg - Indicates if the error messages should be memorized for further display.
    Method Detail

    getBodyIndexes

    public int[] getBodyIndexes()
    Returns the indexes of the bodies handled by this Ephemeris.


    getData

    public double[][][] getData()
    Returns the data of this Ephemeris.
    The use is :
    double[][][] x = myEphemeris.getData();
    double myValue = x[iJD][iBody][iCoord];
    .
    But Warning : 'iBody' corresponds here to the ith body of this ephemeris, and is not related with SolarSystem constants.


    getHtmlString

    public java.lang.String getHtmlString(int orientation,
                                          boolean useSymbols,
                                          int degreeFormat,
                                          int dateDisplay)
    Returns a HTML String representation of the Ephemeris.
    Build only a TABLE. Calling methods must incorporate the ephemeris in a HTML page

    Parameters:
    orientation - Specifies if the instants must be displayed in column or in rows ; use constants of this class.
    useSymbols - Indicates if planet names should be replaced by pictures containing symbols of the planets.
    degreeFormat - Indicates how degrees should be formatted ; use UnitsConstants.DEGREE_XXX constants.
    dateDisplay - indicates if dates should be displayed as formatted dates or julian days ; use DISPLAY_XXX constants of this class.

    getJDs

    public double[] getJDs()
    Returns the instants of this Ephemeris, expressed in julian days.


    toString

    public java.lang.String toString()
    Returns a basic String representation of this Ephemeris (useful for debug).

    Overrides:
    toString in class java.lang.Object

    JEphem site
    tig API
    Build classes