skyfielders / python-skyfield

Elegant astronomy for Python
MIT License
1.43k stars 213 forks source link

request for feature: next_transit #265

Closed tetrismegistus closed 4 years ago

tetrismegistus commented 5 years ago

Hi, in pyephem I had been using the next_transit feature as in this block of code:

def set_sun_markers(self):
        sun = ephem.Sun()
        markers = [str(self.observer.previous_rising(sun)),
                   str(self.observer.next_transit(sun)),
                   str(self.observer.next_setting(sun)),
                   str(self.observer.next_rising(sun))]
        for i in range(len(markers)):
            utc = datetime.strptime(markers[i], '%Y/%m/%d %H:%M:%S')
            markers[i] = self.convert_zone(utc, self.utc_zone, self.time_zone)
            markers[i] = markers[i].replace(second=0, microsecond=0)
        return markers

I understand this feature does not currently exist in skyfield, but it would be helpful if it did exist!

Thank you for your consideration.

brandon-rhodes commented 4 years ago

A feature to find when a satellite passes overhead has just been released in the new version of Skyfield:

https://rhodesmill.org/skyfield/earth-satellites.html#finding-when-a-satellite-rises-and-sets

Enjoy!

tetrismegistus commented 4 years ago

Thank you SO MUCH!!!!!!!!!!!!!!!!!!!