driver.ted.utilities
Class T_GPSTime

java.lang.Object
  extended by driver.ted.utilities.T_GPSTime

public class T_GPSTime
extends java.lang.Object

Title: T_GPSTime Class
Description: The class provides GPS Time functions.
Copyright: (c) 2002 - 2006
Change History:
Changes:

Version:
1.1
Author:
Ted Driver

Constructor Summary
T_GPSTime()
          Constructor that creates a GPSTime object with the current system time
T_GPSTime(int GPSWeek, int timeOfWeek)
          Constructor that creates a GPSTime object with the initial time set by the GPSWeek and timeOfWeek parameters
T_GPSTime(T_JulianDate J)
          Constructor that creates a GPSTime object with the initial time specified by the T_JulianDate object
 
Method Summary
 void advance(int mo, int d, int y, int h, int mi, int s)
          Advances the time maintained in this object.
 java.lang.String getGPSEpoch()
          Returns the date of the latest epoch associated with the GPSTime object
 int getGPSEpochIndex()
          Returns the GPS Epoch index
 double getGPSTime()
          Returns the value of the GPSTime in Julian Date format
 int getGPSWeek()
          Returns the GPS Week of the current GPSTime object
 int getGPSWeek(T_JulianDate J)
          Utility method to return the GPS week number associated with the T_JulianDate object.
 double getKpoints()
          Returns the K-Points (15-minute segments) associated with this GPSTime object
 int getTimeOfWeek()
          Returns the time of week of the current GPSTime object
 int getTimeOfWeek(T_JulianDate J)
          Utility method to return the time of week in seconds associated with the T_JulianDate object.
 long getZCounts()
          Returns the Z-Counts (1.5 second segments) since the latest GPS Epoch
static void main(java.lang.String[] args)
          Test program for the T_GPSTime class
 void setGPSEpoch(int epoch)
          Sets the GPS Epoch for the GPS time from which the Z-Counts and K-Points are referenced.
 void setGPSTime(T_JulianDate J)
          Set the GPS time to that specified by the T_JulianDate object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

T_GPSTime

public T_GPSTime()
Constructor that creates a GPSTime object with the current system time


T_GPSTime

public T_GPSTime(T_JulianDate J)
Constructor that creates a GPSTime object with the initial time specified by the T_JulianDate object

Parameters:
J - T_JulianDate object specifying the initial time

T_GPSTime

public T_GPSTime(int GPSWeek,
                 int timeOfWeek)
Constructor that creates a GPSTime object with the initial time set by the GPSWeek and timeOfWeek parameters

Parameters:
GPSWeek - Must be counted from the initial GPS Epoch (Jan 6, 1980)
timeOfWeek - Must be integer seconds from Sunday midnight
Method Detail

getGPSWeek

public int getGPSWeek(T_JulianDate J)
Utility method to return the GPS week number associated with the T_JulianDate object. This method does NOT update the state of the T_GPSTime object

Parameters:
J - T_JulianDate object
Returns:
Returns the integer GPS week number since the GPS Epoch (Jan 6, 1980)

getTimeOfWeek

public int getTimeOfWeek(T_JulianDate J)
Utility method to return the time of week in seconds associated with the T_JulianDate object. This method does NOT update the state of the T_GPSTime object

Parameters:
J - T_JulianDate object
Returns:
Integer time of week in seconds (0 - 604799)

getGPSWeek

public int getGPSWeek()
Returns the GPS Week of the current GPSTime object

Returns:
Integer GPS week since Jan 6, 1980

getTimeOfWeek

public int getTimeOfWeek()
Returns the time of week of the current GPSTime object

Returns:
Integer time of week (0-604799)

getGPSEpoch

public java.lang.String getGPSEpoch()
Returns the date of the latest epoch associated with the GPSTime object
1st epoch = January 6, 1980, 00:00:00
2nd epoch = August 22, 1999, 00:00:00
3rd epoch = April 8, 2019, 00:00:00
4th epoch = November 21, 2038, 00:00:00
5th epoch = July 7th, 2058, 00:00:00
Times greater than the 5th epoch are not supported.

Returns:
String of the date of the latest epoch

getKpoints

public double getKpoints()
Returns the K-Points (15-minute segments) associated with this GPSTime object

Returns:
Double value of the K-Points since the latest GPS epoch

getZCounts

public long getZCounts()
Returns the Z-Counts (1.5 second segments) since the latest GPS Epoch

Returns:
Long value of the number of Z-Counts since the latest GPS Epoch

getGPSEpochIndex

public int getGPSEpochIndex()
Returns the GPS Epoch index
1 = 1st epoch = January 6, 1980 to August 22, 1999
2 = 2nd epoch = August 22, 1999 to April 7, 2019
3 = 3rd epoch = April 8, 2019 to November 21, 2038
4 = 4th epoch = November 21, 2038 to July 7th, 2058
5 = 5th epoch > July 7th, 2058
Times greater than the 5th epoch are not supported.

Returns:
Integer GPS epoch value

getGPSTime

public double getGPSTime()
Returns the value of the GPSTime in Julian Date format

Returns:
double value representing the Julian Date of the objects GPSTime

advance

public void advance(int mo,
                    int d,
                    int y,
                    int h,
                    int mi,
                    int s)
Advances the time maintained in this object. Use negative values to decrement the time.

Parameters:
mo - Months to advance
d - Days to advance
y - Years to advance
h - Hours to advance
mi - Minutes to advance
s - Seconds to advance

setGPSTime

public void setGPSTime(T_JulianDate J)
Set the GPS time to that specified by the T_JulianDate object

Parameters:
J - T_JulianDate object specifying the time

setGPSEpoch

public void setGPSEpoch(int epoch)
Sets the GPS Epoch for the GPS time from which the Z-Counts and K-Points are referenced.
1 = 1st epoch = January 6, 1980 to August 22, 1999
2 = 2nd epoch = August 22, 1999 to April 7, 2019
3 = 3rd epoch = April 8, 2019 to November 21, 2038
4 = 4th epoch = November 21, 2038 to July 7th, 2058
5 = 5th epoch > July 7th, 2058

Parameters:
epoch - The integer epoch

main

public static void main(java.lang.String[] args)
Test program for the T_GPSTime class

Parameters:
args - Arguments