Viking Orbiter Time Tag Analysis and Restoration =========================================================================== By Boris Semenov and Chuck Acton, NAIF/JPL, July 22, 1996; updated December 3, 2008. Time Tag Analysis and Correction Algorithm -------------------------------------------------------- The SPICE EK/DBK files ``vo1_trec.bdb'' and ``vo2_trec.bdb'' provided in this data set contain the results of VO image time tags accuracy and reliability analysis, including an attempt to correct some of these tags. The following work was done during this process: 1. Time tags were extracted from the Supplemental Experiment Data Record (SEDR) files generated by the Viking Project during the mission. They were stored in UTC day-of-year format with three digits after the decimal point in the seconds field. These tags were filtered to exclude duplicate and ``bad'' tags. Here ``bad'' means that some tags were corrupted and couldn't be interpreted correctly as UTC times. 2. Assuming that the SEDR time tags correspond to middle of exposure time, these times were modified to correspond to the beginning of the Frame Start Count (FSC) tick. The FSC tick was a time interval during which the sequence of actions need to take every single picture was executed. The nominal duration of one FSC tick was 4.48 seconds. The picture was usually taken closer to the end of the interval (for long exposure pictures it was at the middle of the interval). Since only one picture could be taken during one FSC tick, each VO image was tagged with the corresponding FSC count. The actual time of the picture can be calculated from the tick start time and exposure duration using the following algorithm described in ``Applied Optics'' magazine, Vol. 16, No. 12, December 1977: ET_MID_EXP = ET_FSC + OFFSET_1 + OFFSET_2 + EXPOSURE / 2 where: ET_MID_EXP - Ephemeris Time (ET) of the middle of exp., ET_FSC - ET of the start of the corresp. FSC tick, OFFSET_1 - time offset depending on exposure duration OFFSET_2 - constant small time offset EXPOSURE - exposure duration The time offset constants in the equation above are: OFFSET_1 = 7/8 * NOMINAL_TICK if EXPOSURE <= 0.42 sec. OFFSET_1 = 3/8 * NOMINAL_TICK if EXPOSURE > 0.42 sec. OFFSET_2 = 1/64 * NOMINAL_TICK where: NOMINAL_TICK - nominal duration of FSC tick = 4.48 sec. The figures below illustrate this algorithm for short and long exposure images: SHORT EXPOSURE IMAGES (<= 0.42 SECONDS): --------------------------------------- ET_FSC ET_MID_EXP | | | | ---*-----'-----'-----'-----'-----'-----'-----'--*--|-- | EXPOSURE | | | | | ------------>| |<--- | OFFSET_2 | | | | ------------->| |<---- | OFFSET_1 | | |<--------------------------------------->| | | NOMINAL_TICK | |<--------------------------------------------->| LONG EXPOSURE IMAGES (> 0.42 SECONDS): -------------------------------------- ET_FSC ET_MID_EXP | | | | ---*-----'-----'-----'-----'----*'-----'-----'-----|-- | | | EXPOSURE | | | | |<--------------->| | | OFFSET_2 | | | | ------------->| |<---- | | OFFSET_1 | | |<--------------->| | | NOMINAL_TICK | |<--------------------------------------------->| Using this algorithm, the calculation of ET_FSC, the time of the start of the corresponding FSC tick, from ET_MID_EXP, the middle of exposure time stored in SEDR file, can be easily performed. The values of the exposure durations were also taken from SEDR files. 3. For each FSC count the ``nominal'' ET time for its start, i.e. the ET time that would correspond to a tick start if the FSC counter would run at a constant nominal frequency throughout the mission, was calculated in the following way: ET_FSC_NOMINAL = ET_INITIAL + (FSC - FSC_INITIAL) * NOMINAL_TICK where: FSC - FSC of each SEDR record, for which the ``nominal'' ET is calculated, FSC_INITIAL - FSC of the initial point (earliest image in SEDR), ET_INITIAL - ET of the initial point, ET_FSC_NOMINAL - ``nominal'' calculated ET for each FSC, The starting FSC point (FSC_INITIAL) was set to the FSC for the first (earliest) image available in the SEDR file. 4. The difference between ``real'' and ``nominal'' ET for each FSC was calculated in the following way: DIFFERENCE = ET_FSC - ET_FSC_NOMINAL 5. This difference was plotted for the mission duration. The Figure 1 (file ``vo1fsc.jpg'') and Figure 2 (file ``vo1fsc_a.jpg'') show this difference for mission duration and on an arbitrary chosen sub-interval. These plots illuminate several interesting things: a) the DIFFERENCE was constantly growing through the mission which means that ``real'' FSC clock was running slower (thus its tick is longer) that ``nominal'' FSC clock (see Fig.1). This can be explained by the fact the real oscillator speed cannot absolutely equal to ``nominal'' and may have constant offset from it. Also the relativity makes clock ``flying'' at high speed run slower that clock on the ground; b) The real clock speed was not constant during the mission. In general three intervals can be seen: first half of the primary mission (tick duration ~4.4800018 seconds), second half of the primary mission (tick duration ~4.4800009 seconds) and the extended mission (tick duration ~4.4800011 seconds). These intervals are schematically shown on Fig.1. The speed during the first interval seems be smaller than for the second and third intervals. Maybe this was caused by switching between prime and backup spacecraft clocks? c) during some time intervals for some orbits the difference is a ``noisy'' kind of function instead of straight line (Fig.2). That means that time tags on these orbits have relatively big offsets from the average difference value for that orbit. The reason for these is a mystery. d) time tags on some orbits deviate from straight line function by a few tenths and sometimes even a few seconds. On Fig.2 these points shown in circles marked with ``1''. This performance is also a mystery. e) it's seen that the straight line fit, even on the ``good'' intervals, is not continuous. After some period of continuity it ``jumps'' up or down by a few tenths of a second and goes continuously until the next jump. On Fig.2 this behavior is shown in circle areas marked with ``2'' This kind of behavior usually happens when a clock has ``resets'' during the mission, but confirmation of such resets on VO1 wasn't found in the project data sets that were processed in this work. To illustrate the behavior of ``real'' tags, plots were made for a few arbitrarily chosen orbits at different times during the mission. Examples of these plots are given on the Figures 3 (file ``vo1_0550.jpg'') and 4 (file ``vo1_1165.jpg''). These plots show that: a) for some orbits (mostly at the beginning and the middle of the primary mission and during the extended mission) differences for time tags of images are within 1 millisecond of the average difference for the orbit (see Fig.4). This 1 millisecond ``error'' could be introduced by truncation of the UTC time to milliseconds. This ``constant'' difference for an orbit makes good physical sense -- the mapping sessions were very short in duration, about 100-200 FSC ticks (less than 1000 seconds). Taking onto account that difference between the speeds of the ``real'' and ``nominal'' FSC clocks was a maximum of 0.000002 sec/tick we see that maximum drift of ``real'' clock relative to ``nominal'' clock during one orbit will be less than 0.5 millisecond which cannot be seen with one millisecond UTC tag accuracy. b) a different situation exist for other orbits, mostly at the very beginning and at the end of primary mission. For these orbits the ``real''-''nominal'' ET difference range can be hundredths or even tenths of a second (see Fig.3). The points on the plots are not distributed randomly but rather located on two or more different levels which suggests that only one of these ``levels'' is correct and all points which are not on this level have time tag errors. Unfortunately it's hard to decide which of the ``levels'' represent the correct value. 6. From all the above discussion it becomes clear that time tags for some images (and even series of images) are erroneous -- for example, for the tags which are off by a second or more during the ``good behavior'' intervals of the difference function. To ``correct'' these tags and also to try to improve tags which have smaller errors, an approximation of the difference was made by a linear piecewise function. The result is formatted as a SPICE SCLK file (one for each spacecraft). The steps used in this process are described below. First, the average difference for each orbit was calculated. Because of strange function behavior for some orbits (described above) the calculation of ``plain'' average (summation of values divided by number of values for one orbit) could introduce additional error and difficulties during interpolation. Therefore, the ``average'' value for each orbit was calculated as the value corresponding to a ``level'' containing the greatest number of points. None of the linear approximation algorithms looking for end of linear piece intervals worked well on this ``average'' difference function. So it was plotted in a large scale and reasonable ends of the intervals were found manually with ruler and pencil. The first iteration gave 27 linear intervals; this number increased to 31 after some iterations. The criteria to start a new interval were the following: - if a few tenths of a second ``jump'' occurred, - if the slope of the line changed significantly. After more than 5 iterations in this process, each of which combined testing the results of the previous iteration and correcting the coefficients based on the result of the test, a linear piecewise function providing close (within 1-2 milliseconds) approximation was generated. It provides a good fit for the intervals where time tag ``behavior'' during orbits was normal, and a reasonable approximation for other intervals. The solid vertical lines present on the figures 1, 2, 5 and 6 represent borders of final linear piecewise interpolation function intervals. 7. For each of the SEDR times and the corresponding ``reconstructed'' times, their difference, and a flag identifying the interval (GOOD quality tags or POOR quality tags) were found. These values were written to a DBK files mentioned above. This function was also formatted as a SPICE SCLK file reconstructing on-board FSC clock. The same operations were done on Viking Orbiter 2 data. They showed exactly the same kind of problems as described in (5). The Figures 5 (file ``vo2fsc.jpg'') and 6 (file ``vo2fsc_a.jpg'') provide difference plots for VO2. These result of the reconstruction were written into a DBK file and also formatted as an SCLK file for FSC on-board clock. 8. The following additional observations were provided by Ed Guinness, Washington University, as a part of his comments during the peer-review of the data set: "A few observations about figures 3 and 4. In figure 4 (orbit 1165), all images were taken with the same exposure duration (12.73 millisecond). So it makes sense that the time differences only vary be 1 millisecond, probably due to truncation or round-off. In figure 3, the plateaus within the orbit correlate with exposure duration in some extent. For example, images from the first plateau had exposure duration of 135.8 ms, the second 101.9, the third 67.88, the fourth back to 135.8, fifth at 101.9. The jump to higher difference occur in the middle of an image sequence with exposure duration of 67.88. Exposures after the jump were 135.8, 101.9 and 67.88. The last images with exposure at 101.9 ms are split among two of the last three plateaus in the figure. Interestingly, the difference in plateau level is equal to the delta exposure time divided by 2. Also, the plateau levels for the second cycle of exposures are equal to the levels of the first cycle. I'm not sure what these observations mean." Time Tags and Approximation Quality Statistics -------------------------------------------------------- Two tables below give an idea about quality of a time tags and, correspondingly, the approximation for a different intervals during the mission. This information was included as a separate column in each of DBK files. VIKING ORBITER 1: interval start stop time tag number FSC FSC quality ---------------------------------------- 1 25837050 26068841 poor 2 26068841 26481992 GOOD 3 26481992 27406171 poor 4 27406171 29204603 poor 5 29204603 31392767 poor 6 31392767 32233616 GOOD 7 32233616 33410000 GOOD 8 33410000 33924780 poor 9 33924780 35672722 poor 10 35672722 36703660 poor 11 36703660 37340633 poor 12 37340633 38054766 GOOD 13 38054766 38996669 GOOD 14 38996669 39516735 GOOD 15 39516735 40501750 GOOD 16 40501750 41286989 GOOD 17 41286989 42269975 GOOD 18 42269975 43316542 poor 19 43316542 43733568 poor 20 43733568 44181868 poor 21 44181868 46158780 poor 22 46158780 49117882 GOOD 23 49117882 50003708 GOOD 24 50003708 50099895 GOOD 25 50099895 50196079 GOOD 26 50196079 50446330 GOOD 27 50446330 51830000 GOOD 28 51830000 52359442 GOOD 29 52359442 53205980 GOOD 30 53205980 53752833 GOOD 31 53752833 85837049 GOOD VIKING ORBITER 2: interval start stop time tags number FSC FSC quality ---------------------------------------- 1 46442015 46800000 GOOD 2 46800000 47220000 GOOD 3 47220000 47500000 GOOD 4 47500000 47710261 GOOD 5 47710261 47900000 GOOD 6 47900000 49023508 GOOD 7 49023508 51143682 GOOD 8 51143682 51854802 GOOD 9 51854802 53000000 GOOD 10 53000000 53252350 GOOD 11 53252350 53550000 GOOD 12 53550000 55832853 GOOD 13 55832853 56450000 poor 14 56450000 57050000 poor 15 57050000 57550000 poor 16 57550000 59000000 poor 17 59000000 60285319 poor