[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orekit Users] Assistance in converting TLE to LLA on Geo Objects



Hello all, I’m hoping that you can help me!

I’m trying to calculate the Lat/Long/Altitude (LLA) of GEO objects if I’m only
given a TLE.  I can’t guarantee that the system I’m using this for will have
access to the internet, and I’ll need to do this dynamically.

I’ve gone over the documentation and other sites to figure out how to use
OREKit to do all the heavy lifting for me (great tool btw!  I’m liking it).
What I’ve come up with is the following, although it appears to be 2-3 degrees
off  of what appears to be truth data (I’m using GOES satellites for testing
which are well known and have plenty of documentation of where these
satellites are located).  Can you please let me know what I’m doing wrong?
Unfortunately, I'm a novice in astrodynamics and I don't fully understand what
I'm trying to do.

With my current results, I’m off 3 degrees wth GOES 12, 2.6 on GOES 13, and
2.7 with GOES 14.  I’m sure that I’ve either mis-configured something, or have
just gotten really lucky in being that close in these calculations.

Thank you in advance for your assistance!

--Ryan

public void calculateLLA() throws OrekitException {
		// configure Orekit
		Autoconfiguration.configureOrekit();

		// GOES -13 (GEO) TLE from SpaceTrack on 7/29/2013
		String card1 = "1 29155U 06018A   13210.23162706 -.00000268
00000-0  10000-3 0  6652";
		String card2 = "2 29155 000.0933 259.9903 0003625 191.6068
224.2324 01.00270872 26322";

		System.out.println("Is the TLE format ok? : "
				+ TLE.isFormatOK(card1, card2));
		TLE tle = new TLE(card1, card2);

		TLEPropagator tleProp = TLEPropagator.selectExtrapolator(tle);

		// Initial date in UTC time scale
		TimeScale utc = TimeScalesFactory.getUTC();
		AbsoluteDate initialDate = new AbsoluteDate(2013, 07, 29, 23,
30,
				00.000, utc);

		AbsoluteDate extrapDate = initialDate;
		SpacecraftState newState = tleProp.propagate(extrapDate);

		CartesianOrbit currentOrbit = (CartesianOrbit)
newState.getOrbit();
		extrapDate = new AbsoluteDate(extrapDate, 600, utc);
		PVCoordinates pv = currentOrbit.getPVCoordinates();

		Transform trans = FramesFactory.getEME2000().getTransformTo(
				FramesFactory.getITRF2005(), extrapDate);
		Vector3D posITRS = trans.transformPosition(pv.getPosition());
		System.out.println("X: " + posITRS.getX() + " Y: " +
posITRS.getY()
				+ " Z:" + posITRS.getZ());

		// Quick check on the calculation for longitude:
		//
http://www.mathworks.com/help/aeroblks/ecefpositiontolla.html
		// longitude = atan ( py / px);
		double longitude = FastMath.atan2(posITRS.getY(),
posITRS.getX());
		System.out.println("Longititude: " +
FastMath.toDegrees(longitude));

		OneAxisEllipsoid oae = new OneAxisEllipsoid(
				Constants.WGS84_EARTH_EQUATORIAL_RADIUS,
				Constants.WGS84_EARTH_FLATTENING,
FramesFactory.getEME2000());

		GeodeticPoint gp = oae.transform(posITRS,
FramesFactory.getEME2000(),
				new AbsoluteDate());

		System.out.println("Altitude: " + gp.getAltitude() + "  Long="
				+ FastMath.toDegrees(gp.getLongitude()) + "
Lat= "
				+ FastMath.toDegrees(gp.getLatitude()));

		System.out
				.println("Does the manual calculated
longitutde meet the OREKit longitude? "
						+
(FastMath.toDegrees(longitude) == FastMath

.toDegrees(gp.getLongitude())));
	}