Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange results for midnight sun #351

Closed
sheridansmall opened this issue Mar 26, 2020 · 3 comments
Closed

Strange results for midnight sun #351

sheridansmall opened this issue Mar 26, 2020 · 3 comments

Comments

@sheridansmall
Copy link

Reading from https://rhodesmill.org/skyfield/almanac.html#sunrise-and-sunset

The result t will be an array of times, and y will be True if the sun rises at the corresponding time and False if it sets.

using the code:

from skyfield import api, almanac

ts = api.load.timescale()
t0 = ts.utc(2020, 6, 24)
t1 = ts.utc(2020, 6, 25)
e = api.load('de421.bsp')
bluffton = api.Topos(latitude=70.85, longitude=-8.6667)
t, y = almanac.find_discrete(t0, t1, almanac.sunrise_sunset(e, bluffton))
print(t)
print(y)

We get the result:

<Time tt=[]>
[ True  True  True  True  True  True  True  True  True  True  True  True
  True  True  True  True  True  True  True  True  True  True  True  True]

I was expecting y to be an empty list as there are no corresponding times.

Is there another way of determining if the sun will rise or set?

@brandon-rhodes
Copy link
Member

Yes, y should be empty — that was fixed in the code a few weeks ago but there hasn't been a release yet. I'll get a release out today so that the fix is in public. Thanks for reminding me that it's been more than a month without a release! I must be giving in too often to the temptation, "oh, if I wait a couple of more days, I can fit in yet another code improvement."

@sheridansmall
Copy link
Author

Thanks Skyfield is a great piece of software.

@brandon-rhodes
Copy link
Member

I've just made a release of 1.18! Hopefully that will solve the problem for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants