1

I have a very simple code to get the longitude of the sun but when I compare the output to Astrolog and Astrodienst its incorrect, there is a 13 minute difference. I have not added Observer as I think default is midnight GMT (which is what I want). What am I doing wrong?

import ephem

start = ephem.date('2015/01/01')
end = ephem.date('2015/12/31')
f2 = open("Sun", 'w')
while start <= end:
    sun = ephem.Sun(start)
    ecl = ephem.Ecliptic(sun)
    f2.write(str(ephem.date(start))+' '+ str(ecl.lon) +'\n')
    start+=1
f2.close()

Example of results for 2015/12/30:

code - 2015/12/30 00:00:00 277:43:36.6

Astrodienst - 7°56'39 Cap

Thanks

1 Answer 1

1

The reason why the 13 minute difference is because of the epoch setting, when I added

sun = ephem.Sun(start, epoch = start)

the results were the same as swiss ephemeris.

Sign up to request clarification or add additional context in comments.

1 Comment

I have only ticked this to close the question, as it drew no responses. Sorry for wasting peoples time.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.