brandon-rhodes / pyephem

Scientific-grade astronomy routines for Python
Other
783 stars 121 forks source link

'next_rising()' throws 'NeverUpError' - only searches one day #248

Closed mungewell closed 1 year ago

mungewell commented 2 years ago

This may well be a documentation issue, but it doesn't say that next_rising() is limited to searching to one day.

This started with a Twitter post, talking about how Barrow (in Alaska) is going to have 40'odd days without sun. And I thought to myself I'd validate with pyEphem...

A simple script threw the unexpected error: barrow_never_up

I was able to work around by scanning subsequent days with barrow.py.txt

Would it make sense to add a parameter (say 'limit') to provide a way to search for multiple days, or is there some other trick which I should/could be using?

Bernmeister commented 2 years ago

If you look at The PyEphem Tutorial and search for the line

Once PyEphem knows your location it can also work out when bodies rise, cross your meridian, and set each day.

that suggests to me that, yes, a search for the next rise/set is limited to a 24 hour (give or take) window (and so your solution to search subsequent days is your best bet).

mungewell commented 1 year ago

OK. Like I said I implemented a 'scan' through future days... thanks for your comments.