# [Spice_discussion] question on coordinates of date

Bryan Butler bbutler at nrao.edu
Tue Jan 27 20:01:20 PST 2009

```hello all,

first off - i would have searched the listserv archives for an answer to
this, but it gives me an error every time i try to access them.  so,
i'll just see if anybody is still reading these and can help :).

i'm trying to calculate coordinates of date, and running into some problems.

as an example, consider the geocentric position of the moon.  i'll
calculate it in J2000.0 and also on 2009Jan30 at 0hUTC:

CALL FURNSH ('naif0009.tls')
CALL FURNSH ('de421.bsp')
CALL FURNSH ('tod.tk')

...

YEAR = 2009
MONTH = 1
DAY = 30
HOUR = 0
MINUTE = 0
SECOND = 0
WRITE (UTCSTR,1) YEAR, MONTH, DAY, HOUR, MINUTE, SECOND
CALL STR2ET (UTCSTR, ET)

... as a check get the J2000 coordinates

CALL SPKEZR ("MOON", ET, "J2000", "LT", "EARTH", STATE, LT)
CALL RECRAD (STATE, RANGEMOON, RAMOON, DECMOON)

... then try the true, of date coordinates

CALL SPKEZR ("MOON", ET, "ECI_TOD", "LT", "EARTH", STATE, LT)
CALL RECRAD (STATE, RANGEMOON, RAMOON, DECMOON)

the result is:

J2000:   23:23:44.8371 -00:00:36.156
of-date: 23:24:13.6409 +00:02:28.349

the first comparison i did was with the SOFA routines, calling
iau_PNM80() on the STATE returned from the J2000.0 call.  this results
in exactly the same 'of date' coordinates as above, so i'm pretty sure
i've got the frame file (tod.tk) defined properly.

then i thought i'd compare this with the positions in horizons
(http://ssd.jpl.nasa.gov/horizons.cgi), which gives:

J2000:   23:23:44.8370 -00:00:36.157
of-date: 23:24:12.6659 +00:02:23.032

which is slightly different in J2000.0 (a few milliseconds of arc in
right ascension and one millisecond of arc in declination), but quite
different in of date (15 seconds of arc in RA, 5 seconds in dec).  this
is also true of other dates i try - the errors are small in J2000.0, but
quite large in of date coordinates.

so why is it that horizons gives such a different answer than SPICE for
of date coordinates?

-bryan butler