# C/Fortran library for ECI to ECEF conversion

Does anyone know of a good C or fortran library which constructs the rotation matrix to convert from ECI to ECEF components?

• – cms Jun 22 '19 at 0:52
• IAUSOFA (noted below) and CSPICE are the big/well-known libraries in this area – barrycarter Jun 24 '19 at 3:32

## SOFA

The IAU’s Standards of Fundamental Astronomy (SOFA) library has a ANSI C and FORTRAN version.

See the documentation on the C2T06A function for converting from ECI to ECEF.

note:
You must look up what are called Earth Orientation Parameters (EOP) if you wish to convert ECI coordinates to ECEF. You can find them here.

• So in IAU language, ECEF is the same as ITRS and ECI is GCRS ? – vibe Jun 22 '19 at 2:34
• In the IAU language, ECEF and ECI do not exist per se. But to the spirit of your question, yes, ITRS is the equivalent of ECEF, and GCRS is the equivalent of ECI. Note that the IAU frames move differently than the simplified models, so check with your customer what frames they need. – ChrisR Jun 22 '19 at 4:47
• Ok thanks. In the C2T06A function, it needs a $x_p,y_p$ in put defined as the coordinates in radians of the Celestial Intermediate Pole wrt ITRS, but I cannot find any routine which actually gives me these numbers. I have looked through IERS documention also with no success. The routine xy06.c computes "CIP $x,y$ coordinates" but doesn't say which coordinate system it is - is this the correct function to use? – vibe Jun 22 '19 at 5:02
• $x_p$ and $y_p$ are what are called Earth Orientation Parameters (EOP) and are derived from actual measurements. In other words, you will need to get them from a lookup table based on an epoch. In the United States, the NGA publishes EOP parameters. See earth-info.nga.mil/GandG/update/… – cms Jun 22 '19 at 12:10
• That NGA site only has data until 2016. I found another site, for example hpiers.obspm.fr/iers/eop/eopc04/eopc04.15, but its not clear to me if the $x,y$ in that data file is the same as $x_p,y_p$. The guide document in that same directory says they are "pole coordinates", but doesn't specifically mention the Celestial Intermediate Pole. Are they different things? – vibe Jun 22 '19 at 15:19