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

14. class SiderealTime: Sidereal time

An instance of this class represents a plain sidereal time in the range [0,24) hours. No attempt is made inside the object to record whether it represents Greenwich sidereal time (GST) or local sidereal time (LST).

Although the constructor accepts a value in hours, internally the value is stored as radians normalized to the interval [0,2π).

sidereal.py
# - - - - -   c l a s s   S i d e r e a l T i m e

class SiderealTime:
    """Represents a sidereal time value.

      State/Internals:
        .hours:     [ self as 15-degree hours ]
        .radians:   [ self as radians ]
    """

14.1. SiderealTime.__init__(): Constructor

The time in hours is first normalized to the interval [0,24) and stored in self.hours, then converted to radians and stored in self.radians.

sidereal.py
# - - -   S i d e r e a l T i m e . _ _ i n i t _ _

    def __init__ ( self, hours ):
        """Constructor for SiderealTime
        """
        self.hours  =  hours % 24.0
        self.radians  =  hoursToRadians ( self.hours )