Package gaiasky.util.coord
Class TLEParser
java.lang.Object
gaiasky.util.coord.TLEParser
A utility to fetch and parse TLE (Two-Line Element) orbital data for a given spacecraft
from a remote URL and extract its orbital elements and epoch.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHolds parsed orbital elements for a spacecraft. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractOrbitalElements(List<String> lines, String name) Extracts the TLE orbital elements for a spacecraft with the given name.fetchTLEData(String urlString) Downloads TLE data from the given URL.getOrbitalElements(String url, String targetName) Fetches the TLE data from the given URL and extracts the orbital elements for the given target name.
-
Constructor Details
-
TLEParser
public TLEParser()
-
-
Method Details
-
getOrbitalElements
Fetches the TLE data from the given URL and extracts the orbital elements for the given target name.- Parameters:
url- The URL to fetch the data.targetName- The name of the target object.- Returns:
- The
TLEParser.OrbitalElementsinstance with the parsed data. - Throws:
Exception- If the fetching or parsing fails.
-
fetchTLEData
Downloads TLE data from the given URL.- Parameters:
urlString- The URL to fetch TLE data from.- Returns:
- A list of non-empty lines from the TLE file.
- Throws:
IOException- If a network or read error occurs.
-
extractOrbitalElements
Extracts the TLE orbital elements for a spacecraft with the given name.- Parameters:
lines- list of lines from a TLE filename- the exact name of the spacecraft to search for (case-insensitive)- Returns:
- OrbitalElements object if found, otherwise null
-