Search code examples
pythoncoordinate-transformationastronomypyephemsatellite

Python coordinate transformation ECI to ECEF


I am using sgp4 python package (developed by Brandon Rhodes); I am inputting the TLE information for ISS(Zarya). I get the position of the satellite at a certain date, in the in ECI coordinate system. However, I want to convert it to ECEF coordinate system.

There are at least two instances of matlab functions implemented (ecitoecef, eci2ecef) and a C function (eci2ecef) implemented for the RTKLIB project.( I can't post links because I have a restriction of two links per question since this is my first question and I have reputation 1)

I was not able to find a python function implemented. However, in this previous question, Python satellite tracking with spg4, pyephem- positions not matching the user says "I found atleast part of the issue. spg84.propagate() returns the location in ECI, not ECEF. Quick run through eci2ecef and it lines up perfectly with the predict response."

Is that eci2ecef referring to a python implementation? Is this available online? Is there a document online that explains exactly the step needed to be done if I were to implemented by myself? In this question How do I convert ECI coordinates to longitude latitude and altitude to display on a Map? in a comment they say "They differ by the Earth's rotation rate so the transformation is just a 2-D cos sin; -sin cos type transform. ". What is the angle of the transform? Is it the Greenwhich Sideral Time? When we use sgp4, is it also the GST that we specify, or other time?

Thank you so much for your help!


Solution

  • First I studied the paper AIAA 2006-6753 which is online at CelesTrak, and which formed the basis for making the sgp4 library available in Python in the first place:

    https://celestrak.org/publications/AIAA/2006-6753/

    Based on its recommendations — and in particular on the information in its Appendix — I am attempting to integrate Earth satellites into my new Skyfield astronomy library. A new release with this work should be out soon, but in the meantime you can study the transformations that I am using (based on the above paper) at:

    https://github.com/brandon-rhodes/python-skyfield/blob/master/skyfield/sgp4lib.py

    I am not sure that I have the transforms correct, but will be checking the results against as many official sources of positions as I can find to determine whether I have made any systematic error.