[Spice_discussion] CSPICE gives wrong answers with ITRF93?

Barry Carter spice_discuss at barrycarter.info
Wed Dec 23 16:32:36 PST 2015

printf("POS: %f,%f,%f\n",v[0],v[1],v[2]);

If I do the above after loading the appropriate C SPICE kernels 
(de431_part-1.bsp, de431_part-2.bsp, pck00010.tpc, naif0011.tls, 
earth_latest_high_prec.bpc, earth_720101_070426.bpc, 
earth_070425_370426_predict.bpc, earth_000101_160314_151222.bpc), 
libraries, etc, I get the position of Venus at the epoch as:

POS: 123122306.573054,-104409821.175499,-53854250.556510

At the point 0N, 0E on Earth, the ITRF93 coordinates are:


and the positive x axis of ITRF93 points towards the zenith.

Subtracting, I get the ITRF93 coordinates of Venus (as viewed from 0N, 0E) as:


If I compute the angle between these coordinates and the x axis, I get 
43.6554 degrees.

Thus, Venus is 43.6554 degrees from the zenith at 0N, 0E at the epoch. In 
other words, Venus has an elevation of 46.3446 degrees.

Now, if I run HORIZONS with the attached parameters (see image), the 
result line for the epoch reads:

2000-Jan-01 12:00 *m  242.8428  46.1041

The difference between the answer I got (46.3446 degrees) and the answer 
HORIZONS got (46.1041 degrees) is small, but should be much smaller. Note 
that I am using an airless model (no refraction) in HORIZONS, so that 
shouldn't be the issue.

I've tried several variations (including using IAU_EARTH instead of 
ITRF93), but run into similar problems.

What am I doing wrong?

My longer-term goal is to use CSPICE to compute sun/moon rise/set times to 
at least the same precision as 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: horizons.png
Type: image/png
Size: 15707 bytes
URL: <http://naif.jpl.nasa.gov/pipermail/spice_discussion/attachments/20151223/d8b96537/attachment.png>

More information about the Spice_discussion mailing list