def heliographic_solar_center(t=None): """Returns the position of the solar center in heliographic coordinates.""" jd = julian.julian_day(t) T = julian.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]
def heliographic_solar_center(t=None): """Returns the position of the solar center in heliographic coordinates.""" jd = julian.julian_day(t) T = julian.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]
def test_julian_day4(): """should return julian day for date 4""" expected_day = 2018395.499988426 assert julian.julian_day(DATETIME_DATE_4) == expected_day assert julian.julian_day(STRING_DATE_4) == expected_day
def test_julian_day3(): """should return julian day for date 3""" expected_day = 2515138.7097222223 assert julian.julian_day(DATETIME_DATE_3) == expected_day assert julian.julian_day(STRING_DATE_3) == expected_day
def test_julian_day2(): """should return julian day for date 2""" expected_day = 2446028.097974537 assert julian.julian_day(DATETIME_DATE_2) == expected_day assert julian.julian_day(STRING_DATE_2) == expected_day
def test_julian_day1(): """should return julian day for date 1""" expected_day = 2415021.0 assert julian.julian_day(DATETIME_DATE_1) == expected_day assert julian.julian_day(STRING_DATE_1) == expected_day
def test_julian_day(): assert julian.julian_day('1900-01-01 12:00') == 2415021.0 assert julian.julian_day(LANDING) == 2439159.5 result = julian.julian_day('2000-03-01 15:30:26') assert_almost_equal(result, 2451605.1461111, decimal=3)
def test_julian_day1(): """should return julian day for date 1""" expected_day = julian.JULIAN_DAY_ON_NOON01JAN1900 assert julian.julian_day(DATETIME_DATE_1) == expected_day assert julian.julian_day(STRING_DATE_1) == expected_day
def carrington_rotation_number(t=None): """Return the Carrington Rotation number""" jd = julian.julian_day(t) result = (1. / 27.2753) * (jd - 2398167.0) + 1.0 return result