|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgsfc.nssdc.cdf.util.CDFTT2000
public class CDFTT2000
This class contains the handy utility routines (methods) called by the CDF applications to handle epoch data of CDF's CDF_TIME_TT2000 data type.
Field Summary |
---|
Constructor Summary | |
---|---|
CDFTT2000()
|
Method Summary | |
---|---|
static long[] |
breakdown(long nanoSecSinceJ2000)
Breaks a TT2000 epoch value down into its full, UTC-based date/time component parts. |
static long[][] |
breakdown(long[] nanoSecSinceJ2000)
Breaks an array of TT2000 epoch values down into two dimensional array, the first dimension being the count of the epoch values, and the second dimension being their full, UTC-based date/time component parts for each value. |
static long[] |
CDFgetLastDateinLeapSecondsTable()
/** This method returns the last UTC date that a leap second was added in the leap second table used in the class. |
static double[][] |
CDFgetLeapSecondsTable()
This method returns the leap seconds table. |
static int |
CDFgetLeapSecondsTableStatus()
This method returns the status code reflecting whether the leap seconds are from a external file, defined by an environment variable, or the leap seconds are based on the hard-coded table in the class. |
static int |
CDFgetRowsinLeapSecondsTable()
This method returns the number of entries in the leap seconds table. |
static long[] |
compute(long[] year,
long[] month,
long[] day)
Computes an array of TT2000 epochs, nanoseconds since J2000, based on its UTC-based date/time component parts. |
static long[] |
compute(long[] year,
long[] month,
long[] day,
long[] hour)
Computes an array of TT2000 epochs, nanoseconds since J2000, based on its UTC-based date/time component parts. |
static long[] |
compute(long[] year,
long[] month,
long[] day,
long[] hour,
long[] minute)
Computes an array of TT2000 epochs, nanoseconds since J2000, based on its * UTC-based date/time component parts. |
static long[] |
compute(long[] year,
long[] month,
long[] day,
long[] hour,
long[] minute,
long[] second)
Computes an array of TT2000 epochs, nanoseconds since J2000, based on its * UTC-based date/time component parts. |
static long[] |
compute(long[] year,
long[] month,
long[] day,
long[] hour,
long[] minute,
long[] second,
long[] msec)
Computes an array of TT2000 epochs, nanoseconds since J2000, based on its * UTC-based date/time component parts. |
static long[] |
compute(long[] year,
long[] month,
long[] day,
long[] hour,
long[] minute,
long[] second,
long[] msec,
long[] usec)
Computes an array of TT2000 epochs, nanoseconds since J2000, based on its * UTC-based date/time component parts. |
static long[] |
compute(long[] year,
long[] month,
long[] day,
long[] hour,
long[] minute,
long[] second,
long[] msec,
long[] usec,
long[] nsec)
Computes an array of TT2000 epochs, nanoseconds since J2000, based on its * UTC-based date/time component parts. |
static long |
compute(long year,
long month,
long day,
long hour,
long minute,
long second,
long msec,
long usec,
long nsec)
Computes a TT2000 epoch, nanoseconds since J2000, based on its UTC-based date/time component parts. |
static java.lang.String |
encode(long nanoSecSinceJ2000)
Converts an epoch value in TT2000 type into a readable, UTC-based date/time string in ISO 8601 format. |
static java.lang.String[] |
encode(long[] nanoSecSinceJ2000)
Converts an array of epoch values in TT2000 type into an array of readable, UTC-based date/time strings in ISO 8601 format. |
static java.lang.String |
encode(long nanoSecSinceJ2000,
int format)
Converts an epoch value in TT2000 type into a readable, UTC-based date/time string of chosen formats. |
static long |
fromGregorianTime(java.util.GregorianCalendar gc)
This method converts the UTC-based date/time in a GregorianCalendar class object to TT2000 time. |
static long |
fromUTCEPOCH(double epoch)
Convert an epoch value in CDF_EPOCH type to TT2000 type. |
static long |
fromUTCEPOCH16(double[] epoch)
Convert an epoch data in CDF_EPOCH16 type to TT2000 type. |
static long |
fromUTCparts(double year,
double month,
double day)
Computes a TT2000 epoch, nanoseconds since J2000, based on its UTC-based date/time component parts. |
static long |
fromUTCparts(double year,
double month,
double day,
double hour)
Computes a TT2000 epoch, nanoseconds since J2000, based on its UTC-based date/time component parts. |
static long |
fromUTCparts(double year,
double month,
double day,
double hour,
double minute)
Computes a TT2000 epoch, nanoseconds since J2000, based on its UTC-based date/time component parts. |
static long |
fromUTCparts(double year,
double month,
double day,
double hour,
double minute,
double second)
Computes a TT2000 epoch, nanoseconds since J2000, based on its UTC-based date/time component parts. |
static long |
fromUTCparts(double year,
double month,
double day,
double hour,
double minute,
double second,
double milsec)
Computes a TT2000 epoch, nanoseconds since J2000, based on its UTC-based date/time component parts. |
static long |
fromUTCparts(double year,
double month,
double day,
double hour,
double minute,
double second,
double milsec,
double micsec)
Computes a TT2000 epoch, nanoseconds since J2000, based on its UTC-based date/time component parts. |
static long |
fromUTCparts(double year,
double month,
double day,
double hour,
double minute,
double second,
double msec,
double usec,
double nsec)
Computes a TT2000 epoch, nanoseconds since J2000, based on its UTC-based date/time component parts. |
static long |
fromUTCstring(java.lang.String string)
This method parses an input, UTC-based, date/time string and returns a TT2000 epoch value, nanoseconds since J2000. |
static java.lang.String |
getLeapSecondsTableEnvVar()
Find the environment variable "CDF_LEAPSECONDSTABLE" that is defined for the leap seconds table for CDF. |
static double |
LeapSecondsfromYMD(long year,
long month,
long day)
Find the leap seconds from a given, UTC-based year/month/day. |
static long |
parse(java.lang.String string)
This method parses an input date/time string and returns a TT2000 epoch value, nanoseconds since J2000. |
static long[] |
parse(java.lang.String[] strings)
This method parses an array of input date/time strings and returns an array of TT2000 epoch values, nanoseconds since J2000. |
static java.util.GregorianCalendar |
toGregorianTime(long tt2000)
This method converts the UTC-based date/time in TT2000 type to a GregorianCalendar class object in default, local time zone. |
static java.util.GregorianCalendar |
toGregorianTime(long tt2000,
java.util.TimeZone tz)
This method converts the UTC-based date/time in TT2000 type to a GregorianCalendar class object in specified time zone. |
static double |
toUTCEPOCH(long nanoSecSinceJ2000)
Convert an epoch value in TT2000 type to CDF_EPOCH type. |
static double |
toUTCEPOCH16(long nanoSecSinceJ2000,
double[] epoch)
Convert an epoch value in TT2000 type to CDF_EPOCH16 type. |
static long[] |
toUTCparts(long nanoSecSinceJ2000)
Breaks a TT2000 epoch value down into its full, UTC-based date/time component parts. |
static java.lang.String |
toUTCstring(long nanoSecSinceJ2000)
Converts an epoch value in TT2000 type into a readable, UTC-based date/time string of ISO 8601 formats. |
static java.lang.String |
toUTCstring(java.lang.Long nanoSecSinceJ2000)
Converts an epoch value in TT2000 type into a readable, UTC-based date/time string of ISO 8601 formats. |
static java.lang.String |
toUTCstring(long nanoSecSinceJ2000,
int format)
Converts an epoch value in TT2000 type into a readable, UTC-based date/time string of chosen formats. |
static java.lang.String |
toUTCstring(java.lang.Long nanoSecSinceJ2000,
int format)
Converts an epoch value in TT2000 type into a readable, UTC-based date/time string of chosen formats. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CDFTT2000()
Method Detail |
---|
public static java.lang.String getLeapSecondsTableEnvVar()
public static double LeapSecondsfromYMD(long year, long month, long day)
year
- the yearmonth
- the monthday
- the day
public static long[] toUTCparts(long nanoSecSinceJ2000)
nanoSecSinceJ2000
- the epoch value, in nanoseconds since J2000,
to break down
Index | Part |
0 | year |
1 | month |
2 | day |
3 | hour |
4 | minute |
5 | second |
6 | millisecond |
7 | microsecond |
8 | nanosecond |
public static long[] breakdown(long nanoSecSinceJ2000)
nanoSecSinceJ2000
- the epoch value, in nanoseconds since J2000,
to break down
Index | Part |
0 | year |
1 | month |
2 | day |
3 | hour |
4 | minute |
5 | second |
6 | millisecond |
7 | microsecond |
8 | nanosecond |
public static long[][] breakdown(long[] nanoSecSinceJ2000)
nanoSecSinceJ2000
- an array of epoch values, in nanoseconds since
J2000, to break down
Index | Part |
0 | year |
1 | month |
2 | day |
3 | hour |
4 | minute |
5 | second |
6 | millisecond |
7 | microsecond |
8 | nanosecond |
public static long fromUTCparts(double year, double month, double day) throws CDFException
year
- the year, a full year in doublemonth
- the month, a full month in doubleday
- the day in double
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static long fromUTCparts(double year, double month, double day, double hour) throws CDFException
year
- the year, a full year in doublemonth
- the month, a full month in doubleday
- the day, a full day in doublehour
- the hour in double
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static long fromUTCparts(double year, double month, double day, double hour, double minute) throws CDFException
year
- the year, a full year in doublemonth
- the month, a full month in doubleday
- the day, a full day in doublehour
- the hour, a full hour in doubleminute
- the minute in double
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static long fromUTCparts(double year, double month, double day, double hour, double minute, double second) throws CDFException
year
- the year, a full year in doublemonth
- the month, a full month in doubleday
- the day, a full day in doublehour
- the hour, a full hour in doubleminute
- the minute, a full minute in doublesecond
- the second in double
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static long fromUTCparts(double year, double month, double day, double hour, double minute, double second, double milsec) throws CDFException
year
- the year, a full year in doublemonth
- the month, a full month in doubleday
- the day, a full day in doublehour
- the hour, a full hour in doubleminute
- the minute, a full minute in doublesecond
- the second, a full second in doublemilsec
- the millisecond in double
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static long fromUTCparts(double year, double month, double day, double hour, double minute, double second, double milsec, double micsec) throws CDFException
year
- the year, a full year in doublemonth
- the month, a full month in doubleday
- the day, a full day in doublehour
- the hour, a full hour in doubleminute
- the minute, a full minute in doublesecond
- the second, a full second in doublemilsec
- the millisecond, a full millisecond in doublemicsec
- the microsecond in double
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static long fromUTCparts(double year, double month, double day, double hour, double minute, double second, double msec, double usec, double nsec) throws CDFException
year
- the year, a full year in doublemonth
- the month, a full month in doubleday
- the day, a full day in doublehour
- the hour, a full hour in doubleminute
- the minute, a full minute in doublesecond
- the second, a full second in doublemsec
- the millisecond, a full millisecond in doubleusec
- the microsecond, a full microsecond in doublensec
- the nanosecond, a full nanosecond in double
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static long compute(long year, long month, long day, long hour, long minute, long second, long msec, long usec, long nsec) throws CDFException
year
- the year, a full year in longmonth
- the month, a full month in longday
- the day, a full day in longhour
- the hour, a full hour in longminute
- the minute, a full minute in longsecond
- the second, a full second in longmsec
- the millisecond, a full millisecond in longusec
- the microsecond, a full microsecond in longnsec
- the nanosecond, a full nanosecond in long
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static long[] compute(long[] year, long[] month, long[] day) throws CDFException
year
- an array of years, a full year in longmonth
- an array of months, a full month in longday
- an array of days, a full day in long
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static long[] compute(long[] year, long[] month, long[] day, long[] hour) throws CDFException
year
- an array of years, a full year in longmonth
- an array of months, a full month in longday
- an array of days, a full day in longhour
- an array of hours, a full hour in long
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static long[] compute(long[] year, long[] month, long[] day, long[] hour, long[] minute) throws CDFException
year
- an array of years, a full year in longmonth
- an array of months, a full month in longday
- an array of days, a full day in longhour
- an array of hours, a full hour in longminute
- an array of minutes, a full minute in long
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static long[] compute(long[] year, long[] month, long[] day, long[] hour, long[] minute, long[] second) throws CDFException
year
- an array of years, a full year in longmonth
- an array of months, a full month in longday
- an array of days, a full day in longhour
- an array of hours, a full hour in longminute
- an array of minutes, a full minute in longsecond
- an array of seconds, a full second in long
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static long[] compute(long[] year, long[] month, long[] day, long[] hour, long[] minute, long[] second, long[] msec) throws CDFException
year
- an array of years, a full year in longmonth
- an array of months, a full month in longday
- an array of days, a full day in longhour
- an array of hours, a full hour in longminute
- an array of minutes, a full minute in longsecond
- an array of seconds, a full second in longmsec
- an array of milliseconds, a full millisecond in long
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static long[] compute(long[] year, long[] month, long[] day, long[] hour, long[] minute, long[] second, long[] msec, long[] usec) throws CDFException
year
- an array of years, a full year in longmonth
- an array of months, a full month in longday
- an array of days, a full day in longhour
- an array of hours, a full hour in longminute
- an array of minutes, a full minute in longsecond
- an array of seconds, a full second in longmsec
- an array of milliseconds, a full millisecond in longusec
- an array of microseconds, a full microsecond in long
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static long[] compute(long[] year, long[] month, long[] day, long[] hour, long[] minute, long[] second, long[] msec, long[] usec, long[] nsec) throws CDFException
year
- an array of years, a full year in longmonth
- an array of months, a full month in longday
- an array of days, a full day in longhour
- an array of hours, a full hour in longminute
- an array of minutes, a full minute in longsecond
- an array of seconds, a full second in longmsec
- an array of milliseconds, a full millisecond in longusec
- an array of microseconds, a full microsecond in longnsec
- an array of nanoseconds, a full nanosecond in long
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static double toUTCEPOCH(long nanoSecSinceJ2000) throws CDFException
nanoSecSinceJ2000
- the nanoseconds since J2000
CDFException
- an ILLEGAL_EPOCH_FIELD if an illegal
component value is detected.public static long fromUTCEPOCH(double epoch) throws CDFException
epoch
- the CDF_EPOCH value
CDFException
- an TT2000_TIME_ERROR if date is out of the
valid range for TT2000.public static double toUTCEPOCH16(long nanoSecSinceJ2000, double[] epoch) throws CDFException
nanoSecSinceJ2000
- the nanoseconds since J2000epoch
- the returned CDF_EPOCH16 value, a double[2] object
CDFException
- an ILLEGAL_EPOCH_FIELD if an illegal
component value is detected.public static long fromUTCEPOCH16(double[] epoch) throws CDFException
epoch
- the CDF_EPOCH16 value, a double[2] object
CDFException
- an TT2000_TIME_ERROR if date is out of the
valid range for TT2000.public static java.lang.String toUTCstring(java.lang.Long nanoSecSinceJ2000)
yyyy-mm-ddThh:mm:ss.ccccccccc Examples: 1990-04-01T03:05:02.000000000 1993-10-10T23:45:49.777888999
nanoSecSinceJ2000
- the TT2000 epoch value, nanoseconds since
J2000, in Long object
public static java.lang.String toUTCstring(long nanoSecSinceJ2000)
yyyy-mm-ddThh:mm:ss.ccccccccc Examples: 1990-04-01T03:05:02.000000000 1993-10-10T23:45:49.777888999These formats are the same as those expected by fromUTCstring.
nanoSecSinceJ2000
- the TT2000 epoch value, nanoseconds since
J2000, in long
public static java.lang.String toUTCstring(java.lang.Long nanoSecSinceJ2000, int format)
Format:0 dd-mmm-yyyy hh:mm:ss.ccccccccc Examples: 01-Apr-1990 03:05:02.000000000 10-Oct-1993 23:45:49.777888999 Format:1 yyyymmdd.cccccccccc Examples: 19900401.1234567890 19931010.9998887776 Format:2 yyyymmddhhmmss Examples: 19900401030502 19931010234549 Format:3 yyyy-mm-ddThh:mm:ss.ccccccccc Examples: 1990-04-01T03:05:02.000000000 1993-10-10T23:45:49.777888999 This is the default, ISO 8601, output.These formats are the same as those expected by fromUTCstring.
nanoSecSinceJ2000
- the TT2000 epoch value, nanoseconds since
J2000, in Long objectformat
- the format (from 0 to 3, as the default), an optional
public static java.lang.String toUTCstring(long nanoSecSinceJ2000, int format)
Format:0 dd-mmm-yyyy hh:mm:ss.ccccccccc Examples: 01-Apr-1990 03:05:02.000000000 10-Oct-1993 23:45:49.777888999 Format:1 yyyymmdd.cccccccccc Examples: 19900401.1234567890 19931010.9998887776 Format:2 yyyymmddhhmmss Examples: 19900401030502 19931010234549 Format:3 yyyy-mm-ddThh:mm:ss.ccccccccc Examples: 1990-04-01T03:05:02.000000000 1993-10-10T23:45:49.777888999 This is the default, ISO 8601, output.These formats are the same as those expected by fromUTCstring.
nanoSecSinceJ2000
- the TT2000 epoch value, nanoseconds since
J2000, in longformat
- the format (from 0 to 3, as the default), an optional
public static java.lang.String encode(long nanoSecSinceJ2000)
yyyy-mm-ddThh:mm:ss.ccccccccc Examples: 1990-04-01T03:05:02.000000000 1993-10-10T23:45:49.777888999
nanoSecSinceJ2000
- the TT2000 epoch value, nanoseconds since
J2000, in long
public static java.lang.String[] encode(long[] nanoSecSinceJ2000)
yyyy-mm-ddThh:mm:ss.ccccccccc Examples: 1990-04-01T03:05:02.000000000 1993-10-10T23:45:49.777888999
nanoSecSinceJ2000
- the TT2000 epoch value, nanoseconds since
J2000, in long
public static java.lang.String encode(long nanoSecSinceJ2000, int format)
Format:0 dd-mmm-yyyy hh:mm:ss.ccccccccc Examples: 01-Apr-1990 03:05:02.000000000 10-Oct-1993 23:45:49.777888999 Format:1 yyyymmdd.cccccccccc Examples: 19900401.1234567890 19931010.9998887776 Format:2 yyyymmddhhmmss Examples: 19900401030502 19931010234549 Format:3 yyyy-mm-ddThh:mm:ss.ccccccccc Examples: 1990-04-01T03:05:02.000000000 1993-10-10T23:45:49.777888999 This is the default, ISO 8601, output.These formats are the same as those expected by fromUTCstring.
nanoSecSinceJ2000
- the TT2000 epoch value, nanoseconds since
J2000, in longformat
- the format (from 0 to 3, as the default), an optional
public static long fromUTCstring(java.lang.String string) throws CDFException
Format:0 dd-mmm-yyyy hh:mm:ss.ccccccccc Examples: 01-Apr-1990 03:05:02.000000000 10-Oct-1993 23:45:49.777888999 Format:1 yyyymmdd.cccccccccc Examples: 19900401.1234567890 19931010.9998887776 Format:2 yyyymmddhhmmss Examples: 19900401030502 19931010234549 Format:3 yyyy-mm-ddThh:mm:ss.ccccccccc Examples: 1990-04-01T03:05:02.000000000 1993-10-10T23:45:49.777888999These formats are the same as those created by toUTCstring.
string
- the epoch in string representation
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static long parse(java.lang.String string) throws CDFException
Format:0 dd-mmm-yyyy hh:mm:ss.ccccccccc Examples: 01-Apr-1990 03:05:02.000000000 10-Oct-1993 23:45:49.777888999 Format:1 yyyymmdd.cccccccccc Examples: 19900401.1234567890 19931010.9998887776 Format:2 yyyymmddhhmmss Examples: 19900401030502 19931010234549 Format:3 yyyy-mm-ddThh:mm:ss.ccccccccc Examples: 1990-04-01T03:05:02.000000000 1993-10-10T23:45:49.777888999These formats are the same as those created by toUTCstring.
string
- the epoch in string representation
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static long[] parse(java.lang.String[] strings) throws CDFException
Format:0 dd-mmm-yyyy hh:mm:ss.ccccccccc Examples: 01-Apr-1990 03:05:02.000000000 10-Oct-1993 23:45:49.777888999 Format:1 yyyymmdd.cccccccccc Examples: 19900401.1234567890 19931010.9998887776 Format:2 yyyymmddhhmmss Examples: 19900401030502 19931010234549 Format:3 yyyy-mm-ddThh:mm:ss.ccccccccc Examples: 1990-04-01T03:05:02.000000000 1993-10-10T23:45:49.777888999These formats are the same as those created by toUTCstring.
strings
- an array of epochs in string representation
CDFException
- an TT2000_TIME_ERROR if an illegal
component value is detected.public static long[] CDFgetLastDateinLeapSecondsTable()
public static long fromGregorianTime(java.util.GregorianCalendar gc)
CDFException
- an TT2000_TIME_ERROR if a GregorianCalendar
component value is detected.public static java.util.GregorianCalendar toGregorianTime(long tt2000)
public static java.util.GregorianCalendar toGregorianTime(long tt2000, java.util.TimeZone tz)
public static int CDFgetLeapSecondsTableStatus()
public static double[][] CDFgetLeapSecondsTable()
public static int CDFgetRowsinLeapSecondsTable()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |