grs.spice
Class TimeConverter

java.lang.Object
  |
  +--grs.spice.TimeConverter

public final class TimeConverter
extends Object

Time Conversion functions that use the SPICE JNI functions. Make sure libJavaSpice.so is on your java.library.path.


Field Summary
static int odysseyId
           
static SimpleDateFormat spiceTimeFormat
           
 
Constructor Summary
TimeConverter()
           
 
Method Summary
static Date CLOCKtoDate(String clock, int scId)
          Convert spacecraft clock string to UTC Date object.
static double CLOCKtoTICKS(String clock, int scId)
          Convert spacecraft clock string to ticks.
static String CLOCKtoUTC(String clock, int scId)
          Convert spacecraft clock string to UTC time.
static double DatetoET(Date date, int scId)
           
static double DatetoLS(Date date)
           
static double DatetoSCLK(Date utc, int scId)
          Convert a Date Object to a spacecraft time in ticks.
static double ETtoSCLK(double et, int scId)
          Convert a J2000 ephemeris time to a spacecraft time.
static String ETtoUTC(double et)
          Convert a J2000 epheremis time to UTC.
static long getCurrentSCLK()
          Return current time in ticks.
static Date SCLKtoDate(double ticks, int scId)
          Convert a spacecraft time in ticks to a Date.
static double SCLKtoET(double ticks, int scId)
          Convert a spacecraft time in ticks to ephemeris time.
static double SCLKtoLS(long ticks)
           
static String SCLKtoUTC(double ticks, int scId)
          Convert a spacecraft time in ticks to a UTC time.
static String SCLKtoUTC(long ticks, int scId)
          Convert a spacecraft time in ticks to a UTC time.
static String TICKStoCLOCK(double ticks, int scId)
          Convert spacecraft ticks to a spacecraft clock string (includes partition).
static double UTCtoET(String utc)
          Convert a UTC time to J2000 epheremis time.
static double UTCtoLS(String utc)
           
static double UTCtoSCLK(String utc, int scId)
          Convert a UTC time to a spacecraft time in ticks.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

odysseyId

public static final int odysseyId
See Also:
Constant Field Values

spiceTimeFormat

public static final SimpleDateFormat spiceTimeFormat
Constructor Detail

TimeConverter

public TimeConverter()
Method Detail

getCurrentSCLK

public static final long getCurrentSCLK()
                                 throws SpiceException
Return current time in ticks.

Returns:
S/C Clock ticks (256 per second).
Throws:
SpiceException - Internal Error

CLOCKtoUTC

public static final String CLOCKtoUTC(String clock,
                                      int scId)
                               throws SpiceException
Convert spacecraft clock string to UTC time.

Parameters:
scId - NAIF id
SpiceException

CLOCKtoDate

public static final Date CLOCKtoDate(String clock,
                                     int scId)
                              throws SpiceException
Convert spacecraft clock string to UTC Date object.

Parameters:
scId - NAIF id
SpiceException

UTCtoSCLK

public static final double UTCtoSCLK(String utc,
                                     int scId)
                              throws SpiceException
Convert a UTC time to a spacecraft time in ticks.

Parameters:
scId - the NAIF spacecraft id, as defined in the SPICE toolkit's naif_ids.req. Odyssey ID is -53.
utc - Time in form YYYY Mon DD HR:MN:SC.###
Returns:
S/C Clock ticks (256 per second).
Throws:
SpiceException - Make sure utc is in format

DatetoSCLK

public static final double DatetoSCLK(Date utc,
                                      int scId)
                               throws SpiceException
Convert a Date Object to a spacecraft time in ticks.

Parameters:
scId - the NAIF spacecraft id, as defined in the SPICE toolkit's naif_ids.req. Odyssey ID is -53.
utc - Date object corresponding to a UTC time
Returns:
S/C Clock ticks (256 per second).
Throws:
SpiceException - Make sure Date is in UTC

SCLKtoUTC

public static final String SCLKtoUTC(double ticks,
                                     int scId)
                              throws SpiceException
Convert a spacecraft time in ticks to a UTC time.

