Skip to content

Commit

Permalink
ensure that sunup is always earlier than sundown
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinMohrmann committed May 16, 2024
1 parent 48879d1 commit feeffc6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions glidertools/optics.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@ def sunset_sunrise(time, lat, lon):
sundown.hour[0],
sundown.minute[0],
).to_datetime64()
# adressing glidertools issue #202 where su>sd for longitudes > 70E
su = (su - np.timedelta64(1, "D")) if su > sd else su

sunrise.append(su)
sunset.append(sd)
Expand Down

0 comments on commit feeffc6

Please sign in to comment.