You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I started getting this error about a week ago (getting close to summer solistice I'm guessing) for a location that's fairly up north, but nowhere near the pole - lat,lon = 62.55,-129.52.
I've traced it back to the following code:
def _hour_angle(self, latitude, declination, depression):
# arg values: 62.54999923706055, 21.466634091977532, 96
latitude_rad = radians(latitude)
declination_rad = radians(declination)
depression_rad = radians(depression)
n = cos(depression_rad)
d = cos(latitude_rad) * cos(declination_rad)
t = tan(latitude_rad) * tan(declination_rad)
h = (n / d) - t # h: -1.0006730127306969 <- out of range for acos
HA = acos(h) # Exception here.
return HA
I'm not sure how to handle this. Is astral not supposed to work in my case?
The text was updated successfully, but these errors were encountered:
@exfizik one thing to note is that when using python cosine, it does return negative values and you should check for that.
n = cos(depression_rad)
look at your example and remember that 1 - sqrt(1-pow(sin(depression_rad), 2))) is the same as cos(depression_rad). Not as cool looking but it might give you a better answer.
I started getting this error about a week ago (getting close to summer solistice I'm guessing) for a location that's fairly up north, but nowhere near the pole - lat,lon = 62.55,-129.52.
I've traced it back to the following code:
I'm not sure how to handle this. Is astral not supposed to work in my case?
The text was updated successfully, but these errors were encountered: