1

The example given in Ephem works fine, what the problem is using the observers exact longitude which is not shown in the examples.

Instead of using a general location of a city, I need to use the exact longitude of the observer.

import ephem
madrid = ephem.city('Madrid')
madrid.date = '1978/10/3 11:32'
print(madrid.sidereal_time())

1 Answer 1

1

Create your own Observer instead of using a pre-built one from the city() function, and set its longitude and latitude yourself:

import ephem
gatech = ephem.Observer()
gatech.lon, gatech.lat = '-84.39733', '33.775867'
gatech.date = '1978/10/3 11:32'
print(gatech.sidereal_time())

You can read more about creating your own observer objects by reading about “Computations for Particular Observers” in the documentation:

http://rhodesmill.org/pyephem/tutorial.html#computations-for-particular-observers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.