def apparent_longitude(t='now'): """Returns the apparent longitude of the Sun.""" T = julian_centuries(t) omega = (259.18 - 1934.142 * T) * u.deg true_long = true_longitude(t) result = true_long - (0.00569 - 0.00479 * np.sin(omega)) * u.deg return Longitude(result)
def mean_anomaly(t='now'): """Returns the mean anomaly (the angle through which the Sun has moved assuming a circular orbit) as a function of time.""" T = julian_centuries(t) result = 358.475830 + 35999.049750 * T - 0.0001500 * T ** 2 - 0.00000330 * T ** 3 result = result * u.deg return Longitude(result)
def mean_anomaly(t=None): """Returns the mean anomaly (the angle through which the Sun has moved assuming a circular orbit) as a function of time.""" T = julian_centuries(t) result = 358.475830 + 35999.049750 * T - 0.0001500 * T**2 - 0.00000330 * T**3 result = result % 360.0 return result
def apparent_longitude(t=None): """Returns the apparent longitude of the Sun.""" T = julian_centuries(t) omega = 259.18 - 1934.142 * T true_long = true_longitude(t) result = true_long - 0.00569 - 0.00479 * np.sin(np.radians(omega)) return result
def apparent_longitude(t=None): """Returns the apparent longitude of the Sun.""" T = julian_centuries(t) omega = 259.18 - 1934.142 * T true_long = true_longitude(t) result = true_long - 0.00569 - 0.00479 * math.sin(np.radians(omega)) return result
def equation_of_center(t='now'): """Returns the Sun's equation of center (in degrees)""" T = julian_centuries(t) mna = mean_anomaly(t) result = ((1.9194600 - 0.0047890 * T - 0.0000140 * T ** 2) * np.sin(np.radians(mna)) + (0.0200940 - 0.0001000 * T) * np.sin(np.radians(2 * mna)) + 0.0002930 * np.sin(np.radians(3 * mna))) return result
def equation_of_center(t='now'): """Returns the Sun's equation of center (in degrees)""" T = julian_centuries(t) mna = mean_anomaly(t) result = ((1.9194600 - 0.0047890 * T - 0.0000140 * T**2) * np.sin(mna) + (0.0200940 - 0.0001000 * T) * np.sin(2 * mna) + 0.0002930 * np.sin(3 * mna)) result = result * u.deg return Angle(result)
def true_obliquity_of_ecliptic(t='now'): """ Returns the true obliquity of the ecliptic. """ T = julian_centuries(t) result = 23.452294 - 0.0130125 * T - 0.00000164 * T**2 + 0.000000503 * T**3 return Angle(result, u.deg)
def eccentricity_SunEarth_orbit(t='now'): """ Returns the eccentricity of the Sun Earth Orbit. """ T = julian_centuries(t) result = 0.016751040 - 0.00004180 * T - 0.0000001260 * T**2 return result
def equation_of_center(t=None): """Returns the Sun's equation of center (in degrees)""" T = julian_centuries(t) mna = mean_anomaly(t) result = ((1.9194600 - 0.0047890 * T - 0.0000140 * T ** 2) * np.sin(np.radians(mna) + (0.0200940 - 0.0001000 * T) * np.sin(np.radians(2 * mna)) + 0.0002930 * np.sin(np.radians(3 * mna)))) return result
def mean_ecliptic_longitude(t='now'): """ Returns the mean ecliptic longitude. """ T = julian_centuries(t) result = 279.696680 + 36000.76892 * T + 0.0003025 * T**2 result = result * u.deg return Longitude(result)
def geometric_mean_longitude(t='now'): """ Returns the geometric mean longitude (in degrees). """ T = julian_centuries(t) result = 279.696680 + 36000.76892 * T + 0.0003025 * T**2 result = result * u.deg return Longitude(result)
def eccentricity_sun_earth_orbit(t='now'): """ Returns the eccentricity of the Sun Earth Orbit. Parameters ---------- t : {parse_time_types} A time (usually the start time) specified as a palongitude_Sun_perigee, true_latitude and apparent_latitude need to be fixedrse_time-compatible time string, number, or a datetime object. """ T = julian_centuries(t) result = 0.016751040 - 0.00004180 * T - 0.0000001260 * T**2 return result
def true_obliquity_of_ecliptic(t='now'): """ Returns the true obliquity of the ecliptic. Parameters ---------- t : {parse_time_types} A time (usually the start time) specified as a parse_time-compatible time string, number, or a datetime object. """ T = julian_centuries(t) result = 23.452294 - 0.0130125 * T - 0.00000164 * T**2 + 0.000000503 * T**3 return Angle(result, u.deg)
def mean_ecliptic_longitude(t='now'): """ Returns the mean ecliptic longitude. Parameters ---------- t : {parse_time_types} A time (usually the start time) specified as a parse_time-compatible time string, number, or a datetime object. """ T = julian_centuries(t) result = 279.696680 + 36000.76892 * T + 0.0003025 * T**2 result = result * u.deg return Longitude(result)
def apparent_longitude(t='now'): """ Returns the apparent longitude of the Sun. Parameters ---------- t : {parse_time_types} A time (usually the start time) specified as a parse_time-compatible time string, number, or a datetime object. """ T = julian_centuries(t) omega = (259.18 - 1934.142 * T) * u.deg true_long = true_longitude(t) result = true_long - (0.00569 - 0.00479 * np.sin(omega)) * u.deg return Longitude(result)
def solar_north(t='now'): """Returns the position of the Solar north pole in degrees.""" T = julian_centuries(t) ob1 = true_obliquity_of_ecliptic(t) # in degrees i = 7.25 * u.deg k = (74.3646 + 1.395833 * T) * u.deg lamda = true_longitude(t) - (0.00569 * u.deg) omega = (259.18 - 1934.142 * T) * u.deg lamda2 = lamda - (0.00479 * np.sin(omega)) * u.deg diff = lamda - k x = np.arctan(-np.cos(lamda2) * np.tan(ob1)) y = np.arctan(-np.cos(diff) * np.tan(i)) result = x + y return Angle(result.to(u.deg))
def solar_north(t='now'): """Returns the position of the Solar north pole in degrees.""" T = julian_centuries(t) ob1 = true_obliquity_of_ecliptic(t) # 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 * np.sin(np.radians(omega)) diff = np.radians(lamda - k) x = np.degrees(np.arctan(-np.cos(np.radians(lamda2)*np.tan(np.radians(ob1))))) y = np.degrees(np.arctan(-np.cos(diff) * np.tan(np.radians(i)))) result = x + y return result
def solar_north(t=None): """Returns the position of the Solar north pole in degrees.""" T = julian_centuries(t) ob1 = true_obliquity_of_ecliptic(t) # 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 * np.sin(np.radians(omega)) diff = np.radians(lamda - k) x = np.degrees(np.arctan(-np.cos(np.radians(lamda2)*np.tan(np.radians(ob1))))) y = np.degrees(np.arctan(-np.cos(diff) * np.tan(np.radians(i)))) result = x + y return result
def mean_anomaly(t='now'): """ Returns the mean anomaly (the angle through which the Sun has moved assuming a circular orbit) as a function of time. Parameters ---------- t : {parse_time_types} A time (usually the start time) specified as a parse_time-compatible time string, number, or a datetime object. """ T = julian_centuries(t) result = 358.475830 + 35999.049750 * T - 0.0001500 * T**2 - 0.00000330 * T**3 result = result * u.deg return Longitude(result)
def solar_north(t='now'): """Returns the position of the Solar north pole in degrees.""" T = julian_centuries(t) ob1 = true_obliquity_of_ecliptic(t) # in degrees i = 7.25 * u.deg k = (74.3646 + 1.395833 * T) * u.deg lamda = true_longitude(t) - (0.00569 * u.deg) omega = apparent_longitude(t) lamda2 = lamda - (0.00479 * np.sin(omega)) * u.deg diff = lamda - k x = np.arctan(-np.cos((lamda2) * np.tan(ob1))) y = np.arctan(-np.cos(diff) * np.tan(i)) result = x + y return Angle(result.to(u.deg))
def equation_of_center(t='now'): """ Returns the Sun's equation of center (in degrees). Parameters ---------- t : {parse_time_types} A time (usually the start time) specified as a parse_time-compatible time string, number, or a datetime object. """ T = julian_centuries(t) mna = mean_anomaly(t) result = ((1.9194600 - 0.0047890 * T - 0.0000140 * T**2) * np.sin(mna) + (0.0200940 - 0.0001000 * T) * np.sin(2 * mna) + 0.0002930 * np.sin(3 * mna)) result = result * u.deg return Angle(result)
def heliographic_solar_center(t='now'): """Returns the position of the solar center in heliographic coordinates.""" jd = julian_day(t) T = julian_centuries(t) # Heliographic coordinates in degrees theta = ((jd - 2398220)*360/25.38) * u.deg i = 7.25 * u.deg k = (74.3646 + 1.395833 * T) * u.deg lamda = true_longitude(t) - 0.00569 * u.deg diff = lamda - k # Latitude at center of disk (deg): he_lat = np.degrees(np.arcsin(np.sin(diff)*np.sin(i))) # Longitude at center of disk (deg): y = -np.sin(diff)*np.cos(i) x = -np.cos(diff) rpol = (np.arctan2(y, x)) he_lon = rpol - theta return [Longitude(he_lon), Latitude(he_lat)]
def heliographic_solar_center(t='now'): """Returns the position of the solar center in heliographic coordinates.""" jd = julian_day(t) T = julian_centuries(t) # Heliographic coordinates in degrees theta = ((jd - 2398220)*360/25.38) * u.deg i = 7.25 * u.deg k = (74.3646 + 1.395833 * T) * u.deg lamda = true_longitude(t) - 0.00569 * u.deg diff = lamda - k # Latitude at center of disk (deg): he_lat = np.arcsin(np.sin(diff)*np.sin(i)) # Longitude at center of disk (deg): y = -np.sin(diff)*np.cos(i) x = -np.cos(diff) rpol = (np.arctan2(y, x)) he_lon = rpol - theta return (Longitude(he_lon.to(u.deg)), Latitude(he_lat.to(u.deg)))
def heliographic_solar_center(t=None): """Returns the position of the solar center in heliographic coordinates.""" jd = julian_day(t) T = 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_day(t) T = 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(np.arcsin(np.sin(diff)*np.sin(np.radians(i)))) # Longitude at center of disk (deg): y = -np.sin(diff)*np.cos(np.radians(i)) x = -np.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 true_obliquity_of_ecliptic(t="now"): T = julian_centuries(t) result = 23.452294 - 0.0130125 * T - 0.00000164 * T ** 2 + 0.000000503 * T ** 3 return Angle(result, u.deg)
def geometric_mean_longitude(t=None): """Returns the geometric mean longitude (in degrees)""" T = julian_centuries(t) result = 279.696680 + 36000.76892 * T + 0.0003025 * T ** 2 result = result % 360.0 return result
def mean_ecliptic_longitude(t=None): """Returns the mean ecliptic longitude.""" T = julian_centuries(t) result = 279.696680 + 36000.76892 * T + 0.0003025 * T**2 result = result % 360.0 return result
def true_obliquity_of_ecliptic(t=None): T = julian_centuries(t) result = 23.452294 - 0.0130125 * T - 0.00000164 * T**2 + 0.000000503 * T**3 return result
def true_obliquity_of_ecliptic(t=None): T = julian_centuries(t) result = 23.452294 - 0.0130125 * T - 0.00000164 * T ** 2 + 0.000000503 * T ** 3 return result
def geometric_mean_longitude(t=None): """Returns the geometric mean longitude (in degrees)""" T = julian_centuries(t) result = 279.696680 + 36000.76892 * T + 0.0003025 * T**2 result = result % 360.0 return result
def mean_ecliptic_longitude(t=None): """Returns the mean ecliptic longitude.""" T = julian_centuries(t) result = 279.696680 + 36000.76892 * T + 0.0003025 * T ** 2 result = result % 360.0 return result