Package nom.tam.fits

Class FitsDate


  • public class FitsDate
    extends java.lang.Object
    Fits date object parsed from the different type of date combinations
    • Field Detail

      • LOG

        private static final java.util.logging.Logger LOG
        logger to log to.
      • FIRST_THREE_CHARACTER_VALUE

        private static final int FIRST_THREE_CHARACTER_VALUE
        See Also:
        Constant Field Values
      • FIRST_TWO_CHARACTER_VALUE

        private static final int FIRST_TWO_CHARACTER_VALUE
        See Also:
        Constant Field Values
      • GMT

        private static final java.util.TimeZone GMT
      • NEW_FORMAT_DAY_OF_MONTH_GROUP

        private static final int NEW_FORMAT_DAY_OF_MONTH_GROUP
        See Also:
        Constant Field Values
      • NEW_FORMAT_MILLISECOND_GROUP

        private static final int NEW_FORMAT_MILLISECOND_GROUP
        See Also:
        Constant Field Values
      • NEW_FORMAT_MINUTE_GROUP

        private static final int NEW_FORMAT_MINUTE_GROUP
        See Also:
        Constant Field Values
      • NEW_FORMAT_MONTH_GROUP

        private static final int NEW_FORMAT_MONTH_GROUP
        See Also:
        Constant Field Values
      • NEW_FORMAT_SECOND_GROUP

        private static final int NEW_FORMAT_SECOND_GROUP
        See Also:
        Constant Field Values
      • NORMAL_REGEX

        private static final java.util.regex.Pattern NORMAL_REGEX
      • OLD_FORMAT_DAY_OF_MONTH_GROUP

        private static final int OLD_FORMAT_DAY_OF_MONTH_GROUP
        See Also:
        Constant Field Values
      • OLD_FORMAT_MONTH_GROUP

        private static final int OLD_FORMAT_MONTH_GROUP
        See Also:
        Constant Field Values
      • OLD_REGEX

        private static final java.util.regex.Pattern OLD_REGEX
      • TWO_DIGIT_MILISECONDS_FACTOR

        private static final int TWO_DIGIT_MILISECONDS_FACTOR
        See Also:
        Constant Field Values
      • date

        private java.util.Date date
      • hour

        private int hour
      • mday

        private int mday
      • millisecond

        private int millisecond
      • minute

        private int minute
      • month

        private int month
      • second

        private int second
      • year

        private int year
    • Constructor Detail

      • FitsDate

        public FitsDate​(java.lang.String dStr)
                 throws FitsException
        Convert a FITS date string to a Java Date object.
        Parameters:
        dStr - the FITS date
        Throws:
        FitsException - if dStr does not contain a valid FITS date.
    • Method Detail

      • getFitsDateString

        public static java.lang.String getFitsDateString()
        Returns:
        the current date in FITS date format
      • getFitsDateString

        public static java.lang.String getFitsDateString​(java.util.Date epoch)
        Parameters:
        epoch - The epoch to be converted to FITS format.
        Returns:
        a created FITS format date string Java Date object.
      • getFitsDateString

        public static java.lang.String getFitsDateString​(java.util.Date epoch,
                                                         boolean timeOfDay)
        Parameters:
        epoch - The epoch to be converted to FITS format.
        timeOfDay - Should time of day information be included?
        Returns:
        a created FITS format date string. Note that the date is not rounded.
      • getInt

        private static int getInt​(java.util.regex.Matcher match,
                                  int groupIndex)
      • getMilliseconds

        private static int getMilliseconds​(java.util.regex.Matcher match,
                                           int groupIndex)
      • toDate

        public java.util.Date toDate()
        Get a Java Date object corresponding to this FITS date.
        Returns:
        The Java Date object.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • appendThreeDigitValue

        private void appendThreeDigitValue​(java.lang.StringBuilder buf,
                                           int value)
      • appendTwoDigitValue

        private void appendTwoDigitValue​(java.lang.StringBuilder buf,
                                         int value)