QUOTE (MizarKey @ Feb 1 2005, 11:22 PM)
...or better yet, what formula do you use in your program for converting the seconds to Earth time and Sol time? -should have taken more math in school...(end edit)
What I need to know is how to convert it to know what Sol the picture was taken. Can you tell me the formula you used in your program?
Thanks!
Well Eric, I hadn't checked this board in a while, so this answer is some months late! Anyway, I converted the spacecraft clock to Earth time as follows:
mertime = MER clock from the file name (seconds since January 1, 2000, 11:58:55.816 UTC)
umertime = mertime + 946727273 (MER clock converted to Unix time (seconds since Jan. 1, 1970))
Then the C library function ctime(&umertime) can be used to get the conventional Earth time.
As for sols, I took sol1 for Spirit to be 126408373 on the spacecraft clock. then the sol number is given by:
sols = 1.0 + (mertime - 126408373)/88775.244 ;
Where 88775.244 is the number of seconds per sol.
Note that the formulas above are not strictly accurate because the MER clocks do not keep perfect time by any means even though those clocks form the basis for timestamping images, etc.
From the SCLK SPICE kernel for the MERs:
QUOTE
The on-board clock, the conversion for which is provided by this SCLK file, consists of two fields:
SSSSSSSSSS:FFF
where:
SSSSSSSSSS -- count of on-board seconds
FFF -- count of fractions of a second with one fraction
being 1/256 of a second
and nominally starts at the J2000 epoch (2000 JAN 01 12:00 ET).
The coefficients given in the SCLK kernels show that the MER clocks can lose or gain time in a random way. For example this is the latest SCLK kernel for MER-2:
ftp://naif.jpl.nasa.gov/pub/naif/MER/kern...KSCET.00016.tscThe third column of numbers are the clock drift coefficients where 1.0000 would be perfect time. The first column has the sclk boundaries (number of 1/256th second ticks) for the different drift rates, and the second column has what's known as the parallel time system that is a much more precise (in this case Ephemeris Time). So effectively there is a piecewise linear function that will map the sclk to Ephemeris Time. From the SCLK required reading document
ftp://naif.jpl.nasa.gov/pub/naif/toolkit_...l_docs/sclk.req :
QUOTE
We can represent the data that define the SCLK-to-ET mapping as a set
of ordered triples of encoded SCLK values (in units of ticks since
spacecraft clock start), their equivalents in ephemeris time, and the
rates corresponding to each pair of times:
( s/c_clock(1), et(1), rate(1) )
.
.
.
( s/c_clock(n), et(n), rate(n) )
The mapping of SCLK values to ephemeris times is carried out as
follows: If the sclk time clock satisfies
sclk(i) < clock < sclk(i+1)
-
then the corresponding ephemeris time is
et(i) = rate(i) * ( clock - sclk(i) )
If
clock > clock(n)
-
the formula still applies, with i = n.
Looking at the rate column for MER-2, it can be seen that sometimes the drift rate can be as much as 1.02 meaning the clock is 2% fast! However, in that particular case the duration was only about about 1000 seconds. No idea what causes the clock to vary like that.
Overall the MER-2 clock seems to be keep time less well as the mission goes on, losing a few minutes from Aug 2004 to Feb 2005. There hasn't been an SCLK file update (released on the NAIF website anyway) since April.
Joe