Class ProductData.UTC

    • Field Detail

      • UTC_TIME_ZONE

        public static final TimeZone UTC_TIME_ZONE
        The default UTC time zone used by this class.
      • DATE_FORMAT_PATTERN

        public static final String DATE_FORMAT_PATTERN
        The default pattern used to format date strings.
        See Also:
        Constant Field Values
    • Constructor Detail

      • UTC

        public UTC()
        Constructs a new UTC value.
      • UTC

        public UTC​(int[] elems)
        Constructs a MJD2000 date instance.
        Parameters:
        elems - an array containg at least the three elements {days, seconds, microSeconds}
      • UTC

        public UTC​(int days,
                   int seconds,
                   int microSeconds)
        Constructs a MJD2000 date instance.
        Parameters:
        days - the number of days since 2000-01-01 00:00
        seconds - the seconds fraction of the number of days
        microSeconds - the microseconds fraction of the number of days
      • UTC

        public UTC​(double mjd)
        Constructs a MJD2000 date instance.
        Parameters:
        mjd - the Modified Julian Day 2000 (MJD2000) as double value
        See Also:
        getMJD()
    • Method Detail

      • create

        public static ProductData.UTC create​(Date date,
                                             long micros)
        Creates a new UTC instance based on the given time and microseconds fraction.
        Parameters:
        date - the UTC time
        micros - the microseconds fraction
        Returns:
        a new UTC instance
      • createCalendar

        public static Calendar createCalendar()
        Gets the MJD 2000 calendar on which this UTC date/time is based. The date is initially set the 1st January 2000, 0:00.
        Returns:
        the MJD 2000 calendar
        See Also:
        getAsCalendar()
      • createDateFormat

        public static DateFormat createDateFormat​(String pattern)
        Creates a date format using the given pattern. The date format returned, will use the english locale ('en') and a calendar returned by the createCalendar() method.
        Parameters:
        pattern - the data format pattern
        Returns:
        a date format
        See Also:
        SimpleDateFormat
      • parse

        public static ProductData.UTC parse​(String text,
                                            String pattern)
                                     throws ParseException
        Parses a UTC value given as text. The method also considers an optional mircoseconds fraction at the end of the text string. The mircoseconds fraction is a dot '.' followed by a maximum of 6 digits.
        Parameters:
        text - a UTC value given as text
        pattern - the date/time pattern
        Returns:
        the UTC value represented by the given text
        Throws:
        ParseException - thrown if the text could not be parsed
        See Also:
        createCalendar(), createDateFormat()
      • parse

        public static ProductData.UTC parse​(String text,
                                            DateFormat dateFormat)
                                     throws ParseException
        Parses a UTC value given as text. The method also considers an optional mircoseconds fraction at the end of the text string. The mircoseconds fraction is a dot '.' followed by a maximum of 6 digits.
        Parameters:
        text - a UTC value given as text
        dateFormat - the date/time pattern
        Returns:
        the UTC value represented by the given text
        Throws:
        ParseException - thrown if the text could not be parsed
        See Also:
        createCalendar(), createDateFormat()
      • getAsCalendar

        public Calendar getAsCalendar()
        Gets the MJD 2000 calendar on which this UTC date/time is based. The date of the calendar is set to this UTC value.
        Returns:
        the MJD 2000 calendar
        See Also:
        createCalendar(), getAsDate()
      • getAsDate

        public Date getAsDate()
        Returns this UTC date/time value as a Date. The method interpretes this UTC value as a MJD 2000 date (Modified Julian Day where the first day is the 01.01.2000).
        See Also:
        getAsCalendar()
      • getMJD

        public double getMJD()
        Returns the Modified Julian Day 2000 (MJD2000) represented by this UTC value as double value.
        Returns:
        this UTC value computed as days
      • getDaysFraction

        public int getDaysFraction()
        Returns the days fraction of the Modified Julian Day (MJD) as a signed integer (the 1st element of the internal data array).
        Returns:
        This UTC's days fraction.
        See Also:
        getMJD()
      • getSecondsFraction

        public long getSecondsFraction()
        Returns the seconds fraction of the Modified Julian Day (MJD) as a signed integer (the 2nd element of the internal data array).
        Returns:
        This UTC's seconds fraction.
        See Also:
        getMJD()
      • getMicroSecondsFraction

        public long getMicroSecondsFraction()
        Returns the micro-seconds fraction of the Modified Julian Day (MJD) as a signed integer (the 3rd element of the internal data array).
        Returns:
        This UTC's micro-seconds fraction.
        See Also:
        getMJD()