Пример #1
0
def solar_north(t=None):
    """Returns the position of the Solar north pole in degrees."""
    jd = util.julian_day(t)
    T = util.julian_centuries(t)
    ob1 = true_obliquity_of_ecliptic(t)
    theta = (jd - 2398220)*360/25.38
    # in degrees
    i = 7.25
    k = 74.3646 + 1.395833 * T
    lamda = true_longitude(t) - 0.00569
    omega = apparent_longitude(t)
    lamda2 = lamda - 0.00479 * math.sin(np.radians(omega))
    diff = np.radians(lamda - k)
    x = np.degrees(math.atan(-math.cos(np.radians(lamda2)*math.tan(np.radians(ob1)))))
    y = np.degrees(math.atan(-math.cos(diff)*math.tan(np.radians(i))))
    result = x + y
    return result
Пример #2
0
def heliographic_solar_center(t=None):
    """Returns the position of the solar center in heliographic coordinates."""
    jd = util.julian_day(t)
    T = util.julian_centuries(t)
    # Heliographic coordinates in degrees
    theta = (jd - 2398220) * 360 / 25.38
    i = 7.25
    k = 74.3646 + 1.395833 * T
    lamda = true_longitude(t) - 0.00569
    omega = apparent_longitude(t)
    lamda2 = lamda - 0.00479 * math.sin(np.radians(omega))
    diff = np.radians(lamda - k)
    # Latitude at center of disk (deg):
    he_lat = np.degrees(math.asin(math.sin(diff) * math.sin(np.radians(i))))
    # Longitude at center of disk (deg):
    y = -math.sin(diff) * math.cos(np.radians(i))
    x = -math.cos(diff)
    rpol = cmath.polar(complex(x, y))
    he_lon = np.degrees(rpol[1]) - theta
    he_lon = he_lon % 360
    if he_lon < 0:
        he_lon = he_lon + 360.0

    return [he_lon, he_lat]
Пример #3
0
def test_julian_day():
    assert util.julian_day('1900-01-01 12:00') == 2415021.0
    assert util.julian_day(LANDING) == 2439159.5
    result = util.julian_day('2000-03-01 15:30:26')
    assert_almost_equal(result, 2451605.1461111, decimal=3)
Пример #4
0
def carrington_rotation_number(t=None):
    """Return the Carrington Rotation number"""
    jd = util.julian_day(t)
    result = (1.0 / 27.2753) * (jd - 2398167.0) + 1.0
    return result