Exemple #1
0
def solarterm(year, angle):
    ''' calculate Solar Term by secand method

    The Sun's moving speed on ecliptical longitude is 0.04 argsecond / second,

    The accuracy of nutation by IAU2000B is 0.001"

    Args:
        year: the year in integer
        angle: degree of the solar term, in integer
    Return:
        time in JDTT

        '''

    # mean error when compare apparentsun to NASA(1900-2100) is 0.05"
    # 0.000000005 radians = 0.001"
    ERROR = 0.000000005

    r = normrad(math.radians(angle))
    # negative angle means we want search backward from Vernal Equinox,
    # initialize x0 to the day which apparent Sun longitude close to the angle
    # we searching for
    est_vejd = g2jd(year, 3, 20.5)
    x0 = est_vejd + angle * 360.0 / 365.24  # estimate
    x1 = x0 + 0.5

    return rootbysecand(f_solarangle, r, x0, x1, precision=ERROR)
Exemple #2
0
def solarterm(year, angle):
    ''' calculate Solar Term by secand method

    The Sun's moving speed on ecliptical longitude is 0.04 argsecond / second,

    The accuracy of nutation by IAU2000B is 0.001"

    Args:
        year: the year in integer
        angle: degree of the solar term, in integer
    Return:
        time in JDTT

        '''

    # mean error when compare apparentsun to NASA(1900-2100) is 0.05"
    # 0.000000005 radians = 0.001"
    ERROR = 0.000000005

    r = normrad(math.radians(angle))
    # negative angle means we want search backward from Vernal Equinox,
    # initialize x0 to the day which apparent Sun longitude close to the angle
    # we searching for
    est_vejd = g2jd(year, 3, 20.5)
    x0 = est_vejd + angle * 360.0 / 365.24  # estimate
    x1 = x0 + 0.5

    return rootbysecand(f_solarangle, r, x0, x1, precision=ERROR)
Exemple #3
0
def main():
    #jd = 2444239.5
    jd = g2jd(1900, 1, 1)
    for i in range(10):
        l = normrad(lea406_full(jd))
        #d = fmtdeg(math.degrees(npitopi(e -l )))
        print(jd, l, fmtdeg(math.degrees(l)))
        jd += 2000
Exemple #4
0
def main():
    #jd = 2444239.5
    jd = g2jd(1900, 1, 1)
    for i in xrange(10):
        l = normrad(lea406_full(jd))
        #d = fmtdeg(math.degrees(npitopi(e -l )))
        print jd, l, fmtdeg(math.degrees(l))
        jd += 2000