Position of the Sun and Moon in ECEF coordinates

Hi!
I was just wondering if anyone knows where I can find a software/algorithm that can give me the postion of the sun and the moon in ECEF coordinates?

If not, do you have any clues to how I might start building one? I am an engeneering student, so I don't have a lot of knowlegde about astrophysics, but I am very willing to learn!

Related Astronomy and Astrophysics News on Phys.org
phyzguy
The JPL Horizons web site will give coordinates for any solar system body in a variety of different coordinates systems. One of them is Cartesian coordinates centered on any point you choose, which I think is the same as ECEF.

D H
Staff Emeritus
The JPL Horizons web site will give coordinates for any solar system body in a variety of different coordinates systems. One of them is Cartesian coordinates centered on any point you choose, which I think is the same as ECEF.
ECEF means "Earth Centered, Earth Fixed". Horizons does not provide that system. It does provide the ability to represent data in a frame based on a point on the surface of the Earth, so that's close (the coordinates of a point on the surface of the Earth in ECEF is nearly constant, and the variations are very small).

This may or may not work, depending on the OP's needs. To the OP: How many data points are needed, does the system need to be dynamic, to what accuracy do you want the data?

If you need a dynamic system with high accuracy you have a lot of work cut out for you. You'll need
• An ephemeris model such as the Development Ephemeris from JPL. This comprises software and data. You can download both from the Horizons site. The software provided isn't very good (typical academic quality software written in an ancient version of Fortran) but you can rewrite it.
• An Earth rotation model, which you can get from SOFA (and this is of good quality).
• A model of time. The JPL ephemeris uses JPL's Teph, which is a MIT/JPL relativistic time scale. To within a couple of milliseconds, Teph is Terrestrial Time (TT), which in turn is a fixed offset from International Atomic Time (TAI). The SOFA model needs time in TT, UT1, and GMST. There are shortcuts if you don't mind loss of precision.
The ephemeris model will let you calculate the position of the Sun, Earth, and Moon in ITRF coordinates. Ignoring relativistic effects, this is the information you need to calculate the Earth Centered Inertial coordinates (ICRF axes, which are about the same as J2000) of the Sun and Moon. The Earth rotation model gives the transform from ECI to ECEF.