Solar Declination
The solar declination ( ) is the angle between the direction of the Sun and the equatorial plane of the Earth. It ranges from -23°27' during the winter solstice to +23°27' during the summer solstice, and is null during the equinoxes.
We calculate the solar declination using the algorithm of the Global Monitoring Laboratory of the US National Oceania and Atmospheric Administration (NOAA) (Source: https://gml.noaa.gov/grad/solcalc/calcdetails.html (opens in a new tab))
Calculation Step by Step
1. Geometric Mean Longitude of the Sun (degrees):
The average position of the Sun along the ecliptic plane as seen from Earth, measured in degrees. This does not take into account perturbations due to the Earth’s elliptical orbit and other factors.
Where:
- is the Julian Century
2. Geometric Mean Anomaly of the Sun (degrees):
A measure of the Sun’s position along its elliptical orbit around the Earth, relative to its position at perihelion (the closest point to the Earth), expressed in degrees.
3. Eccentricity of Earth’s Orbit:
A dimensionless parameter that describes the deviation of Earth’s orbit from being a perfect circle. The eccentricity determines how elliptical (oval-shaped) the orbit is.
4. Sun’s Equation of Center:
The correction factor applied to the geometric mean longitude of the Sun to account for the elliptical shape of Earth’s orbit. This correction gives the true position of the Sun in its orbit.
5. Sun’s True Longitude (degrees):
The actual position of the Sun along the ecliptic plane, taking into account the equation of center. This is the geometric mean longitude plus the equation of center.
6. Sun’s True Anomaly (degrees):
The true angular distance of the Sun from its perihelion, measured along the ecliptic plane. It gives the actual position of the Sun in its orbit relative to the closest point to the Earth.
7. Sun’s Radial Vector (Astronomical Units):
The distance from the Earth to the Sun at a given point in time, measured in Astronomical Units (AU). One AU is the average distance between the Earth and the Sun.
8. Sun’s Apparent Longitude (degrees):
The position of the Sun along the ecliptic plane as observed from Earth, corrected for the Earth’s axial tilt (nutation) and the aberration of light. This is the longitude where the Sun appears to be in the sky.
9. Mean Obliquity of the Ecliptic (degrees):
The average angle between Earth’s equatorial plane and the ecliptic plane (the plane of Earth’s orbit around the Sun). This angle varies slowly over time due to gravitational interactions.
10. Obliquity Correction (degrees):
The corrected value of the obliquity of the ecliptic, accounting for the long-term variations in Earth’s tilt. This corrected value is used in precise astronomical calculations.
11. Sun’s Right Ascension (degrees):
The angular distance of the Sun measured eastward along the celestial equator from the vernal equinox. Right ascension is one of the coordinates used in the equatorial coordinate system, analogous to longitude on Earth.
12. Sun’s Declination (degrees):
The angle between the rays of the Sun and the plane of the Earth’s equator. This measures how far north or south of the celestial equator the Sun is at a given time.
Code Implementation
import math
from .julian_date import julian_date
from .julian_century import julian_century
from .earth_parameters import mean_obliquity_of_ecliptic, obliquity_correction, eccentricity_of_earth_orbit
from .sun_parameters import geom_mean_long_sun, geomc_mean_anom_sun, sun_equation_center, sun_true_long, sun_app_long
def _calculate_sun_declination(epsilon: float, lambda_app: float) -> float:
return math.degrees(math.asin(math.sin(math.radians(epsilon)) * math.sin(math.radians(lambda_app))))
def sun_declination(year:int, month:int, day:int, hours_past_midnight:float=0, utc_offset:float=0) -> float:
# Julian Date
j_d = julian_date(year, month, day, hours_past_midnight, utc_offset)
# Julian Century
j_c = julian_century(j_d)
# Geometric Mean Longitude of the Sun
sun_longit = geom_mean_long_sun(j_c)
# Geometric Mean Anomaly of the Sun
mean_anom = geomc_mean_anom_sun(j_c)
# Eccentricity of Earth's Orbit
epsilon = eccentricity_of_earth_orbit(j_c)
# Sun's Equation of Center
e_o_c = sun_equation_center(j_c, mean_anom)
# Sun's True Longitude
lambda_sun = sun_true_long(sun_longit, e_o_c)
# Sun's Apparent Longitude
lambda_app = sun_app_long(lambda_sun, j_c)
# Mean Obliquity of Ecliptic
epsilon_0 = mean_obliquity_of_ecliptic(j_c)
# Obliquity Correction
epsilon = obliquity_correction(epsilon_0, j_c)
# Sun's Declination
delta = _calculate_sun_declination(epsilon, lambda_app)
return delta
↗ View in github