Next / Previous / Contents / TCC Help System / NM Tech homepage

13. class JulianDate: Julian calendar timestamp

For a discussion of the Julian date system, see the specification.

sidereal.py
# - - - - -   c l a s s   J u l i a n D a t e

class JulianDate:
    """Class to represent Julian-date timestamps.

      State/Invariants:
        .f:  [ (Julian date as a float) - JULIAN_BIAS ]
    """

13.1. JulianDate.__init__(): Constructor

The value represented is the some of the two arguments (the second of which default to zero), but JULIAN_BIAS is subtracted before the two argument values are added, to avoid loss of significance.

sidereal.py
# - - -   J u l i a n D a t e . _ _ i n i t _ _

    def __init__ ( self, j, f=0.0 ):
        """Constructor for JulianDate.
        """
        self.j  =  j - JULIAN_BIAS + f