def equinox_jd(gyear):
    """Calculate Julian day during which the March equinox, reckoned from the
    Tehran meridian, occurred for a given Gregorian year."""
    mean_jd = Sun.get_equinox_solstice(gyear, target='spring')
    deltat_jd = mean_jd - Epoch.tt2ut(gyear, 3) / (24 * 60 * 60.)
    # Apparent JD in universal time
    apparent_jd = deltat_jd + (Sun.equation_of_time(deltat_jd)[0] / (24 * 60.))
    # Correct for meridian of Tehran + 52.5 degrees
    return floor(apparent_jd.jde() + (52.5 / 360))
Exemple #2
0
def test_sun_equation_of_time():
    """Tests the equation_of_time() method of Sun class"""

    epoch = Epoch(1992, 10, 13.0)
    m, s = Sun.equation_of_time(epoch)

    assert abs(m) - 13 < TOL, \
        "ERROR: 1st equation_of_time() test, 'm' doesn't match"

    assert abs(round(s, 1)) - 42.6 < TOL, \
        "ERROR: 2nd equation_of_time() test, 's' doesn't match"