public class ASTOrbits
extends java.lang.Object
This class provides the ability to load orbital elements from a data file and to store them in an accessible structure. This is done so that changing from one epoch to another only requires that the orbital elements be loaded from a different data file. The default data file is J2000.dat under the data files directory. An orbital elements data file **MUST** be in the format specifically designed for this book. The format can be gleaned by opening the J2000.dat data file and examining its contents. The format is straightforward and is documented in comments within the data file itself.
Copyright (c) 2018
Modifier and Type | Field and Description |
---|---|
static int |
EARTH_HELIOLAT
Earth's heliocentric latitude
|
static int |
EARTH_RADIUSVECT
Earth's radius vector length
|
static double |
EarthRadius
Define radius of the Earth.
|
static int |
MOON_CORRLON
Corrected lon of the asc.
|
static int |
MOON_ECLLAT
Lunar ecliptic latitude
|
static int |
MOON_ECLLON
Lunar ecliptic longitude
|
static int |
MOON_MEANANOM
Lunar mean anomaly
|
static int |
MOON_MEANANOM_CORR
Mean anomaly correction for the Moon
|
static int |
MOON_TRUEANOM
Lunar true anomaly
|
static int |
MOON_TRUELON
Lunar true ecliptic longitude
|
static double |
muEarth
Define the Earth's standard gravitational parameter.
|
static int |
OBJ_ECLLAT
object's ecliptic latitude
|
static int |
OBJ_ECLLON
object's ecliptic longitude
|
static int |
OBJ_HELIOLAT
object's heliocentric latitude
|
static int |
OBJ_RADIUSVECT
object's radius vector length
|
static int |
RISE_SET_FLAG
whether object rise/set (1.0 = yes, 0.0 = no)
|
static int |
RISE_TIME
LST for rising time
|
static int |
SET_TIME
LST for setting time
|
static int |
SUN_ECLLAT
Solar ecliptic latitude
|
static int |
SUN_ECLLON
Solar ecliptic longitude
|
static int |
SUN_MEANANOM
Solar mean anomaly
|
static int |
SUN_TRUEANOM
Solar true anomaly
|
Constructor and Description |
---|
ASTOrbits(ASTPrt prtInstance)
Initialize from the default orbital elements data file, if
it exists.
|
Modifier and Type | Method and Description |
---|---|
double |
calcEarthRVLength(int month,
int day,
int year,
double UT,
ASTKepler.TrueAnomalyType solvetrueAnomaly,
double termCriteria)
Calculate the Earth's radius vector length (i.e., distance to the Sun)
at the stated time and date.
|
double[] |
calcMoonEclipticCoord(int month,
int day,
int year,
double UT,
ASTKepler.TrueAnomalyType solvetrueAnomaly,
double termCriteria)
Calculate the Moon's ecliptic coordinates using the
currently loaded orbital elements.
|
static double |
calcObjDistToEarth(double Re,
double Le,
double Rp,
double Lp)
Calculate the distance (in AUs) from an object to the Earth.
|
double[] |
calcObjEclipticCoord(int month,
int day,
int year,
double UT,
int idx,
ASTKepler.TrueAnomalyType solvetrueAnomaly,
double termCriteria)
Calculate an object's ecliptic coordinates using the
currently loaded orbital elements.
|
static double[] |
calcRiseSetTimes(double RA,
double Decl,
double Lat)
Calculate the LST rising and setting times for a given
equatorial coordinate.
|
double[] |
calcSunEclipticCoord(int month,
int day,
int year,
double UT,
ASTKepler.TrueAnomalyType solvetrueAnomaly,
double termCriteria)
Calculate the Sun's ecliptic coordinates using the
currently loaded orbital elements.
|
void |
displayAllOrbitalElements()
Displays a list in the user's scrollable output
text area of all the orbital elements for all
of the objects in the database.
|
void |
displayObjOrbElements(int idx)
Display the orbital elements for an object.
|
int |
findOrbElementObjIndex(java.lang.String name)
Searches the orbital elements database and returns an index into the
database for the requested object.
|
int |
getNumOEDBObjs()
Get number of orbital elements in the database.
|
int |
getOEDBEarthIndex()
Gets the index for where the Earth is in the OE db.
|
static java.lang.String |
getOEDBFileToOpen()
Puts up a browser window and gets an orbital elements filename.
|
int |
getOEDBMoonIndex()
Gets the index for where the Moon is in the OE db.
|
int |
getOEDBSunIndex()
Gets the index for where the Sun is in the OE db.
|
double |
getOEEpochDate()
Get the epoch for the data in the OE database.
|
double |
getOEEpochJD()
Get the epoch for the data in the OE database
as a Julian date.
|
double |
getOEObjAngDiamArcSec(int idx)
Gets an object's angular diameter in arcseconds.
|
double |
getOEObjAngDiamDeg(int idx)
Gets an object's angular diameter in degrees.
|
double |
getOEObjDay(int idx)
Gets length of an object's day relative to Earth.
|
double |
getOEObjEccentricity(int idx)
Gets an object's orbital eccentricity.
|
double |
getOEObjGravParm(int idx)
Gets an object's gravitational parameter.
|
double |
getOEObjInclination(int idx)
Gets an object's orbital inclination.
|
boolean |
getOEObjInferior(int idx)
Gets whether an object is an inferior object.
|
double |
getOEObjLonAscNode(int idx)
Gets an object's longitude of the ascending node.
|
double |
getOEObjLonAtEpoch(int idx)
Gets an object's longitude at the epoch.
|
double |
getOEObjLonAtPeri(int idx)
Gets an objects longitude at perihelion.
|
double |
getOEObjMass(int idx)
Gets an object's mass.
|
double |
getOEObjmV(int idx)
Gets an object's visual magnitude.
|
java.lang.String |
getOEObjName(int idx)
Gets an object's name.
|
double |
getOEObjPeriod(int idx)
Gets an object's orbital period.
|
double |
getOEObjRadius(int idx)
Gets an object's radius.
|
double |
getOEObjSemiMajAxisAU(int idx)
Gets length of an object's semi-major axis in AUs.
|
double |
getOEObjSemiMajAxisKM(int idx)
Gets length of an object's semi-major axis in km.
|
static int |
getSatOrbitType(double e,
double inclin)
Determine an object's orbit type based on orbital
inclination and eccentricity.
|
void |
initOrbitalElements(ASTPrt prtInstance)
Does a one-time initialization by reading in the default
orbital elements data file.
|
boolean |
isOrbElementsDBLoaded()
Determine whether there is currently an orbital
elements database loaded.
|
boolean |
loadOEDB(java.lang.String filename)
Loads orbital elements database from disk.
|
public static final int SUN_ECLLAT
public static final int SUN_ECLLON
public static final int SUN_MEANANOM
public static final int SUN_TRUEANOM
public static final int MOON_ECLLAT
public static final int MOON_ECLLON
public static final int MOON_TRUELON
public static final int MOON_CORRLON
public static final int MOON_MEANANOM_CORR
public static final int MOON_MEANANOM
public static final int MOON_TRUEANOM
public static final int OBJ_ECLLAT
public static final int OBJ_ECLLON
public static final int OBJ_HELIOLAT
public static final int OBJ_RADIUSVECT
public static final int EARTH_HELIOLAT
public static final int EARTH_RADIUSVECT
public static final int RISE_SET_FLAG
public static final int RISE_TIME
public static final int SET_TIME
public static final double muEarth
public static final double EarthRadius
public ASTOrbits(ASTPrt prtInstance)
prtInstance
- instance of an output areapublic int getNumOEDBObjs()
public double getOEEpochDate()
public double getOEEpochJD()
public int getOEDBSunIndex()
public int getOEDBMoonIndex()
public int getOEDBEarthIndex()
public java.lang.String getOEObjName(int idx)
idx
- where object is in the OE dbpublic boolean getOEObjInferior(int idx)
idx
- where object is in the OE dbpublic double getOEObjPeriod(int idx)
idx
- where object is in the OE dbpublic double getOEObjMass(int idx)
idx
- where object is in the OE dbpublic double getOEObjRadius(int idx)
idx
- where object is in the OE dbpublic double getOEObjDay(int idx)
idx
- where object is in the OE dbpublic double getOEObjEccentricity(int idx)
idx
- where object is in the OE dbpublic double getOEObjSemiMajAxisAU(int idx)
idx
- where object is in the OE dbpublic double getOEObjSemiMajAxisKM(int idx)
idx
- where object is in the OE dbpublic double getOEObjAngDiamArcSec(int idx)
idx
- where object is in the OE dbpublic double getOEObjAngDiamDeg(int idx)
idx
- where object is in the OE dbpublic double getOEObjmV(int idx)
idx
- where object is in the OE dbpublic double getOEObjGravParm(int idx)
idx
- where object is in the OE dbpublic double getOEObjInclination(int idx)
idx
- where object is in the OE dbpublic double getOEObjLonAtEpoch(int idx)
idx
- where object is in the OE dbpublic double getOEObjLonAtPeri(int idx)
idx
- where object is in the OE dbpublic double getOEObjLonAscNode(int idx)
idx
- where object is in the OE dbpublic double calcEarthRVLength(int month, int day, int year, double UT, ASTKepler.TrueAnomalyType solvetrueAnomaly, double termCriteria)
month
- month at which Earth's distance is desiredday
- day at which Earth's distance is desiredyear
- year at which Earth's distance is desiredUT
- time (UT) at which distance is desiredsolvetrueAnomaly
- how to compute the true anomalytermCriteria
- termination criteria if Kepler's equation
is solvedpublic double[] calcMoonEclipticCoord(int month, int day, int year, double UT, ASTKepler.TrueAnomalyType solvetrueAnomaly, double termCriteria)
month
- month at which Moon's position is desiredday
- day at which Moon's position is desiredyear
- year at which Moon's position is desiredUT
- time (UT) at which position is desiredsolvetrueAnomaly
- how to compute the true anomalytermCriteria
- termination criteria if Kepler's equation
is solvedpublic static double calcObjDistToEarth(double Re, double Le, double Rp, double Lp)
Re
- Earth's radius vector in AUsLe
- Earth's heliocentric longitudeRp
- object's radius vector in AUsLp
- object's heliocentric longitudepublic double[] calcObjEclipticCoord(int month, int day, int year, double UT, int idx, ASTKepler.TrueAnomalyType solvetrueAnomaly, double termCriteria)
month
- month at which object's position is desiredday
- day at which object's position is desiredyear
- year at which object's position is desiredUT
- time (UT) at which position is desiredidx
- index into the orbital elements database
for the object whose position is desiredsolvetrueAnomaly
- how to compute the true anomaly for the Sun,
Earth, and objecttermCriteria
- termination criteria if Kepler's equation
is solvedpublic static double[] calcRiseSetTimes(double RA, double Decl, double Lat)
RA
- right ascensionDecl
- declinationLat
- observer's latitudepublic double[] calcSunEclipticCoord(int month, int day, int year, double UT, ASTKepler.TrueAnomalyType solvetrueAnomaly, double termCriteria)
month
- month at which Sun's position is desiredday
- day at which Sun's position is desiredyear
- year at which Sun's position is desiredUT
- time (UT) at which position is desiredsolvetrueAnomaly
- how to compute the true anomalytermCriteria
- termination criteria if Kepler's equation
is solvedpublic void displayAllOrbitalElements()
public void displayObjOrbElements(int idx)
idx
- index into OE db for the desired objectpublic int findOrbElementObjIndex(java.lang.String name)
name
- name of the object to findpublic static java.lang.String getOEDBFileToOpen()
public static int getSatOrbitType(double e, double inclin)
e
- orbital eccentricityinclin
- orbital inclination in degreespublic boolean isOrbElementsDBLoaded()
public boolean loadOEDB(java.lang.String filename)
filename
- Full filename (including path) to loadpublic void initOrbitalElements(ASTPrt prtInstance)
prtInstance
- instance of a scrollable output area