JULIAN DATES IN THE DEEP IMPACT AND EPOXI ARCHIVES                            
  AND                                                                         
THEIR INTERACTION WITH LEAP SECONDS                                           
                                                                              
                                                                              
                                                                              
History                                                                       
=======                                                                       
  2010-09-13  B.T.Carcich  Initial version                                    
                                                                              
                                                                              
Table of Contents                                                             
=================                                                             
                                                                              
  References                                                                  
  Prerequisites                                                               
  Summary                                                                     
  Julian dates and leap seconds in data sets from the Deep Impact Instruments 
    Overview                                                                  
    Details                                                                   
    Julian dates in the DI data sets                                          
    JD UTC values in the DI data sets                                         
    JD TDB values in the DI data sets                                         
    Julian dates in the PDS DI FITS headers                                   
    Julian dates in the PDS DI data labels                                    
  Cognizant persons                                                           
                                                                              
                                                                              
References                                                                    
==========                                                                    
                                                                              
  [1] NAIF/SPICE TIME required reading document, available from               
      http://naif.jpl.nasa.gov/.                                              
                                                                              
  [2] Astronomical Almanac Online. (2010). U.S. Nautical Almanac Office and   
      Her Majesty's Nautical Almanac Office.  http://asa.usno.navy.mil/ and   
      http://asa.hmnao.com/.                                                  
                                                                              
  [3] Planetary Data System Standards Reference, Version 3.9, JPL D-7669      
      Part 2, Jet Propulsion Laboratory, California Institute of Technology,  
      Pasadena, California, USA, 2009.                                        
                                                                              
  [4] Pence, W.; Chiappetti, L.; Page, C.; Shaw, R.; Stobie, E.; (IAUFWG      
      Technical Panel), Definition of the Flexible Image Transport System     
      (FITS).   FITS Standard version 3.0 Internat. Astronomical Union        
      Commiss.  5: Documentation and Astronomical Data. FITS Working Group    
      (2008) http://fits.gsfc.nasa.gov/standard30/fits_standard30.pdf         
                                                                              
                                                                              
                                                                              
Prerequisites                                                                 
=============                                                                 
                                                                              
  =====================================================================       
  == N.B.  it is assumed that the reader is familiar with the  time  ==       
  ==       required reading material from the NAIF/SPICE toolkit     ==       
  ==       documentation [1], specifically with terms and concepts   ==       
  ==       such as Julian Date, UTC, TDB, leapseconds, &c.  Refer to ==       
  ==       the references above for details.                         ==       
  =====================================================================       
                                                                              
                                                                              
Summary                                                                       
========                                                                      
                                                                              
  The Deep Impact (DI) and EPOXI data sets to-date span two leap seconds:     
  2005-DEC-31T23:59:60 and 2008-DEC-31T23:59:60.  Therefore, any differences  
  calculated between DI UTC JDs which span one or both of those leap seconds  
  must add one, or two seconds to the calculated result.                      
                                                                              
  With two exceptions, all keywords using Julian dates (JDs) in the FITS      
  headers and PDS data file labels of the Deep Impact (DI) data sets are      
  UTC JDs.  This means that any two JDs from these data sets may not          
  be arbitrarily associated by simple differencing of the JD values.          
                                                                              
  The two exceptions are FITS header keywords OBSMIDJT and KPKSSBJT which     
  are JD TDB values, and are plainly labelled as such in the header keyword   
  comments.                                                                   
                                                                              
                                                                              
