Skip to content

Commit

Permalink
Fixed an algorithm bug and used the new func
Browse files Browse the repository at this point in the history
  • Loading branch information
infinitelarge committed Jul 29, 2023
1 parent 0c1f5eb commit 63508c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sunmoon/sunmoon.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ def sunrise(Jday,longitude,latitude):
# 太阳视黄经
l = ct.sun_look_longtitude(Jday)
#太阳视赤经
alpha = np.arctan2(np.cos(l) * np.sin(l), np.cos(l)) #O代表太阳视黄经,l代表太阳视黄纬
alpha = ct.ecliptic_to_equatorial(ct.sun_true_longitude(Jday),ct.sun_true_latitude(Jday),Jday)[0]
#太阳视赤纬,公式来源:https://en.wikipedia.org/wiki/Sunrise_equation
delta = np.arcsin(np.sin(O) * np.sin(l))
delta = ct.ecliptic_to_equatorial(ct.sun_true_longitude(Jday),ct.sun_true_latitude(Jday),Jday)[1]
#太阳视地方时角,公式来源:https://en.wikipedia.org/wiki/Sunrise_equation
H = np.arccos((np.sin(np.radians(-0.83)) - np.sin(np.radians(latitude)) * np.sin(delta)) / (np.cos(np.radians(latitude)) * np.cos(delta)))
#太阳视地方时角
Expand Down

0 comments on commit 63508c8

Please sign in to comment.