TLE file to azimuth and elevation

Hi all. I’m new to Orekit and TLE files. Could you point me to where I could find how to extract and calculate azimuth and elevation from a reference point on Earth to a satellite using TLE file?

Hi @mpavelic

Welcome to the Orekit forum!

First, you have to initialize a TLE object knowing your TLE data. Here an example:

final String line1 = "1 37753U 11036A   12090.13205652 -.00000006  00000-0  00000+0 0  2272";
final String line2 = "2 37753  55.0032 176.5796 0004733  13.2285 346.8266  2.00565440  5153";
final TLE tle = new TLE(line1, line2);

Then, you can initialize a TLEPropagator using the previous TLE.

 final TLEPropagator propagator = TLEPropagator.selectExtrapolator(

Knowing the coordinates of the station, you can create a GeodeticPoint and then a TopocentricFrame to access azimuth and elevation of the satellite. After creating the topocentric frame, you can use the methods getElevation() and getAzimuth().

 final GeodeticPoint point = new GeodeticPoint(latitudeInRadians, longitudeInRadians, altitudeInMeters);
final OneAxisEllispoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS,
                                                                          Constants.WGS84_EARTH_FLATTENING,
                                                                          FramesFactory.getITRF(IERSConventions.IERS_2010, true)))
 final TopocentricFrame topo = new TopocentricFrame(earth, point, "topo");

 // Satellite state at a desired epoch
 SpacecraftState state = propagator.propagate(desiredEpoch);
 // Compute azimuth and elevation
 final double azimuth = topo.getAzimuth(state.getPosition(), state.getFrame, state.getDate);
 final double elevation = topo.getElevation(state.getPosition(), state.getFrame, state.getDate);

You can find some other details in that post:

Best regards,
Bryan

Hi @bcazabonne. Thank you very much for fast response. One question. As far as I can see there is not method which getPosition() in SpacecraftState which is used for determinig azimuth and elevation.

Oh sorry ! I have just written this code snippet in the forum editor. To access the position you have to use state.getPVCoordinates().getPosition() instead of state.getPosition().

Bryan