Julian dates and leap seconds in data sets from the Deep Impact Instruments   
===========================================================================   
                                                                              
                                                                              
  Overview                                                                    
  --------                                                                    
                                                                              
    The purpose of this document is to alert the data set user to pitfalls    
    when calculating differences between Julian Dates within the data sets    
    and between Julian Dates from the data sets with other time systems.      
                                                                              
    Almost all JD time representations in the DI data sets are UTC JDs and    
    therefore require that leap seconds be taken into account when            
    calculating time differentials between UTC JDs.                           
                                                                              
                                                                              
  Details                                                                     
  -------                                                                     
                                                                              
    There are several representations of time used in the DI data sets; one   
    of them is Julian Date.  The Julian Date system uses a number which       
    represents the time since an epoch, specifically                          
                                                                              
      Julian date (JD): the interval of time in days and fractions of a day,  
      since 4713 B.C. January 1, Greenwich noon, Julian proleptic calendar    
      [2].                                                                    
                                                                              
    That definition, from the Glossary of reference [2], goes on to prescribe 
    the following:                                                            
                                                                              
      In precise work, the timescale, e.g., Terrestrial Time (TT) or          
      Universal Time (UT), should be specified [2].                           
                                                                              
    This intent of this document is to fulfill that prescription.  The issue  
    is that calculating time differences between Julian dates involves more   
    than subtracting two floating point numbers.                              
                                                                              
    The specific pitfall is that Julian dates look like real numbers, e.g.    
    2452545.000000, which appear to represent a time using two parts:  an     
    integral part which corresponds to a number of whole days; a fractional   
    change part which corresponds to a fractional day.  However, in some      
    contexts, one day in the integral part may not represent a change of      
    86,400 seconds in time.  This is due to leap seconds, an explanation of   
    which is outside the scope of this document.  The reader is referred to   
    the references above plus available literature, but suffice to say that   
    since the January 2005 launch of the DI spacecraft, two leap seconds have 
    occurred:  2005-DEC-31T23:59:60; 2008-DEC-31T23:59:60.                    
                                                                              
                                                                              
  Julian dates in the DI data sets                                            
  --------------------------------                                            
                                                                              
    There are two kinds of Julian dates used in the FITS headers and in the   
    PDS data labels of the DI data.  The most used kind is JD UTC, aka UT JD  
    and UTC JD.  The second kind is JD TDB.                                   
                                                                              
                                                                              
  JD UTC values in the DI data sets                                           
  ---------------------------------                                           
                                                                              
    Due to leap seconds, and like UTC calendar times, JD UTC values are not   
    continuous with respect to continuous time systems such as TT or TDB, and 
    should therefore not be treated as real numbers subject to arithmetic     
    operations such as addition and subtraction.  JD UTC values should instead
    be thought of as symbols representing specific times; in that sense JD    
    UTCs are analogous to calendar strings such e.g.                          
                                                                              
      2010-09-13T01:23:45.6789 UTC                                            
                                                                              
    N.B. The JD UTC time system is discontinuous across leap seconds and      
         therefore has no way to represent time during a leap second.         
         However, there have been no DI data taken during any leap second     
         that would require such a problem to be resolved.                    
                                                                              
                                                                              
  JD TDB values in the DI data sets                                           
  ---------------------------------                                           
                                                                              
    JD TDB values are continuous and linear with respect to the continuous    
    TDB time system, and typically differed from JD UTC values by about       
    0.000075d (~65s) during the DI mission.                                   
                                                                              
    For details regarding time conversions between UTC times and other time   
    systems the reader is referred to the NAIF/SPICE toolkit library and its  
    attendant documentation, specifically the TIME required reading document  
    [1].                                                                      
                                                                              
                                                                              
  Julian dates in the PDS DI data labels                                      
  --------------------------------------                                      
                                                                              
    In the PDS labels, the relevant PDS keywords using Julian Dates are       
                                                                              
      START_JULIAN_DATE_VALUE                                                 
      MID_JULIAN_DATE_VALUE                                                   
      STOP_JULIAN_DATE_VALUE                                                  
                                                                              
    Although not defined by the PDS standard [3], these keywords'             
    floating-point values have been written as UT JDs at the direction        
    of the Science Team.                                                      
                                                                              
                                                                              
  Julian dates in the PDS DI FITS headers                                     
  ---------------------------------------                                     
                                                                              
    In the FITS headers of the DI data, all JDs, except two, are UT JDs.      
                                                                              
    The two JDs in the FITS headers are comments defining them as TDB JDs:    
                                                                              
      OBSMIDJT=  ... / [JD TDB] Barycentric time at mid-obs at s/c            
      KPKSSBJT=  ... / [JD TDB] When light reaches Solar Barycenter           
                                                                              
    The reader is directed to the FITS standard [4] for the format of keyword 
    comments in FITS headers.                                                 
                                                                              
    Again, for details regarding time conversions between UTC times and other 
    time systems the reader is directed to the NAIF/SPICE toolkit library and 
    its attendant documentation, specifically the TIME required reading       
    document [1].                                                             
                                                                              
                                                                              
Cognizant persons                                                             
=================                                                             
                                                                              
  This document was written by Brian Carcich, Cornell University,             
  Ithaca, NY, and reviewed by members of the EPOXI Science Team.