def toGMST(dt=None):
    """Converts the given Python datetime or Julian date (float) to
    Greenwich Mean Sidereal Time (GMST) (in radians) using the formula
    from D.A. Vallado (2004).

    See:

        D.A. Vallado, Fundamentals of Astrodynamics and Applications, p. 192
        http://books.google.com/books?id=PJLlWzMBKjkC&lpg=PA956&vq=192&pg=PA192
    """
    if dt is None or type(dt) is datetime.datetime:
        jd = toJulian(dt)
    else:
        jd = dt

    tUT1  = (jd - 2451545.0) / 36525.0
    gmst  = 67310.54841 + (876600 * 3600 + 8640184.812866) * tUT1
    gmst += 0.093104 * tUT1**2
    gmst -= 6.2e-6   * tUT1**3

    # Convert from seconds to degrees, i.e.
    # 86400 seconds / 360 degrees = 240 seconds / degree
    gmst /= 240.

    # Convert to radians
    gmst  = math.radians(gmst) % TwoPi

    if gmst < 0:
        gmst += TwoPi

    return gmst
def toGMST ( dt = None ) : if dt is None or type ( dt ) is datetime . datetime : jd = toJulian ( dt ) else : jd = dt tUT1 = ( jd - 2451545.0 ) / 36525.0 gmst = 67310.54841 + ( 876600 * 3600 + 8640184.812866 ) * tUT1 gmst += 0.093104 * tUT1 ** 2 gmst -= 6.2e-6 * tUT1 ** 3 gmst /= 240. gmst = math . radians ( gmst ) % TwoPi if gmst < 0 : gmst += TwoPi return gmst
Converts the given Python datetime or Julian date (float) to
    Greenwich Mean Sidereal Time (GMST) (in radians) using the formula
    from D.A. Vallado (2004).

    See:

        D.A. Vallado, Fundamentals of Astrodynamics and Applications, p. 192
        http://books.google.com/books?id=PJLlWzMBKjkC&lpg=PA956&vq=192&pg=PA192