Parameters:
ticks - S/C Clock ticks (256 per second).
Returns:
UTC time in form YYYY Mon DD HR:MN:SC.###
Throws:
SpiceException - Most likely the S/C time is not within the SCLK partition

SCLKtoET

public static final double SCLKtoET(double ticks,
                                    int scId)
                             throws SpiceException
Convert a spacecraft time in ticks to ephemeris time.

Parameters:
ticks - S/C Clock ticks (256 per second).
Returns:
ephemeris time
Throws:
SpiceException - Most likely the S/C time is not within the SCLK partition

DatetoET

public static final double DatetoET(Date date,
                                    int scId)
                             throws SpiceException
SpiceException

SCLKtoDate

public static final Date SCLKtoDate(double ticks,
                                    int scId)
                             throws SpiceException
Convert a spacecraft time in ticks to a Date.

Parameters:
ticks - S/C Clock ticks (256 per second).
Returns:
Date object
Throws:
SpiceException - Most likely the S/C time is not within the SCLK partition

SCLKtoUTC

public static final String SCLKtoUTC(long ticks,
                                     int scId)
                              throws SpiceException
Convert a spacecraft time in ticks to a UTC time.

Parameters:
ticks - S/C Clock ticks (256 per second).
scId - the NAIF spacecraft id, as defined in the SPICE toolkit's naif_ids.req. Odyssey ID is -53.
Returns:
UTC time in form YYYY Mon DD HR:MN:SC.###
Throws:
SpiceException - Most likely the S/C time is not within the SCLK partition

CLOCKtoTICKS

public static final double CLOCKtoTICKS(String clock,
                                        int scId)
                                 throws SpiceException
Convert spacecraft clock string to ticks.

Parameters:
scId - the NAIF spacecraft id, as defined in the SPICE toolkit's naif_ids.req. Odyssey ID is -53.
Returns:
spacecraft clock in ticks
Throws:
SpiceException - Most likely the S/C time is not within the SCLK partition

TICKStoCLOCK

public static final String TICKStoCLOCK(double ticks,
                                        int scId)
                                 throws SpiceException
Convert spacecraft ticks to a spacecraft clock string (includes partition).

Parameters:
ticks - S/C Clock ticks (256 per second).
scId - the NAIF spacecraft id, as defined in the SPICE toolkit's naif_ids.req. Odyssey ID is -53.
Throws:
SpiceException - Most likely the S/C time is not within the SCLK partition

ETtoUTC

public static final String ETtoUTC(double et)
                            throws SpiceException
Convert a J2000 epheremis time to UTC.

Parameters:
et - J2000 ephemeris time (seconds since noon January 01, 2000).
Returns:
UTC time in form YYYY Mon DD HR:MN:SC.###
Throws:
SpiceException

ETtoSCLK

public static final double ETtoSCLK(double et,
                                    int scId)
                             throws SpiceException
Convert a J2000 ephemeris time to a spacecraft time.

Parameters:
et - J2000 ephemeris time (seconds since noon January 01, 2000).
scId - the NAIF spacecraft id, as defined in the SPICE toolkit's naif_ids.req. Odyssey ID is -53.
Returns:
S/C Clock ticks (256 per second)
Throws:
SpiceException

UTCtoET

public static final double UTCtoET(String utc)
                            throws SpiceException
Convert a UTC time to J2000 epheremis time. (Seconds since noon January 01, 2000).

Parameters:
utc - Time in form YYYY MON DD HR:MN:SC.###
Returns:
J2000 ephemeris time (seconds since noon January 01, 2000).
Throws:
SpiceException

SCLKtoLS

public static final double SCLKtoLS(long ticks)
                             throws SpiceException
Returns:
degrees solar longitude
SpiceException

UTCtoLS

public static final double UTCtoLS(String utc)
                            throws SpiceException
Parameters:
utc - Time in form YYYY MON DD HR:MN:SC.###
Returns:
degrees solar longitude
SpiceException

DatetoLS

public static final double DatetoLS(Date date)
                             throws SpiceException
Returns:
degrees solar longitude
SpiceException


2001 Mars Odyssey Gamma Ray Spectrometer Team