terrenus.orbit
Class CurrentElementSource
java.lang.Object
terrenus.orbit.AbstractOrbitalElementSource
terrenus.orbit.CurrentElementSource
- All Implemented Interfaces:
- OrbitalElementSource
public class CurrentElementSource
- extends AbstractOrbitalElementSource
The CurrentElementSource
class provides access to
two-line elements in a current-style format. The data contains
elements from various different satellites in the "current data"
format provided by the CelesTrak website:
SATELLITE NAME #1
ELEMENT LINE 1
ELEMENT LINE 2
SATELLITE NAME #2
ELEMENT LINE 1
ELEMENT LINE 2
...
Satellite names are ignored. Any line starting with the string
"1<space>" is considered to be the first line of a two-line
element set. Only the first two-line element set matching the
requested satellite is used by getElements(int, java.util.Date, double)
.
Method Summary |
java.lang.String[] |
getElements(int satid,
java.util.Date date,
double maxDays)
Gets the orbital elements for the specified satellite and date. |
static void |
main(java.lang.String[] argv)
Tests this class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CurrentElementSource
public CurrentElementSource(java.net.URL url)
- Creates a new network source.
- Parameters:
url
- the URL to use for element data.
getElements
public java.lang.String[] getElements(int satid,
java.util.Date date,
double maxDays)
- Description copied from interface:
OrbitalElementSource
- Gets the orbital elements for the specified satellite and date.
- Parameters:
satid
- the NORAD orbital element ID for the satellite.date
- the date for orbital element retrieval.maxDays
- the maximum allowed difference between date and orbital
element epoch in days.
- Returns:
- the orbital elements as two strings, or null if none could be
found within the specified tolerance.
main
public static void main(java.lang.String[] argv)
throws java.lang.Exception
- Tests this class.
- Throws:
java.lang.Exception